|
libcrn
3.9.5
A document image processing library
|
Alto text line. More...
#include <CRNAltoTextBlock.hpp>
Inheritance diagram for TextBlock::TextLine:
Collaboration diagram for TextBlock::TextLine:Classes | |
| class | Hyphen |
| Alto hyphen ("HYP" element) More... | |
| class | LineElement |
| Base class for elements in a text line. More... | |
| class | WhiteSpace |
| Alto white space ("SP" element) More... | |
| class | Word |
| Alto word ("String" element) More... | |
Public Types | |
| typedef std::weak_ptr < LineElement > | LineElementPtr |
| typedef std::weak_ptr< Word > | WordPtr |
| typedef std::weak_ptr< WhiteSpace > | WhiteSpacePtr |
| typedef std::weak_ptr< Hyphen > | HyphenPtr |
Public Member Functions | |
| TextLine (const TextLine &)=delete | |
| TextLine (TextLine &&)=default | |
| virtual | ~TextLine () override |
| TextLine & | operator= (const TextLine &)=delete |
| TextLine & | operator= (TextLine &&)=default |
| const Id & | GetId () const |
| Returns the id of the element. More... | |
| std::vector< Id > | GetStyles () const |
| Returns the list of style references. More... | |
| void | AddStyle (const Id &styleid) |
| Adds a reference to a style. More... | |
| void | RemoveStyle (const Id &styleid) |
| Removes a reference to a style. More... | |
| double | GetWidth () const |
| Returns the width of the line. More... | |
| void | SetWidth (double d) |
| Sets the width of the line. More... | |
| double | GetHeight () const |
| Returns the height of the line. More... | |
| void | SetHeight (double d) |
| Sets the height of the line. More... | |
| double | GetHPos () const |
| Returns the abscissa of the line. More... | |
| void | SetHPos (double d) |
| Sets the abscissa of the line. More... | |
| double | GetVPos () const |
| Returns the ordinate of the line. More... | |
| void | SetVPos (double d) |
| Sets the ordinate of the line. More... | |
| Option< double > | GetBaseline () const |
| Returns the ordinate of the baseline. More... | |
| void | SetBaseline (double d, bool check_bounds=true) |
| Sets the baseline ordinate. More... | |
| void | UnsetBaseline () |
| Unsets the baseline ordinate. More... | |
| Option< bool > | GetManuallyCorrected () const |
| Returns whether the line was manually corrected or not. More... | |
| void | SetManuallyCorrected (bool c) |
| Sets whether the line was manually corrected or not. More... | |
| void | UnsetManuallyCorrected () |
| Unsets whether the line was manually corrected or not. More... | |
| std::vector< LineElementPtr > | GetLineElements () const |
| Returns the list of elements in the line. More... | |
| size_t | GetNbLineElements () const |
| Returns the number of elements in the line. More... | |
| const std::vector< WordPtr > & | GetWords () const |
| Returns the list of words in the line. More... | |
| size_t | GetNbWords () const |
| Returns the number of words in the line. More... | |
| Word & | GetWord (const Id &id_) |
| Returns a word contained in the line. More... | |
| Word & | AddWord (const Id &id_, const StringUTF8 &text, const Option< double > &x=Option< double >(), const Option< double > &y=Option< double >(), const Option< double > &w=Option< double >(), const Option< double > &h=Option< double >()) |
| Adds a word in the line. More... | |
| Word & | AddWordAfter (const Id &pred, const Id &id_, const StringUTF8 &text, const Option< double > &x=Option< double >(), const Option< double > &y=Option< double >(), const Option< double > &w=Option< double >(), const Option< double > &h=Option< double >()) |
| Adds a word in the line. More... | |
| Word & | AddWordBefore (const Id &next, const Id &id_, const StringUTF8 &text, const Option< double > &x=Option< double >(), const Option< double > &y=Option< double >(), const Option< double > &w=Option< double >(), const Option< double > &h=Option< double >()) |
| Adds a word in the line. More... | |
| void | RemoveWord (const Id &wid) |
| Removes a word. More... | |
Friends | |
| class | TextBlock |
Alto text line.
Definition at line 46 of file CRNAltoTextBlock.hpp.
| typedef std::weak_ptr<Hyphen> TextBlock::TextLine::HyphenPtr |
Definition at line 264 of file CRNAltoTextBlock.hpp.
| typedef std::weak_ptr<LineElement> TextBlock::TextLine::LineElementPtr |
Definition at line 126 of file CRNAltoTextBlock.hpp.
| typedef std::weak_ptr<WhiteSpace> TextBlock::TextLine::WhiteSpacePtr |
Definition at line 238 of file CRNAltoTextBlock.hpp.
| typedef std::weak_ptr<Word> TextBlock::TextLine::WordPtr |
Definition at line 196 of file CRNAltoTextBlock.hpp.
|
delete |
|
default |
|
inlineoverridevirtual |
Definition at line 51 of file CRNAltoTextBlock.hpp.
| void TextBlock::TextLine::AddStyle | ( | const Id & | styleid | ) |
Adds a reference to a style.
| Word& TextBlock::TextLine::AddWord | ( | const Id & | id_, |
| const StringUTF8 & | text, | ||
| const Option< double > & | x = Option< double >(), |
||
| const Option< double > & | y = Option< double >(), |
||
| const Option< double > & | w = Option< double >(), |
||
| const Option< double > & | h = Option< double >() |
||
| ) |
Adds a word in the line.
| Word& TextBlock::TextLine::AddWordAfter | ( | const Id & | pred, |
| const Id & | id_, | ||
| const StringUTF8 & | text, | ||
| const Option< double > & | x = Option< double >(), |
||
| const Option< double > & | y = Option< double >(), |
||
| const Option< double > & | w = Option< double >(), |
||
| const Option< double > & | h = Option< double >() |
||
| ) |
Adds a word in the line.
| Word& TextBlock::TextLine::AddWordBefore | ( | const Id & | next, |
| const Id & | id_, | ||
| const StringUTF8 & | text, | ||
| const Option< double > & | x = Option< double >(), |
||
| const Option< double > & | y = Option< double >(), |
||
| const Option< double > & | w = Option< double >(), |
||
| const Option< double > & | h = Option< double >() |
||
| ) |
Adds a word in the line.
| Option<double> TextBlock::TextLine::GetBaseline | ( | ) | const |
Returns the ordinate of the baseline.
| double TextBlock::TextLine::GetHeight | ( | ) | const |
Returns the height of the line.
| double TextBlock::TextLine::GetHPos | ( | ) | const |
Returns the abscissa of the line.
|
inline |
Returns the id of the element.
Definition at line 56 of file CRNAltoTextBlock.hpp.
| std::vector<LineElementPtr> TextBlock::TextLine::GetLineElements | ( | ) | const |
Returns the list of elements in the line.
| Option<bool> TextBlock::TextLine::GetManuallyCorrected | ( | ) | const |
Returns whether the line was manually corrected or not.
|
inline |
Returns the number of elements in the line.
Definition at line 131 of file CRNAltoTextBlock.hpp.
|
inline |
Returns the number of words in the line.
Definition at line 201 of file CRNAltoTextBlock.hpp.
| std::vector<Id> TextBlock::TextLine::GetStyles | ( | ) | const |
Returns the list of style references.
| double TextBlock::TextLine::GetVPos | ( | ) | const |
Returns the ordinate of the line.
| double TextBlock::TextLine::GetWidth | ( | ) | const |
Returns the width of the line.
| Word& TextBlock::TextLine::GetWord | ( | const Id & | id_ | ) |
Returns a word contained in the line.
| const std::vector<WordPtr>& TextBlock::TextLine::GetWords | ( | ) | const |
Returns the list of words in the line.
| void TextBlock::TextLine::RemoveStyle | ( | const Id & | styleid | ) |
Removes a reference to a style.
| void TextBlock::TextLine::RemoveWord | ( | const Id & | wid | ) |
Removes a word.
| void TextBlock::TextLine::SetBaseline | ( | double | d, |
| bool | check_bounds = true |
||
| ) |
Sets the baseline ordinate.
| void TextBlock::TextLine::SetHeight | ( | double | d | ) |
Sets the height of the line.
| void TextBlock::TextLine::SetHPos | ( | double | d | ) |
Sets the abscissa of the line.
| void TextBlock::TextLine::SetManuallyCorrected | ( | bool | c | ) |
Sets whether the line was manually corrected or not.
| void TextBlock::TextLine::SetVPos | ( | double | d | ) |
Sets the ordinate of the line.
| void TextBlock::TextLine::SetWidth | ( | double | d | ) |
Sets the width of the line.
| void TextBlock::TextLine::UnsetBaseline | ( | ) |
Unsets the baseline ordinate.
| void TextBlock::TextLine::UnsetManuallyCorrected | ( | ) |
Unsets whether the line was manually corrected or not.
|
friend |
Definition at line 279 of file CRNAltoTextBlock.hpp.
1.8.6