Read@CVL
|
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>
Public Types | |
enum | mDrawFlags { draw_nothing = 0x0, draw_poly = 0x1, draw_text_lines = 0x2, draw_pixels = 0x4, draw_end } |
typedef Flags< mDrawFlags > | DrawFlags |
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< Region > | toTextRegion () 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 |
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.
typedef Flags<mDrawFlags> rdf::TextBlock::DrawFlags |
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.
set | The 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.
tl | The text line. |
|
overridevirtual |
Reimplemented from rdf::BaseElement.
void rdf::TextBlock::setTextLines | ( | const QVector< QSharedPointer< TextLineSet > > & | textLines | ) |
QVector< QSharedPointer< TextLineSet > > rdf::TextBlock::textLines | ( | ) | const |
|
overridevirtual |
Reimplemented from rdf::BaseElement.
QSharedPointer< Region > rdf::TextBlock::toTextRegion | ( | ) | const |