tesseract v5.3.3.20231005
tesseract::FPChar Class Reference

Public Types

enum  Alignment { ALIGN_UNKNOWN , ALIGN_GOOD , ALIGN_BAD }
 

Public Member Functions

 FPChar ()
 
void Init (BLOBNBOX *blob)
 
void Merge (const FPChar &next)
 
const TBOXbox () const
 
void set_box (const TBOX &box)
 
const TBOXreal_body () const
 
bool is_final () const
 
void set_final (bool flag)
 
const Alignmentalignment () const
 
void set_alignment (Alignment alignment)
 
bool merge_to_prev () const
 
void set_merge_to_prev (bool flag)
 
bool delete_flag () const
 
void set_delete_flag (bool flag)
 
int max_gap () const
 
int num_blobs () const
 

Detailed Description

Definition at line 180 of file cjkpitch.cpp.

Member Enumeration Documentation

◆ Alignment

Enumerator
ALIGN_UNKNOWN 
ALIGN_GOOD 
ALIGN_BAD 

Definition at line 182 of file cjkpitch.cpp.

Constructor & Destructor Documentation

◆ FPChar()

tesseract::FPChar::FPChar ( )
inline

Definition at line 184 of file cjkpitch.cpp.

185 : box_()
186 , real_body_()
187 , from_(nullptr)
188 , to_(nullptr)
189 , num_blobs_(0)
190 , max_gap_(0)
191 , final_(false)
192 , alignment_(ALIGN_UNKNOWN)
193 , merge_to_prev_(false)
194 , delete_flag_(false) {}

Member Function Documentation

◆ alignment()

const Alignment & tesseract::FPChar::alignment ( ) const
inline

Definition at line 236 of file cjkpitch.cpp.

236 {
237 return alignment_;
238 }

◆ box()

const TBOX & tesseract::FPChar::box ( ) const
inline

Definition at line 219 of file cjkpitch.cpp.

219 {
220 return box_;
221 }

◆ delete_flag()

bool tesseract::FPChar::delete_flag ( ) const
inline

Definition at line 250 of file cjkpitch.cpp.

250 {
251 return delete_flag_;
252 }

◆ Init()

void tesseract::FPChar::Init ( BLOBNBOX blob)
inline

Definition at line 197 of file cjkpitch.cpp.

197 {
198 box_ = blob->bounding_box();
199 real_body_ = box_;
200 from_ = to_ = blob;
201 num_blobs_ = 1;
202 }

◆ is_final()

bool tesseract::FPChar::is_final ( ) const
inline

Definition at line 229 of file cjkpitch.cpp.

229 {
230 return final_;
231 }

◆ max_gap()

int tesseract::FPChar::max_gap ( ) const
inline

Definition at line 257 of file cjkpitch.cpp.

257 {
258 return max_gap_;
259 }

◆ Merge()

void tesseract::FPChar::Merge ( const FPChar next)
inline

Definition at line 206 of file cjkpitch.cpp.

206 {
207 int gap = real_body_.x_gap(next.real_body_);
208 if (gap > max_gap_) {
209 max_gap_ = gap;
210 }
211
212 box_ += next.box_;
213 real_body_ += next.real_body_;
214 to_ = next.to_;
215 num_blobs_ += next.num_blobs_;
216 }
def next(obj)
Definition: ast.py:56
int x_gap(const TBOX &box) const
Definition: rect.h:238

◆ merge_to_prev()

bool tesseract::FPChar::merge_to_prev ( ) const
inline

Definition at line 243 of file cjkpitch.cpp.

243 {
244 return merge_to_prev_;
245 }

◆ num_blobs()

int tesseract::FPChar::num_blobs ( ) const
inline

Definition at line 261 of file cjkpitch.cpp.

261 {
262 return num_blobs_;
263 }

◆ real_body()

const TBOX & tesseract::FPChar::real_body ( ) const
inline

Definition at line 225 of file cjkpitch.cpp.

225 {
226 return real_body_;
227 }

◆ set_alignment()

void tesseract::FPChar::set_alignment ( Alignment  alignment)
inline

Definition at line 239 of file cjkpitch.cpp.

239 {
240 alignment_ = alignment;
241 }
const Alignment & alignment() const
Definition: cjkpitch.cpp:236

◆ set_box()

void tesseract::FPChar::set_box ( const TBOX box)
inline

Definition at line 222 of file cjkpitch.cpp.

222 {
223 box_ = box;
224 }
const TBOX & box() const
Definition: cjkpitch.cpp:219

◆ set_delete_flag()

void tesseract::FPChar::set_delete_flag ( bool  flag)
inline

Definition at line 253 of file cjkpitch.cpp.

253 {
254 delete_flag_ = flag;
255 }

◆ set_final()

void tesseract::FPChar::set_final ( bool  flag)
inline

Definition at line 232 of file cjkpitch.cpp.

232 {
233 final_ = flag;
234 }

◆ set_merge_to_prev()

void tesseract::FPChar::set_merge_to_prev ( bool  flag)
inline

Definition at line 246 of file cjkpitch.cpp.

246 {
247 merge_to_prev_ = flag;
248 }

The documentation for this class was generated from the following file: