tesseract  4.00.00dev
ipoints.h File Reference
#include <math.h>

Go to the source code of this file.

Functions

ICOORD operator! (const ICOORD &src)
 
ICOORD operator- (const ICOORD &src)
 
ICOORD operator+ (const ICOORD &op1, const ICOORD &op2)
 
ICOORDoperator+= (ICOORD &op1, const ICOORD &op2)
 
ICOORD operator- (const ICOORD &op1, const ICOORD &op2)
 
ICOORDoperator-= (ICOORD &op1, const ICOORD &op2)
 
inT32 operator% (const ICOORD &op1, const ICOORD &op2)
 
inT32 operator* (const ICOORD &op1, const ICOORD &op2)
 
ICOORD operator* (const ICOORD &op1, inT16 scale)
 
ICOORD operator* (inT16 scale, const ICOORD &op1)
 
ICOORDoperator*= (ICOORD &op1, inT16 scale)
 
ICOORD operator/ (const ICOORD &op1, inT16 scale)
 
ICOORDoperator/= (ICOORD &op1, inT16 scale)
 
FCOORD operator! (const FCOORD &src)
 
FCOORD operator- (const FCOORD &src)
 
FCOORD operator+ (const FCOORD &op1, const FCOORD &op2)
 
FCOORDoperator+= (FCOORD &op1, const FCOORD &op2)
 
FCOORD operator- (const FCOORD &op1, const FCOORD &op2)
 
FCOORDoperator-= (FCOORD &op1, const FCOORD &op2)
 
float operator% (const FCOORD &op1, const FCOORD &op2)
 
float operator* (const FCOORD &op1, const FCOORD &op2)
 
FCOORD operator* (const FCOORD &op1, float scale)
 
FCOORD operator* (float scale, const FCOORD &op1)
 
FCOORDoperator*= (FCOORD &op1, float scale)
 
FCOORD operator/ (const FCOORD &op1, float scale)
 
FCOORDoperator/= (FCOORD &op1, float scale)
 

Function Documentation

◆ operator!() [1/2]

ICOORD operator! ( const ICOORD src)
inline

Definition at line 32 of file ipoints.h.

