tesseract  5.0.0-alpha-619-ge9db
points.h File Reference
#include <cmath>
#include <cstdio>
#include "elst.h"
#include "errcode.h"
#include <tesseract/platform.h>

Go to the source code of this file.

Classes

class  ICOORD
 integer coordinate More...
 
class  ICOORDELT
 
class  FCOORD
 

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_t operator% (const ICOORD &op1, const ICOORD &op2)
 
int32_t operator* (const ICOORD &op1, const ICOORD &op2)
 
ICOORD operator* (const ICOORD &op1, int16_t scale)
 
ICOORD operator* (int16_t scale, const ICOORD &op1)
 
ICOORDoperator*= (ICOORD &op1, int16_t scale)
 
ICOORD operator/ (const ICOORD &op1, int16_t scale)
 
ICOORDoperator/= (ICOORD &op1, int16_t 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]

FCOORD operator! ( const FCOORD src)
inline

Definition at line 538 of file points.h.

555  {

◆ operator!() [2/2]

ICOORD operator! ( const ICOORD src)
inline

Definition at line 325 of file points.h.

329  {
330  ICOORD result; //output
331 
332  result.xcoord = -src.ycoord;
333  result.ycoord = src.xcoord;

◆ operator%() [1/2]

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

Definition at line 636 of file points.h.

643  {

◆ operator%() [2/2]

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

Definition at line 423 of file points.h.

433  {

◆ operator*() [1/6]

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

Definition at line 648 of file points.h.

659  {

◆ operator*() [2/6]

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

Definition at line 660 of file points.h.

672  {

◆ operator*() [3/6]

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

Definition at line 435 of file points.h.

446  {

◆ operator*() [4/6]

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

Definition at line 447 of file points.h.

459  {

◆ operator*() [5/6]

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

Definition at line 671 of file points.h.

672  {
673  return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
674 }
675 
676 
677 /**********************************************************************
678  * operator*
679  *
680  * Scalar multiply of an FCOORD.

◆ operator*() [6/6]

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

Definition at line 458 of file points.h.

459  {
460  ICOORD result; //output
461 
462  result.xcoord = op1.xcoord * scale;
463  result.ycoord = op1.ycoord * scale;
464  return result;
465 }
466 
467 

◆ operator*=() [1/2]

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

Definition at line 689 of file points.h.

697  {

◆ operator*=() [2/2]

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

Definition at line 476 of file points.h.

489  {

◆ operator+() [1/2]

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

Definition at line 572 of file points.h.

573  {
574  FCOORD result; //output
575 
576  result.xcoord = -src.xcoord;
577  result.ycoord = -src.ycoord;
578  return result;
579 }
580 

◆ operator+() [2/2]

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

Definition at line 359 of file points.h.

365  {
366  ICOORD sum; //result
367 

◆ operator+=() [1/2]

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

Definition at line 589 of file points.h.

591  {
592  FCOORD sum; //result
593 
594  sum.xcoord = op1.xcoord + op2.xcoord;
595  sum.ycoord = op1.ycoord + op2.ycoord;

◆ operator+=() [2/2]

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

Definition at line 376 of file points.h.

383  {

◆ operator-() [1/4]

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

Definition at line 604 of file points.h.

609  {
610  op1.xcoord += op2.xcoord;
611  op1.ycoord += op2.ycoord;
612  return op1;

◆ operator-() [2/4]

FCOORD operator- ( const FCOORD src)
inline

Definition at line 555 of file points.h.

555  {
556  FCOORD result; //output
557 
558  result.xcoord = -src.ycoord;
559  result.ycoord = src.xcoord;
560  return result;
561 }
562 
563 

◆ operator-() [3/4]

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

Definition at line 391 of file points.h.

399  {

◆ operator-() [4/4]

ICOORD operator- ( const ICOORD src)
inline

Definition at line 342 of file points.h.

347  {
348  ICOORD result; //output
349 
350  result.xcoord = -src.xcoord;

◆ operator-=() [1/2]

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

Definition at line 621 of file points.h.

625  {
626  FCOORD sum; //result
627 

◆ operator-=() [2/2]

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

Definition at line 408 of file points.h.

417  {

◆ operator/() [1/2]

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

Definition at line 704 of file points.h.

715  {

◆ operator/() [2/2]

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

Definition at line 491 of file points.h.

505  {

◆ operator/=() [1/2]

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

Definition at line 721 of file points.h.

731  {

◆ operator/=() [2/2]

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

Definition at line 508 of file points.h.

523  {
ICOORD
integer coordinate
Definition: points.h:30
FCOORD
Definition: points.h:187
ICOORD::xcoord
int16_t xcoord
x value
Definition: points.h:156
ICOORD::ycoord
int16_t ycoord
y value
Definition: points.h:157