@@ -202,15 +202,15 @@ void TessPDFRenderer::AppendPDFObject(const char *data) {
202
202
// Helper function to prevent us from accidentally writing
203
203
// scientific notation to an HOCR or PDF file. Besides, three
204
204
// decimal points are all you really need.
205
- double prec (double x) {
205
+ static double prec (double x) {
206
206
double kPrecision = 1000.0 ;
207
207
double a = round (x * kPrecision ) / kPrecision ;
208
208
if (a == -0 )
209
209
return 0 ;
210
210
return a;
211
211
}
212
212
213
- long dist2 (int x1, int y1, int x2, int y2) {
213
+ static long dist2 (int x1, int y1, int x2, int y2) {
214
214
return (x2 - x1) * (x2 - x1) + (y2 - y1 ) * (y2 - y1 );
215
215
}
216
216
@@ -222,10 +222,10 @@ long dist2(int x1, int y1, int x2, int y2) {
222
222
// left-to-right no matter what the reading order is. We need the
223
223
// word baseline in reading order, so we do that conversion here. Returns
224
224
// the word's baseline origin and length.
225
- void GetWordBaseline (int writing_direction, int ppi, int height,
226
- int word_x1, int word_y1, int word_x2, int word_y2,
227
- int line_x1, int line_y1, int line_x2, int line_y2,
228
- double *x0, double *y0, double *length) {
225
+ static void GetWordBaseline (int writing_direction, int ppi, int height,
226
+ int word_x1, int word_y1, int word_x2, int word_y2,
227
+ int line_x1, int line_y1, int line_x2, int line_y2,
228
+ double *x0, double *y0, double *length) {
229
229
if (writing_direction == WRITING_DIRECTION_RIGHT_TO_LEFT) {
230
230
Swap (&word_x1, &word_x2);
231
231
Swap (&word_y1, &word_y2);
@@ -264,9 +264,9 @@ void GetWordBaseline(int writing_direction, int ppi, int height,
264
264
// RTL
265
265
// [ x' ] = [ a b ][ x ] = [-1 0 ] [ cos sin ][ x ]
266
266
// [ y' ] [ c d ][ y ] [ 0 1 ] [-sin cos ][ y ]
267
- void AffineMatrix (int writing_direction,
268
- int line_x1, int line_y1, int line_x2, int line_y2,
269
- double *a, double *b, double *c, double *d) {
267
+ static void AffineMatrix (int writing_direction,
268
+ int line_x1, int line_y1, int line_x2, int line_y2,
269
+ double *a, double *b, double *c, double *d) {
270
270
double theta = atan2 (static_cast <double >(line_y1 - line_y2),
271
271
static_cast <double >(line_x2 - line_x1));
272
272
*a = cos (theta);
0 commit comments