提交 f4c46b64 编写于 作者: T theraysmith

Various fixes, including memory leak in fixspace, font labels on output,...

Various fixes, including memory leak in fixspace, font labels on output, removed some annoying debug output, fixes to initialization of parameters, general cleanup, and added Hindi

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@574 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 69b7c258
......@@ -247,6 +247,7 @@ int table_colors[ScrollView::GREEN_YELLOW+1][4]= {
SVNetwork* ScrollView::stream_ = NULL;
int ScrollView::nr_created_windows_ = 0;
int ScrollView::image_index_ = 0;
/// Calls Initialize with all arguments given.
ScrollView::ScrollView(const char* name, int x_pos, int y_pos, int x_size,
......@@ -769,8 +770,9 @@ void ScrollView::Image(PIX* image, int x_pos, int y_pos) {
int width = image->w;
int height = image->h;
l_uint32 bpp = image->d;
++image_index_;
// PIX* do not have a unique identifier/name associated, so name them "lept".
SendMsg("createImage('%s',%d,%d,%d)", "lept", width, height, bpp);
SendMsg("createImage('lept%d',%d,%d,%d)", image_index_, width, height, bpp);
if (bpp == 32) {
Transfer32bppImage(image);
......@@ -780,7 +782,7 @@ void ScrollView::Image(PIX* image, int x_pos, int y_pos) {
TransferBinaryImage(image);
}
// PIX* do not have a unique identifier/name associated, so name them "lept".
SendMsg("drawImage('%s',%d,%d)", "lept", x_pos, y_pos);
SendMsg("drawImage('lept%d',%d,%d)", image_index_, x_pos, y_pos);
}
// Sends each pixel as hex value like html, e.g. #00FF00 for green.
......
......@@ -398,6 +398,9 @@ class ScrollView {
int y_size_;
// # of created windows (used to assign an id to each ScrollView* for svmap).
static int nr_created_windows_;
// Serial number of sent images to ensure that the viewer knows they
// are distinct.
static int image_index_;
// The stream through which the c++ client is connected to the server.
static SVNetwork* stream_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册