Tesseract
3.02
|
#include <devanagari_processing.h>
Public Member Functions | |
PixelHistogram () | |
~PixelHistogram () | |
void | Clear () |
int *const | hist () const |
int | length () const |
void | ConstructVerticalCountHist (Pix *pix) |
void | ConstructHorizontalCountHist (Pix *pix) |
int | GetHistogramMaximum (int *count) const |
Definition at line 27 of file devanagari_processing.h.
tesseract::PixelHistogram::PixelHistogram | ( | ) | [inline] |
Definition at line 29 of file devanagari_processing.h.
{ hist_ = NULL; length_ = 0; }
tesseract::PixelHistogram::~PixelHistogram | ( | ) | [inline] |
Definition at line 34 of file devanagari_processing.h.
{ Clear(); }
void tesseract::PixelHistogram::Clear | ( | ) | [inline] |
Definition at line 38 of file devanagari_processing.h.
{ if (hist_) { delete[] hist_; } length_ = 0; }
void tesseract::PixelHistogram::ConstructHorizontalCountHist | ( | Pix * | pix | ) |
Definition at line 486 of file devanagari_processing.cpp.
void tesseract::PixelHistogram::ConstructVerticalCountHist | ( | Pix * | pix | ) |
Definition at line 468 of file devanagari_processing.cpp.
{ Clear(); int width = pixGetWidth(pix); int height = pixGetHeight(pix); hist_ = new int[width]; length_ = width; int wpl = pixGetWpl(pix); l_uint32 *data = pixGetData(pix); for (int i = 0; i < width; ++i) hist_[i] = 0; for (int i = 0; i < height; ++i) { l_uint32 *line = data + i * wpl; for (int j = 0; j < width; ++j) if (GET_DATA_BIT(line, j)) ++(hist_[j]); } }
int tesseract::PixelHistogram::GetHistogramMaximum | ( | int * | count | ) | const |
Definition at line 454 of file devanagari_processing.cpp.
int* const tesseract::PixelHistogram::hist | ( | ) | const [inline] |
Definition at line 45 of file devanagari_processing.h.
{
return hist_;
}
int tesseract::PixelHistogram::length | ( | ) | const [inline] |
Definition at line 49 of file devanagari_processing.h.
{
return length_;
}