20 #ifndef TESSERACT_CCMAIN_THRESHOLDER_H__
21 #define TESSERACT_CCMAIN_THRESHOLDER_H__
55 void SetImage(
const unsigned char* imagedata,
int width,
int height,
56 int bytes_per_pixel,
int bytes_per_line);
60 void SetRectangle(
int left,
int top,
int width,
int height);
66 virtual void GetImageSizes(
int* left,
int* top,
int* width,
int* height,
67 int* imagewidth,
int* imageheight);
155 int bytes_per_pixel,
int bytes_per_line,
161 int bytes_per_pixel,
int bytes_per_line,
162 const int* thresholds,
const int* hi_values,
191 #endif // TESSERACT_CCMAIN_THRESHOLDER_H__
virtual void GetImageSizes(int *left, int *top, int *width, int *height, int *imagewidth, int *imageheight)
int GetScaledYResolution() const
void OtsuThresholdRectToPix(const unsigned char *imagedata, int bytes_per_pixel, int bytes_per_line, Pix **pix) const
virtual void Clear()
Destroy the Pix if there is one, freeing memory.
bool IsColor() const
Return true if the source image is color.
const unsigned char * image_data_
Exactly one of pix_ and image_data_ is not NULL.
virtual ~ImageThresholder()
void SetImage(const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)
bool IsEmpty() const
Return true if no image has been set.
void ThresholdRectToPix(const unsigned char *imagedata, int bytes_per_pixel, int bytes_per_line, const int *thresholds, const int *hi_values, Pix **pix) const
void SetRectangle(int left, int top, int width, int height)
int GetSourceYResolution() const
bool IsFullImage() const
Return true if we are processing the full image.
virtual void Init()
Common initialization shared between SetImage methods.
void SetEstimatedResolution(int ppi)
int GetScaledEstimatedResolution() const
int GetScaleFactor() const
void SetSourceYResolution(int ppi)
virtual void ThresholdToPix(Pix **pix)
void RawRectToPix(Pix **pix) const
Copy the raw image rectangle, taking all data from the class, to the Pix.
bool IsBinary() const
Returns true if the source image is binary.