37 static const float kMinDeslantAngle = -30.0f;
38 static const float kMaxDeslantAngle = 30.0f;
39 static const float kDeslantAngleDelta = 0.5f;
43 Bmp8(
unsigned short wid,
unsigned short hgt);
48 inline unsigned short Width()
const {
return wid_; }
49 inline unsigned short Stride()
const {
return stride_; }
77 static bool ComputeTanTable();
79 unsigned char ** CreateBmpBuffer(
unsigned char init_val = 0xff);
80 static unsigned int ** CreateBmpBuffer(
int wid,
int hgt,
81 unsigned char init_val = 0xff);
83 static void FreeBmpBuffer(
unsigned char **buff);
84 static void FreeBmpBuffer(
unsigned int **buff);
87 static float *tan_table_;
89 unsigned short stride_;
91 static const unsigned int kMagicNumber = 0xdeadbeef;
116 void Crop(
int *xst_src,
int *yst_src,
int *wid,
int *hgt);
118 void Copy(
int x,
int y,
int wid,
int hgt,
Bmp8 *bmp_dest)
const;
bool ScaleFrom(Bmp8 *bmp, bool isotropic=true)
Bmp8(unsigned short wid, unsigned short hgt)
unsigned short Height() const
void Copy(int x, int y, int wid, int hgt, Bmp8 *bmp_dest) const
static Bmp8 * FromCharDumpFile(CachedFile *fp)
unsigned short Width() const
static const int kConCompAllocChunk
bool IsBlankRow(int y) const
void Crop(int *xst_src, int *yst_src, int *wid, int *hgt)
int * HorizontalHistogram() const
float ForegroundRatio() const
unsigned char * RawData() const
bool LoadFromCharDumpFile(CachedFile *fp)
bool HorizontalDeslant(double *deslant_angle)
unsigned char ** line_buff_
static const int kDeslantAngleCount
bool LoadFromRawData(unsigned char *data)
unsigned short Stride() const
ConComp ** FindConComps(int *concomp_cnt, int min_size) const
bool IsBlankColumn(int x) const
bool SaveBmp2CharDumpFile(FILE *fp) const
float MeanHorizontalHistogramEntropy() const
bool IsIdentical(Bmp8 *pBmp) const