tesseract v5.3.3.20231005
fpchop.h
Go to the documentation of this file.
1/**********************************************************************
2 * File: fpchop.h (Formerly fp_chop.h)
3 * Description: Code to chop fixed pitch text into character cells.
4 * Author: Ray Smith
5 *
6 * (C) Copyright 1993, Hewlett-Packard Ltd.
7 ** Licensed under the Apache License, Version 2.0 (the "License");
8 ** you may not use this file except in compliance with the License.
9 ** You may obtain a copy of the License at
10 ** http://www.apache.org/licenses/LICENSE-2.0
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 *
17 **********************************************************************/
18
19#ifndef FPCHOP_H
20#define FPCHOP_H
21
22#include "blobbox.h"
23#include "params.h"
24
25namespace tesseract {
26
27class C_OUTLINE_FRAG : public ELIST_LINK {
28public:
29 C_OUTLINE_FRAG() { // empty constructor
30 steps = nullptr;
31 stepcount = 0;
32 }
34 delete[] steps;
35 }
36 // start coord
37 C_OUTLINE_FRAG(ICOORD start_pt,
38 ICOORD end_pt, // end coord
39 C_OUTLINE *outline, // source of steps
40 int16_t start_index, int16_t end_index);
41 // other end
42 C_OUTLINE_FRAG(C_OUTLINE_FRAG *head, int16_t tail_y);
43 C_OUTLINE *close(); // copy to outline
44 C_OUTLINE_FRAG &operator=( // assign
45 const C_OUTLINE_FRAG &src);
46
47 ICOORD start; // start coord
48 ICOORD end; // end coord
49 DIR128 *steps; // step array
50 int32_t stepcount; // no of steps
51 C_OUTLINE_FRAG *other_end; // head if a tail
52 int16_t ycoord; // coord of cut pt
53
54private:
55 // Copy constructor (currently unused, therefore private).
56 C_OUTLINE_FRAG(const C_OUTLINE_FRAG &other) = delete;
57};
58
60
62
63ROW *fixed_pitch_words( // find lines
64 TO_ROW *row, // row to do
65 FCOORD rotation // for drawing
66);
67
68void split_to_blob( // split the blob
69 BLOBNBOX *blob, // blob to split
70 int16_t chop_coord, // place to chop
71 float pitch_error, // allowed deviation
72 C_OUTLINE_LIST *left_coutlines, // for cblobs
73 C_OUTLINE_LIST *right_coutlines);
74
75} // namespace tesseract
76
77#endif
#define ELISTIZEH(CLASSNAME)
Definition: elst.h:803
int textord_fp_chop_error
Definition: fpchop.cpp:34
void split_to_blob(BLOBNBOX *blob, int16_t chop_coord, float pitch_error, C_OUTLINE_LIST *left_coutlines, C_OUTLINE_LIST *right_coutlines)
Definition: fpchop.cpp:260
ROW * fixed_pitch_words(TO_ROW *row, FCOORD rotation)
Definition: fpchop.cpp:65
INT_VAR_H(editor_image_xpos)
integer coordinate
Definition: points.h:36
C_OUTLINE_FRAG & operator=(const C_OUTLINE_FRAG &src)
Definition: fpchop.cpp:800
C_OUTLINE_FRAG * other_end
Definition: fpchop.h:51
C_OUTLINE * close()
Definition: fpchop.cpp:766