43 CharSamp(
int left,
int top,
int wid,
int hgt);
46 unsigned short Left()
const {
return left_; }
47 unsigned short Right()
const {
return left_ +
wid_; }
48 unsigned short Top()
const {
return top_; }
50 unsigned short Page()
const {
return page_; }
51 unsigned short NormTop()
const {
return norm_top_; }
52 unsigned short NormBottom()
const {
return norm_bottom_; }
54 unsigned short FirstChar()
const {
return first_char_; }
55 unsigned short LastChar()
const {
return last_char_; }
65 void SetLeft(
unsigned short left) { left_ = left; }
66 void SetTop(
unsigned short top) { top_ = top; }
67 void SetPage(
unsigned short page) { page_ = page; }
69 if (label32_ !=
NULL) {
73 if (label32_ !=
NULL) {
79 if (label32_ !=
NULL) {
83 if (label32 !=
NULL) {
85 if (label32[0] == 0xfeff) {
89 label32_ =
new char_32[len + 1];
90 if (label32_ !=
NULL) {
91 memcpy(label32_, label32, len *
sizeof(*label32));
97 void SetNormTop(
unsigned short norm_top) { norm_top_ = norm_top; }
99 norm_bottom_ = norm_bottom;
102 norm_aspect_ratio_ = norm_aspect_ratio;
105 first_char_ = first_char;
108 last_char_ = last_char;
119 ConComp **
Segment(
int *seg_cnt,
bool right_2_left,
int max_hist_wnd,
120 int min_con_comp_size)
const;
133 unsigned char *data);
135 int strt_concomp,
int seg_flags_size,
136 int *seg_flags,
bool *left_most,
137 bool *right_most,
int word_hgt);
142 if (label32 ==
NULL) {
146 while (label32[++len] != 0);
151 unsigned short page_;
152 unsigned short left_;
155 unsigned short norm_top_;
157 unsigned short norm_bottom_;
159 unsigned short norm_aspect_ratio_;
160 unsigned short first_char_;
161 unsigned short last_char_;
166 #endif // CHAR_SAMP_H
unsigned short Right() const
unsigned short Page() const
static int LabelLen(const char_32 *label32)
unsigned short NormAspectRatio() const
void SetTop(unsigned short top)
void SetNormBottom(unsigned short norm_bottom)
unsigned short Left() const
static CharSamp * FromCharDumpFile(CachedFile *fp)
static CharSamp * FromConComps(ConComp **concomp_array, int strt_concomp, int seg_flags_size, int *seg_flags, bool *left_most, bool *right_most, int word_hgt)
unsigned short Bottom() const
static CharSamp * FromRawData(int left, int top, int wid, int hgt, unsigned char *data)
void SetPage(unsigned short page)
void SetLastChar(unsigned short last_char)
void SetFirstChar(unsigned short first_char)
string stringLabel() const
CharSamp * Scale(int wid, int hgt, bool isotropic=true)
char_32 * StrLabel() const
unsigned short NormBottom() const
static int AuxFeatureCnt()
unsigned short NormTop() const
unsigned short LastChar() const
ConComp ** Segment(int *seg_cnt, bool right_2_left, int max_hist_wnd, int min_con_comp_size) const
unsigned short Top() const
void SetLabel(char_32 label)
bool Save2CharDumpFile(FILE *fp) const
void SetLeft(unsigned short left)
void SetNormAspectRatio(unsigned short norm_aspect_ratio)
bool ComputeFeatures(int conv_grid_size, float *features)
void SetNormTop(unsigned short norm_top)
unsigned short FirstChar() const
void SetLabel(const char_32 *label32)