|
tesseract 3.04.01
|
#include <imagedata.h>
Public Member Functions | |
| WordFeature () | |
| WordFeature (const FCOORD &fcoord, uinT8 dir) | |
| int | x () const |
| int | y () const |
| int | dir () const |
| bool | Serialize (FILE *fp) const |
| bool | DeSerialize (bool swap, FILE *fp) |
Static Public Member Functions | |
| static void | ComputeSize (const GenericVector< WordFeature > &features, int *max_x, int *max_y) |
| static void | Draw (const GenericVector< WordFeature > &features, ScrollView *window) |
Definition at line 40 of file imagedata.h.
| usr src packages BUILD tesseract ccstruct imagedata cpp tesseract::WordFeature::WordFeature | ( | ) |
Definition at line 36 of file imagedata.cpp.
Definition at line 39 of file imagedata.cpp.
: x_(IntCastRounded(fcoord.x())), y_(ClipToRange(IntCastRounded(fcoord.y()), 0, MAX_UINT8)), dir_(dir) { }
| void tesseract::WordFeature::ComputeSize | ( | const GenericVector< WordFeature > & | features, |
| int * | max_x, | ||
| int * | max_y | ||
| ) | [static] |
Definition at line 46 of file imagedata.cpp.
{
*max_x = 0;
*max_y = 0;
for (int f = 0; f < features.size(); ++f) {
if (features[f].x_ > *max_x) *max_x = features[f].x_;
if (features[f].y_ > *max_y) *max_y = features[f].y_;
}
}
| bool tesseract::WordFeature::DeSerialize | ( | bool | swap, |
| FILE * | fp | ||
| ) |
Definition at line 82 of file imagedata.cpp.
| int tesseract::WordFeature::dir | ( | ) | const [inline] |
Definition at line 55 of file imagedata.h.
{ return dir_; }
| void tesseract::WordFeature::Draw | ( | const GenericVector< WordFeature > & | features, |
| ScrollView * | window | ||
| ) | [static] |
Definition at line 57 of file imagedata.cpp.
{
#ifndef GRAPHICS_DISABLED
for (int f = 0; f < features.size(); ++f) {
FCOORD pos(features[f].x_, features[f].y_);
FCOORD dir;
dir.from_direction(features[f].dir_);
dir *= 8.0f;
window->SetCursor(IntCastRounded(pos.x() - dir.x()),
IntCastRounded(pos.y() - dir.y()));
window->DrawTo(IntCastRounded(pos.x() + dir.x()),
IntCastRounded(pos.y() + dir.y()));
}
#endif
}
| bool tesseract::WordFeature::Serialize | ( | FILE * | fp | ) | const |
Definition at line 74 of file imagedata.cpp.
| int tesseract::WordFeature::x | ( | ) | const [inline] |
Definition at line 53 of file imagedata.h.
{ return x_; }
| int tesseract::WordFeature::y | ( | ) | const [inline] |
Definition at line 54 of file imagedata.h.
{ return y_; }