Skip to content

Commit

Permalink
make some static
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@440 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
joregan committed Jul 26, 2010
1 parent 1d88be7 commit 4acaabd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 48 deletions.
16 changes: 15 additions & 1 deletion ccmain/applybox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ extern IMAGE page_image;
// The unicharset used during box training
static UNICHARSET unicharset_boxes;

static void clear_any_old_text(BLOCK_LIST *block_list);

// Register uch with unicharset_boxes.
static UNICHAR_ID register_char(const char *uch);

static BOOL8 read_next_box(int page,
FILE* box_file,
TBOX *box,
UNICHAR_ID *uch_id);


/*************************************************************************
* The code re-assigns outlines to form words each with ONE labelled blob.
* Noise is left in UNLABELLED words. The chars on the page are checked crudely
Expand Down Expand Up @@ -175,7 +186,7 @@ void Tesseract::apply_boxes(const STRING& fname,
while (read_next_box(applybox_page, box_file, &box, &uch_id)) {
box_count++;
if (!low_exposure || learn_chars_and_char_frags_mode) {
tgt_char_counts[uch_id]++;
tgt_char_counts[uch_id]++;
}
row = find_row_of_box (block_list, box, block_id, row_id);
if (box.left () < prev_box_right) {
Expand Down Expand Up @@ -289,6 +300,7 @@ int Tesseract::Boxes2BlockList(int box_cnt, TBOX *boxes,
} // namespace tesseract


static
void clear_any_old_text( //remove correct text
BLOCK_LIST *block_list //real blocks
) {
Expand All @@ -309,6 +321,7 @@ void clear_any_old_text( //remove correct text
}
}

static
UNICHAR_ID register_char(const char *uch) {
if (!unicharset_boxes.contains_unichar(uch)) {
unicharset_boxes.unichar_insert(uch);
Expand All @@ -321,6 +334,7 @@ UNICHAR_ID register_char(const char *uch) {
return unicharset_boxes.unichar_to_id(uch);
}

static
BOOL8 read_next_box(int page,
FILE* box_file,
TBOX *box,
Expand Down
12 changes: 0 additions & 12 deletions ccmain/applybox.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,10 @@ extern STRING_VAR_H(exposure_pattern, "exp",

static const int kMinFragmentOutlineArea = 10;

// Register uch with unicharset_boxes.
UNICHAR_ID register_char(const char *uch);

void apply_boxes(const STRING& filename,
BLOCK_LIST *block_list //real blocks
);

void clear_any_old_text( //remove correct text
BLOCK_LIST *block_list //real blocks
);

BOOL8 read_next_box(int page,
FILE* box_file,
TBOX *box,
UNICHAR_ID *uch_id);

ROW *find_row_of_box(
BLOCK_LIST *block_list, //real blocks
const TBOX &box, //from boxfile
Expand Down
67 changes: 32 additions & 35 deletions ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*
**********************************************************************/

#include "mfcpch.h"

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif

#include "mfcpch.h"
#include "mainblk.h"
#include <string.h>
#include <math.h>
Expand Down Expand Up @@ -400,15 +401,15 @@ if (dopasses==1) return;
if (target_word_box)
{

TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}
TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}

}
}
//end jetsoft

classify_word_pass2(page_res_it.word(), page_res_it.block()->block,
Expand Down Expand Up @@ -460,18 +461,16 @@ if (dopasses==1) return;
//changed by jetsoft
//specific to its needs to extract one word when need

if (target_word_box)
{

TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}

}
if (target_word_box)
{
TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}
}
// end jetsoft

if (tessedit_em_adaption_mode != 0)
Expand Down Expand Up @@ -528,18 +527,16 @@ if (dopasses==1) return;
//changed by jetsoft
//specific to its needs to extract one word when need

if (target_word_box)
{

TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}

}
if (target_word_box)
{
TBOX current_word_box=page_res_it.word ()->word->bounding_box();
FCOORD center_pt((current_word_box.right()+current_word_box.left())/2,(current_word_box.bottom()+current_word_box.top())/2);
if (!target_word_box->contains(center_pt))
{
page_res_it.forward ();
continue;
}
}

//end jetsoft
if (tessedit_cluster_adaption_mode != 0)
Expand Down Expand Up @@ -1761,7 +1758,7 @@ void Tesseract::font_recognition_pass( //good chars in word
*
* Add into the stats for one row.
**********************************************************************/

//dead code?
void add_in_one_row( //good chars in word
ROW_RES *row, //current row
STATS *fonts, //font stats
Expand Down Expand Up @@ -1789,7 +1786,7 @@ void add_in_one_row( //good chars in word
*
* Find the modal font and remove from the stats.
**********************************************************************/

//make static?
void find_modal_font( //good chars in word
STATS *fonts, //font stats
inT8 *font_out, //output font
Expand Down

0 comments on commit 4acaabd

Please sign in to comment.