34  {
35  ICOORD result; //output
36 
37  result.xcoord = -src.ycoord;
38  result.ycoord = src.xcoord;
39  return result;
40 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator!() [2/2]

FCOORD operator! ( const FCOORD src)
inline

Definition at line 258 of file ipoints.h.

260  {
261  FCOORD result; //output
262 
263  result.xcoord = -src.ycoord;
264  result.ycoord = src.xcoord;
265  return result;
266 }
Definition: points.h:189

◆ operator%() [1/2]

inT32 operator% ( const ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 136 of file ipoints.h.

138  {
139  return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
140 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator%() [2/2]

float operator% ( const FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 362 of file ipoints.h.

364  {
365  return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
366 }

◆ operator*() [1/6]

inT32 operator* ( const ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 149 of file ipoints.h.

151  {
152  return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
153 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator*() [2/6]

ICOORD operator* ( const ICOORD op1,
inT16  scale 
)
inline

Definition at line 162 of file ipoints.h.

164  {
165  ICOORD result; //output
166 
167  result.xcoord = op1.xcoord * scale;
168  result.ycoord = op1.ycoord * scale;
169  return result;
170 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator*() [3/6]

ICOORD operator* ( inT16  scale,
const ICOORD op1 
)
inline

Definition at line 173 of file ipoints.h.

176  {
177  ICOORD result; //output
178 
179  result.xcoord = op1.xcoord * scale;
180  result.ycoord = op1.ycoord * scale;
181  return result;
182 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator*() [4/6]

float operator* ( const FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 375 of file ipoints.h.

377  {
378  return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
379 }

◆ operator*() [5/6]

FCOORD operator* ( const FCOORD op1,
float  scale 
)
inline

Definition at line 388 of file ipoints.h.

390  {
391  FCOORD result; //output
392 
393  result.xcoord = op1.xcoord * scale;
394  result.ycoord = op1.ycoord * scale;
395  return result;
396 }
Definition: points.h:189

◆ operator*() [6/6]

FCOORD operator* ( float  scale,
const FCOORD op1 
)
inline

Definition at line 399 of file ipoints.h.

402  {
403  FCOORD result; //output
404 
405  result.xcoord = op1.xcoord * scale;
406  result.ycoord = op1.ycoord * scale;
407  return result;
408 }
Definition: points.h:189

◆ operator*=() [1/2]

ICOORD& operator*= ( ICOORD op1,
inT16  scale 
)
inline

Definition at line 192 of file ipoints.h.

194  {
195  op1.xcoord *= scale;
196  op1.ycoord *= scale;
197  return op1;
198 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator*=() [2/2]

FCOORD& operator*= ( FCOORD op1,
float  scale 
)
inline

Definition at line 418 of file ipoints.h.

420  {
421  op1.xcoord *= scale;
422  op1.ycoord *= scale;
423  return op1;
424 }

◆ operator+() [1/2]

ICOORD operator+ ( const ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 68 of file ipoints.h.

70  {
71  ICOORD sum; //result
72 
73  sum.xcoord = op1.xcoord + op2.xcoord;
74  sum.ycoord = op1.ycoord + op2.ycoord;
75  return sum;
76 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator+() [2/2]

FCOORD operator+ ( const FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 294 of file ipoints.h.

296  {
297  FCOORD sum; //result
298 
299  sum.xcoord = op1.xcoord + op2.xcoord;
300  sum.ycoord = op1.ycoord + op2.ycoord;
301  return sum;
302 }
Definition: points.h:189

◆ operator+=() [1/2]

ICOORD& operator+= ( ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 86 of file ipoints.h.

88  {
89  op1.xcoord += op2.xcoord;
90  op1.ycoord += op2.ycoord;
91  return op1;
92 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator+=() [2/2]

FCOORD& operator+= ( FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 312 of file ipoints.h.

314  {
315  op1.xcoord += op2.xcoord;
316  op1.ycoord += op2.ycoord;
317  return op1;
318 }

◆ operator-() [1/4]

ICOORD operator- ( const ICOORD src)
inline

Definition at line 50 of file ipoints.h.

52  {
53  ICOORD result; //output
54 
55  result.xcoord = -src.xcoord;
56  result.ycoord = -src.ycoord;
57  return result;
58 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator-() [2/4]

ICOORD operator- ( const ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 102 of file ipoints.h.

104  {
105  ICOORD sum; //result
106 
107  sum.xcoord = op1.xcoord - op2.xcoord;
108  sum.ycoord = op1.ycoord - op2.ycoord;
109  return sum;
110 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator-() [3/4]

FCOORD operator- ( const FCOORD src)
inline

Definition at line 276 of file ipoints.h.

278  {
279  FCOORD result; //output
280 
281  result.xcoord = -src.xcoord;
282  result.ycoord = -src.ycoord;
283  return result;
284 }
Definition: points.h:189

◆ operator-() [4/4]

FCOORD operator- ( const FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 328 of file ipoints.h.

330  {
331  FCOORD sum; //result
332 
333  sum.xcoord = op1.xcoord - op2.xcoord;
334  sum.ycoord = op1.ycoord - op2.ycoord;
335  return sum;
336 }
Definition: points.h:189

◆ operator-=() [1/2]

ICOORD& operator-= ( ICOORD op1,
const ICOORD op2 
)
inline

Definition at line 120 of file ipoints.h.

122  {
123  op1.xcoord -= op2.xcoord;
124  op1.ycoord -= op2.ycoord;
125  return op1;
126 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator-=() [2/2]

FCOORD& operator-= ( FCOORD op1,
const FCOORD op2 
)
inline

Definition at line 346 of file ipoints.h.

348  {
349  op1.xcoord -= op2.xcoord;
350  op1.ycoord -= op2.ycoord;
351  return op1;
352 }

◆ operator/() [1/2]

ICOORD operator/ ( const ICOORD op1,
inT16  scale 
)
inline

Definition at line 208 of file ipoints.h.

210  {
211  ICOORD result; //output
212 
213  result.xcoord = op1.xcoord / scale;
214  result.ycoord = op1.ycoord / scale;
215  return result;
216 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157
integer coordinate
Definition: points.h:30

◆ operator/() [2/2]

FCOORD operator/ ( const FCOORD op1,
float  scale 
)
inline

Definition at line 434 of file ipoints.h.

436  {
437  FCOORD result; //output
438 
439  if (scale != 0) {
440  result.xcoord = op1.xcoord / scale;
441  result.ycoord = op1.ycoord / scale;
442  }
443  return result;
444 }
Definition: points.h:189

◆ operator/=() [1/2]

ICOORD& operator/= ( ICOORD op1,
inT16  scale 
)
inline

Definition at line 226 of file ipoints.h.

228  {
229  op1.xcoord /= scale;
230  op1.ycoord /= scale;
231  return op1;
232 }
inT16 ycoord
Definition: points.h:158
inT16 xcoord
Definition: points.h:157

◆ operator/=() [2/2]

FCOORD& operator/= ( FCOORD op1,
float  scale 
)
inline

Definition at line 454 of file ipoints.h.

456  {
457  if (scale != 0) {
458  op1.xcoord /= scale;
459  op1.ycoord /= scale;
460  }
461  return op1;
462 }