Read@CVL
rdf::TextBlock Class Reference

Represents a text block. A single text block has a boundary region and (possibly) a set of super pixels that are geometrically part of the text region. More...

#include <PixelSet.h>

Inheritance diagram for rdf::TextBlock:
Collaboration diagram for rdf::TextBlock:

Public Types

enum  mDrawFlags {
  draw_nothing = 0x0, draw_poly = 0x1, draw_text_lines = 0x2, draw_pixels = 0x4,
  draw_end
}
 
typedef Flags< mDrawFlagsDrawFlags
 

Public Member Functions

 TextBlock (const Polygon &poly=Polygon(), const QString &id="")
 
void addPixels (const PixelSet &ps)
 Filters pixels w.r.t the text blocks boundary. Hence only pixels that are within the given boundary are added. More...
 
PixelSet pixelSet () const
 
void scale (double factor) override
 
Polygon poly () const
 
void setTextLines (const QVector< QSharedPointer< TextLineSet > > &textLines)
 
QVector< QSharedPointer< TextLineSet > > textLines () const
 
bool remove (const QSharedPointer< TextLineSet > &tl)
 Removes the textline from the text block. More...
 
void cleanTextLines ()
 
QSharedPointer< RegiontoTextRegion () const
 
void draw (QPainter &p, const DrawFlags &df=DrawFlags()|draw_poly|draw_text_lines)
 
virtual QString toString () const override
 
- Public Member Functions inherited from rdf::BaseElement
 BaseElement (const QString &id=QString())
 This class keeps an ID to keep track of transformed elements during a processing chain. You can e.g. generate Pixel elements from MserBlobs. After filtering, processing etc. you can map back to the (pixel accurate) MserBlob using this ID. More...
 
void setId (const QString &id)
 Sets the (preferably unique) ID. If no ID is set, a unqiue ID is generated and assigned. More...
 
QString id () const
 Returns the elment's id. More...
 

Additional Inherited Members

- Protected Attributes inherited from rdf::BaseElement
QString mId
 

Detailed Description

Represents a text block. A single text block has a boundary region and (possibly) a set of super pixels that are geometrically part of the text region.

See also
BaseElement

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
draw_nothing 
draw_poly 
draw_text_lines 
draw_pixels 
draw_end 

Constructor & Destructor Documentation

rdf::TextBlock::TextBlock ( const Polygon poly = Polygon(),
const QString &  id = "" 
)

Member Function Documentation

void rdf::TextBlock::addPixels ( const PixelSet ps)

Filters pixels w.r.t the text blocks boundary. Hence only pixels that are within the given boundary are added.

Parameters
setThe set.
void rdf::TextBlock::cleanTextLines ( )
void rdf::TextBlock::draw ( QPainter &  p,
const DrawFlags df = DrawFlags() | draw_poly | draw_text_lines 
)
PixelSet rdf::TextBlock::pixelSet ( ) const
Polygon rdf::TextBlock::poly ( ) const
bool rdf::TextBlock::remove ( const QSharedPointer< TextLineSet > &  tl)

Removes the textline from the text block.

Parameters
tlThe text line.
void rdf::TextBlock::scale ( double  factor)
overridevirtual

Reimplemented from rdf::BaseElement.

void rdf::TextBlock::setTextLines ( const QVector< QSharedPointer< TextLineSet > > &  textLines)
QVector< QSharedPointer< TextLineSet > > rdf::TextBlock::textLines ( ) const
QString rdf::TextBlock::toString ( ) const
overridevirtual

Reimplemented from rdf::BaseElement.

QSharedPointer< Region > rdf::TextBlock::toTextRegion ( ) const

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