Skip to content

Commit

Permalink
Fixed name collision with jpeg library
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@163 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed Apr 22, 2008
1 parent d696477 commit c4f4840
Show file tree
Hide file tree
Showing 60 changed files with 1,099 additions and 1,082 deletions.
50 changes: 25 additions & 25 deletions ccstruct/blobbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ void BLOBNBOX::chop( //chop blobs
FCOORD rotation, //for landscape
float xheight //of line
) {
INT16 blobcount; //no of blobs
inT16 blobcount; //no of blobs
BLOBNBOX *newblob; //fake blob
BLOBNBOX *blob; //current blob
INT16 blobindex; //number of chop
INT16 leftx; //left edge of blob
inT16 blobindex; //number of chop
inT16 leftx; //left edge of blob
float blobwidth; //width of each
float rightx; //right edge to scan
float ymin, ymax; //limits of new blob
Expand All @@ -69,7 +69,7 @@ void BLOBNBOX::chop( //chop blobs
BLOBNBOX_IT blob_it; //blob iterator

//get no of chops
blobcount = (INT16) floor (box.width () / xheight);
blobcount = (inT16) floor (box.width () / xheight);
if (blobcount > 1 && (blob_ptr != NULL || cblob_ptr != NULL)) {
//width of each
blobwidth = (float) (box.width () + 1) / blobcount;
Expand All @@ -95,17 +95,17 @@ void BLOBNBOX::chop( //chop blobs
}
while (blob != end_it->data ());
if (ymin < ymax) {
leftx = (INT16) floor (rightx - blobwidth);
leftx = (inT16) floor (rightx - blobwidth);
if (leftx < box.left ())
leftx = box.left (); //clip to real box
bl = ICOORD (leftx, (INT16) floor (ymin));
tr = ICOORD ((INT16) ceil (rightx), (INT16) ceil (ymax));
bl = ICOORD (leftx, (inT16) floor (ymin));
tr = ICOORD ((inT16) ceil (rightx), (inT16) ceil (ymax));
if (blobindex == 0)
box = BOX (bl, tr); //change box
box = TBOX (bl, tr); //change box
else {
newblob = new BLOBNBOX;
//box is all it has
newblob->box = BOX (bl, tr);
newblob->box = TBOX (bl, tr);
//stay on current
end_it->add_after_stay_put (newblob);
}
Expand Down Expand Up @@ -192,7 +192,7 @@ void find_cblob_limits( //get y limits
FCOORD rotation, //for landscape
float &ymin, //output y limits
float &ymax) {
INT16 stepindex; //current point
inT16 stepindex; //current point
ICOORD pos; //current coords
ICOORD vec; //rotated step
C_OUTLINE *outline; //current outline
Expand Down Expand Up @@ -234,7 +234,7 @@ void find_cblob_vlimits( //get y limits
float rightx,
float &ymin, //output y limits
float &ymax) {
INT16 stepindex; //current point
inT16 stepindex; //current point
ICOORD pos; //current coords
ICOORD vec; //rotated step
C_OUTLINE *outline; //current outline
Expand Down Expand Up @@ -274,7 +274,7 @@ void find_cblob_hlimits( //get x limits
float topy,
float &xmin, //output x limits
float &xmax) {
INT16 stepindex; //current point
inT16 stepindex; //current point
ICOORD pos; //current coords
ICOORD vec; //rotated step
C_OUTLINE *outline; //current outline
Expand Down Expand Up @@ -400,11 +400,11 @@ C_BLOB *crotate_cblob( //rotate it
* Then move the iterator on to the start of the next blob.
**********************************************************************/

BOX box_next( //get bounding box
TBOX box_next( //get bounding box
BLOBNBOX_IT *it //iterator to blobds
) {
BLOBNBOX *blob; //current blob
BOX result; //total box
TBOX result; //total box

blob = it->data ();
result = blob->bounding_box ();
Expand All @@ -429,11 +429,11 @@ BOX box_next( //get bounding box
* Then move the iterator on to the start of the next pre-chopped blob.
**********************************************************************/

BOX box_next_pre_chopped( //get bounding box
TBOX box_next_pre_chopped( //get bounding box
BLOBNBOX_IT *it //iterator to blobds
) {
BLOBNBOX *blob; //current blob
BOX result; //total box
TBOX result; //total box

blob = it->data ();
result = blob->bounding_box ();
Expand Down Expand Up @@ -547,9 +547,9 @@ void TO_ROW::insert_blob( //constructor
**********************************************************************/

void TO_ROW::compute_vertical_projection() { //project whole row
BOX row_box; //bound of row
TBOX row_box; //bound of row
BLOBNBOX *blob; //current blob
BOX blob_box; //bounding box
TBOX blob_box; //bounding box
BLOBNBOX_IT blob_it = blob_list ();

if (blob_it.empty ())
Expand Down Expand Up @@ -604,7 +604,7 @@ void vertical_outline_projection( //project outlines
STATS *stats //output
) {
POLYPT *polypt; //current point
INT32 xcoord; //current pixel coord
inT32 xcoord; //current pixel coord
float end_x; //end of vec
POLYPT_IT poly_it = outline->polypts ();
OUTLINE_IT out_it = outline->child ();
Expand All @@ -615,7 +615,7 @@ void vertical_outline_projection( //project outlines
polypt = poly_it.data ();
end_x = polypt->pos.x () + polypt->vec.x ();
if (polypt->vec.x () > 0) {
for (xcoord = (INT32) floor (polypt->pos.x ());
for (xcoord = (inT32) floor (polypt->pos.x ());
xcoord < end_x; xcoord++) {
if (polypt->pos.x () < xcoord) {
width = (float) xcoord;
Expand All @@ -640,11 +640,11 @@ void vertical_outline_projection( //project outlines
ymean += polypt->pos.y () + polypt->vec.y ();
}
ymean = ymean * width / 2;
stats->add (xcoord, (INT32) floor (ymean + 0.5));
stats->add (xcoord, (inT32) floor (ymean + 0.5));
}
}
else if (polypt->vec.x () < 0) {
for (xcoord = (INT32) floor (end_x);
for (xcoord = (inT32) floor (end_x);
xcoord < polypt->pos.x (); xcoord++) {
if (polypt->pos.x () > xcoord + 1) {
width = xcoord + 1.0f;
Expand All @@ -669,7 +669,7 @@ void vertical_outline_projection( //project outlines
ymean += polypt->pos.y () + polypt->vec.y ();
}
ymean = ymean * width / 2;
stats->add (xcoord, (INT32) floor (ymean + 0.5));
stats->add (xcoord, (inT32) floor (ymean + 0.5));
}
}
}
Expand Down Expand Up @@ -713,8 +713,8 @@ void vertical_coutline_projection( //project outlines
) {
ICOORD pos; //current point
ICOORD step; //edge step
INT32 length; //of outline
INT16 stepindex; //current step
inT32 length; //of outline
inT16 stepindex; //current step
C_OUTLINE_IT out_it = outline->child ();

pos = outline->start_pos ();
Expand Down
30 changes: 15 additions & 15 deletions ccstruct/blobbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ class BLOBNBOX:public ELIST_LINK
}

//get bounding box
const BOX &bounding_box() const {
const TBOX &bounding_box() const {
return box;
}
//get bounding box
const BOX &reduced_box() const {
const TBOX &reduced_box() const {
return red_box;
}
void set_reduced_box( //set other box
BOX new_box) {
TBOX new_box) {
red_box = new_box;
reduced = TRUE;
}
INT32 enclosed_area() const { //get area
inT32 enclosed_area() const { //get area
return area;
}

Expand Down Expand Up @@ -131,8 +131,8 @@ class BLOBNBOX:public ELIST_LINK
int area:30; //enclosed area
int joined:1; //joined to prev
int reduced:1; //reduced box set
BOX box; //bounding box
BOX red_box; //bounding box
TBOX box; //bounding box
TBOX red_box; //bounding box
PBLOB *blob_ptr; //poly blob
C_BLOB *cblob_ptr; //edgestep blob
};
Expand Down Expand Up @@ -225,8 +225,8 @@ class TO_ROW:public ELIST2_LINK
NEWDELETE2 (TO_ROW) BOOL8 merged;
BOOL8 all_caps; //had no ascenders
BOOL8 used_dm_model; //in guessing pitch
INT16 projection_left; //start of projection
INT16 projection_right; //start of projection
inT16 projection_left; //start of projection
inT16 projection_right; //start of projection
PITCH_TYPE pitch_decision; //how strong is decision
float fixed_pitch; //pitch or 0
float fp_space; //sp if fixed pitch
Expand All @@ -237,9 +237,9 @@ class TO_ROW:public ELIST2_LINK
float xheight; //of line
float ascrise; //ascenders
float descdrop; //descenders
INT32 min_space; //min size for real space
INT32 max_nonspace; //max size of non-space
INT32 space_threshold; //space vs nonspace
inT32 min_space; //min size for real space
inT32 max_nonspace; //max size of non-space
inT32 space_threshold; //space vs nonspace
float kern_size; //average non-space
float space_size; //average space
WERD_LIST rep_words; //repeated chars
Expand Down Expand Up @@ -302,8 +302,8 @@ class TO_BLOCK:public ELIST_LINK
float fixed_pitch; //pitch or 0
float kern_size; //average non-space
float space_size; //average space
INT32 min_space; //min definite space
INT32 max_nonspace; //max definite
inT32 min_space; //min definite space
inT32 max_nonspace; //max definite
float fp_space; //sp if fixed pitch
float fp_nonsp; //nonsp if fixed pitch
float pr_space; //sp if prop
Expand Down Expand Up @@ -356,10 +356,10 @@ C_BLOB *crotate_cblob( //rotate it
C_BLOB *blob, //blob to search
FCOORD rotation //for landscape
);
BOX box_next( //get bounding box
TBOX box_next( //get bounding box
BLOBNBOX_IT *it //iterator to blobds
);
BOX box_next_pre_chopped( //get bounding box
TBOX box_next_pre_chopped( //get bounding box
BLOBNBOX_IT *it //iterator to blobds
);
void vertical_blob_projection( //project outlines
Expand Down
Loading

0 comments on commit c4f4840

Please sign in to comment.