libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
TextBlock::TextLine Class Reference

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< WordWordPtr
 
typedef std::weak_ptr< WhiteSpaceWhiteSpacePtr
 
typedef std::weak_ptr< HyphenHyphenPtr
 

Public Member Functions

 TextLine (const TextLine &)=delete
 
 TextLine (TextLine &&)=default
 
virtual ~TextLine () override
 
TextLineoperator= (const TextLine &)=delete
 
TextLineoperator= (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< LineElementPtrGetLineElements () 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...
 
WordGetWord (const Id &id_)
 Returns a word contained in the line. More...
 
WordAddWord (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...
 
WordAddWordAfter (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...
 
WordAddWordBefore (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
 

Detailed Description

Alto text line.

Author
Yann LEYDIER

Definition at line 46 of file CRNAltoTextBlock.hpp.

Member Typedef Documentation

typedef std::weak_ptr<Hyphen> TextBlock::TextLine::HyphenPtr

Definition at line 264 of file CRNAltoTextBlock.hpp.

Definition at line 126 of file CRNAltoTextBlock.hpp.

Definition at line 238 of file CRNAltoTextBlock.hpp.

typedef std::weak_ptr<Word> TextBlock::TextLine::WordPtr

Definition at line 196 of file CRNAltoTextBlock.hpp.

Constructor & Destructor Documentation

TextBlock::TextLine::TextLine ( const TextLine )
delete
TextBlock::TextLine::TextLine ( TextLine &&  )
default
virtual TextBlock::TextLine::~TextLine ( )
inlineoverridevirtual

Definition at line 51 of file CRNAltoTextBlock.hpp.

Member Function Documentation

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.

const Id& TextBlock::TextLine::GetId ( ) const
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.

size_t TextBlock::TextLine::GetNbLineElements ( ) const
inline

Returns the number of elements in the line.

Definition at line 131 of file CRNAltoTextBlock.hpp.

size_t TextBlock::TextLine::GetNbWords ( ) const
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.

TextLine& TextBlock::TextLine::operator= ( const TextLine )
delete
TextLine& TextBlock::TextLine::operator= ( TextLine &&  )
default
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.

Friends And Related Function Documentation

friend class TextBlock
friend

Definition at line 279 of file CRNAltoTextBlock.hpp.


The documentation for this class was generated from the following file: