tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
ICOORD Class Reference

integer coordinate More...

#include <points.h>

Inheritance diagram for ICOORD:

Public Member Functions

 ICOORD ()
 empty constructor More...
 
 ICOORD (int16_t xin, int16_t yin)
 
 ~ICOORD ()=default
 destructor More...
 
int16_t x () const
 access function More...
 
int16_t y () const
 access_function More...
 
void set_x (int16_t xin)
 rewrite function More...
 
void set_y (int16_t yin)
 rewrite function More...
 
void set_with_shrink (int x, int y)
 Set from the given x,y, shrinking the vector to fit if needed. More...
 
float sqlength () const
 find sq length More...
 
float length () const
 find length More...
 
float pt_to_pt_sqdist (const ICOORD &pt) const
 sq dist between pts More...
 
float pt_to_pt_dist (const ICOORD &pt) const
 Distance between pts. More...
 
float angle () const
 find angle More...
 
bool operator== (const ICOORD &other) const
 test equality More...
 
bool operator!= (const ICOORD &other) const
 test inequality More...
 
void rotate (const FCOORD &vec)
 
void setup_render (ICOORD *major_step, ICOORD *minor_step, int *major, int *minor) const
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (bool swap, FILE *fp)
 

Protected Attributes

int16_t xcoord
 
int16_t ycoord
 

Friends

class FCOORD
 
ICOORD operator! (const ICOORD &)
 rotate 90 deg anti More...
 
ICOORD operator- (const ICOORD &)
 unary minus More...
 
ICOORD operator+ (const ICOORD &, const ICOORD &)
 add More...
 
ICOORDoperator+= (ICOORD &, const ICOORD &)
 add More...
 
ICOORD operator- (const ICOORD &, const ICOORD &)
 subtract More...
 
ICOORDoperator-= (ICOORD &, const ICOORD &)
 subtract More...
 
int32_t operator% (const ICOORD &, const ICOORD &)
 scalar product More...
 
int32_t operator* (const ICOORD &, const ICOORD &)
 cross product More...
 
ICOORD operator* (const ICOORD &, int16_t)
 multiply More...
 
ICOORD operator* (int16_t, const ICOORD &)
 multiply More...
 
ICOORDoperator*= (ICOORD &, int16_t)
 multiply More...
 
ICOORD operator/ (const ICOORD &, int16_t)
 divide More...
 
ICOORDoperator/= (ICOORD &, int16_t)
 divide More...
 

Detailed Description

integer coordinate

Constructor & Destructor Documentation

◆ ICOORD() [1/2]

ICOORD::ICOORD ( )
inline

empty constructor

◆ ICOORD() [2/2]

ICOORD::ICOORD ( int16_t  xin,
int16_t  yin 
)
inline

constructor

Parameters
xinx value
yiny value

◆ ~ICOORD()

ICOORD::~ICOORD ( )
default

destructor

Member Function Documentation

◆ angle()

float ICOORD::angle ( ) const
inline

find angle

◆ DeSerialize()

bool ICOORD::DeSerialize ( bool  swap,
FILE *  fp 
)

◆ length()

float ICOORD::length ( ) const
inline

find length

◆ operator!=()

bool ICOORD::operator!= ( const ICOORD other) const
inline

test inequality

◆ operator==()

bool ICOORD::operator== ( const ICOORD other) const
inline

test equality

◆ pt_to_pt_dist()

float ICOORD::pt_to_pt_dist ( const ICOORD pt) const
inline

Distance between pts.

◆ pt_to_pt_sqdist()

float ICOORD::pt_to_pt_sqdist ( const ICOORD pt) const
inline

sq dist between pts

◆ rotate()

void ICOORD::rotate ( const FCOORD vec)
inline

rotate

Parameters
vecby vector

◆ Serialize()

bool ICOORD::Serialize ( FILE *  fp) const

◆ set_with_shrink()

void ICOORD::set_with_shrink ( int  x,
int  y 
)

Set from the given x,y, shrinking the vector to fit if needed.

◆ set_x()

void ICOORD::set_x ( int16_t  xin)
inline

rewrite function

◆ set_y()

void ICOORD::set_y ( int16_t  yin)
inline

rewrite function

◆ setup_render()

void ICOORD::setup_render ( ICOORD major_step,
ICOORD minor_step,
int *  major,
int *  minor 
) const

Setup for iterating over the pixels in a vector by the well-known Bresenham rendering algorithm. Starting with major/2 in the accumulator, on each step move by major_step, and then add minor to the accumulator. When accumulator >= major subtract major and also move by minor_step.

◆ sqlength()

float ICOORD::sqlength ( ) const
inline

find sq length

◆ x()

int16_t ICOORD::x ( ) const
inline

access function

◆ y()

int16_t ICOORD::y ( ) const
inline

access_function

Friends And Related Function Documentation

◆ FCOORD

friend class FCOORD
friend

◆ operator!

ICOORD operator! ( const ICOORD src)
friend

rotate 90 deg anti

◆ operator%

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

scalar product

◆ operator* [1/3]

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

cross product

◆ operator* [2/3]

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

multiply

◆ operator* [3/3]

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

multiply

◆ operator*=

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

multiply

◆ operator+

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

add

◆ operator+=

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

add

◆ operator- [1/2]

ICOORD operator- ( const ICOORD src)
friend

unary minus

◆ operator- [2/2]

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

subtract

◆ operator-=

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

subtract

◆ operator/

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

divide

◆ operator/=

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

divide

Member Data Documentation

◆ xcoord

int16_t ICOORD::xcoord
protected

◆ ycoord

int16_t ICOORD::ycoord
protected

The documentation for this class was generated from the following files: