Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends
FCOORD Class Reference

`#include <points.h>`

List of all members.

## Public Member Functions
| FCOORD ()
| empty constructor
| FCOORD (float xvalue, float yvalue)
| FCOORD (ICOORD icoord)
float | x () const
float | y () const
void | set_x (float xin)
| rewrite function
void | set_y (float yin)
| rewrite function
float | sqlength () const
| find sq length
float | length () const
| find length
float | pt_to_pt_sqdist (const FCOORD &pt) const
| sq dist between pts
float | pt_to_pt_dist (const FCOORD &pt) const
| Distance between pts.
float | angle () const
| find angle
bool | normalise ()
| Convert to unit vec.
BOOL8 | operator== (const FCOORD &other)
| test equality
BOOL8 | operator!= (const FCOORD &other)
| test inequality
void | rotate (const FCOORD vec)
void | unrotate (const FCOORD &vec)

## Friends
FCOORD | operator! (const FCOORD &)
| rotate 90 deg anti
FCOORD | operator- (const FCOORD &)
| unary minus
FCOORD | operator+ (const FCOORD &, const FCOORD &)
| add
FCOORD & | operator+= (FCOORD &, const FCOORD &)
| add
FCOORD | operator- (const FCOORD &, const FCOORD &)
| subtract
FCOORD & | operator-= (FCOORD &, const FCOORD &)
| subtract
float | operator% (const FCOORD &, const FCOORD &)
| scalar product
float | operator* (const FCOORD &, const FCOORD &)
| cross product
FCOORD | operator* (const FCOORD &, float)
| multiply
FCOORD | operator* (float, const FCOORD &)
| multiply
FCOORD & | operator*= (FCOORD &, float)
| multiply
FCOORD | operator/ (const FCOORD &, float)
| divide
FCOORD & | operator/= (FCOORD &, float)
| divide

## Detailed Description

Definition at line 189 of file points.h.

## Constructor & Destructor Documentation

FCOORD::FCOORD | ( |  | ) |
| inline

empty constructor

Definition at line 193 of file points.h.

{
}

FCOORD::FCOORD | ( | float | xvalue,
|  | float | yvalue
| ) |  |
| inline

constructor

Parameters:

  xvalue | x value
  yvalue | y value

Definition at line 198 of file points.h.

{
xcoord = xvalue; //set coords
ycoord = yvalue;
}

FCOORD::FCOORD | ( | ICOORD | icoord | ) |
| inline

Definition at line 203 of file points.h.

{ //coords to set
xcoord = icoord.xcoord;
ycoord = icoord.ycoord;
}

## Member Function Documentation

float FCOORD::angle | ( |  | ) | const
| inline

find angle

Definition at line 249 of file points.h.

{
return (float) atan2 (ycoord, xcoord);
}

float FCOORD::length | ( |  | ) | const
| inline

find length

Definition at line 230 of file points.h.

{
return (float) sqrt (sqlength ());
}

bool FCOORD::normalise | ( |  | ) |

Convert to unit vec.

BOOL8 FCOORD::operator!= | ( | const FCOORD & | other | ) |
| inline

test inequality

Definition at line 261 of file points.h.

{
return xcoord != other.xcoord || ycoord != other.ycoord;
}

BOOL8 FCOORD::operator== | ( | const FCOORD & | other | ) |
| inline

test equality

Definition at line 257 of file points.h.

{
return xcoord == other.xcoord && ycoord == other.ycoord;
}

float FCOORD::pt_to_pt_dist | ( | const FCOORD & | pt | ) | const
| inline

Distance between pts.

Definition at line 244 of file points.h.

{
return (float) sqrt (pt_to_pt_sqdist (pt));
}

float FCOORD::pt_to_pt_sqdist | ( | const FCOORD & | pt | ) | const
| inline

sq dist between pts

Definition at line 235 of file points.h.

{
FCOORD gap;
gap.xcoord = xcoord - pt.xcoord;
gap.ycoord = ycoord - pt.ycoord;
return gap.sqlength ();
}

void FCOORD::rotate | ( | const FCOORD | vec | ) |
| inline

rotate

Parameters:

  vec | by vector

Definition at line 471 of file ipoints.h.

{
float tmp;
tmp = xcoord * vec.x () - ycoord * vec.y ();
ycoord = ycoord * vec.x () + xcoord * vec.y ();
xcoord = tmp;
}

void FCOORD::set_x | ( | float | xin | ) |
| inline

rewrite function

Definition at line 216 of file points.h.

{
xcoord = xin; //write new value
}

void FCOORD::set_y | ( | float | yin | ) |
| inline

rewrite function

Definition at line 220 of file points.h.

{ //value to set
ycoord = yin;
}

float FCOORD::sqlength | ( |  | ) | const
| inline

find sq length

Definition at line 225 of file points.h.

{
return xcoord * xcoord + ycoord * ycoord;
}

void FCOORD::unrotate | ( | const FCOORD & | vec | ) |
| inline

Definition at line 480 of file ipoints.h.

{
rotate(FCOORD(vec.x(), -vec.y()));
}

float FCOORD::x | ( |  | ) | const
| inline

Definition at line 209 of file points.h.

{ //get coords
return xcoord;
}

float FCOORD::y | ( |  | ) | const
| inline

Definition at line 212 of file points.h.

{
return ycoord;
}

## Friends And Related Function Documentation

FCOORD operator! | ( | const FCOORD & | src | ) |
| friend

rotate 90 deg anti

Definition at line 258 of file ipoints.h.

{
FCOORD result; //output
result.xcoord = -src.ycoord;
result.ycoord = src.xcoord;
return result;
}

float operator% | ( | const FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

scalar product

Definition at line 362 of file ipoints.h.

{
return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
}

float operator* | ( | const FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

cross product

Definition at line 375 of file ipoints.h.

{
return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
}

FCOORD operator* | ( | const FCOORD & | op1,
|  | float | scale
| ) |  |
| friend

multiply

Definition at line 388 of file ipoints.h.

{
FCOORD result; //output
result.xcoord = op1.xcoord * scale;
result.ycoord = op1.ycoord * scale;
return result;
}

FCOORD operator* | ( | float | scale,
|  | const FCOORD & | op1
| ) |  |
| friend

multiply

Definition at line 399 of file ipoints.h.

{
FCOORD result; //output
result.xcoord = op1.xcoord * scale;
result.ycoord = op1.ycoord * scale;
return result;
}

FCOORD& operator*= | ( | FCOORD & | op1,
|  | float | scale
| ) |  |
| friend

multiply

Definition at line 418 of file ipoints.h.

{
op1.xcoord *= scale;
op1.ycoord *= scale;
return op1;
}

FCOORD operator+ | ( | const FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

add

Definition at line 294 of file ipoints.h.

{
FCOORD sum; //result
sum.xcoord = op1.xcoord + op2.xcoord;
sum.ycoord = op1.ycoord + op2.ycoord;
return sum;
}

FCOORD& operator+= | ( | FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

add

Definition at line 312 of file ipoints.h.

{
op1.xcoord += op2.xcoord;
op1.ycoord += op2.ycoord;
return op1;
}

FCOORD operator- | ( | const FCOORD & | src | ) |
| friend

unary minus

Definition at line 276 of file ipoints.h.

{
FCOORD result; //output
result.xcoord = -src.xcoord;
result.ycoord = -src.ycoord;
return result;
}

FCOORD operator- | ( | const FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

subtract

Definition at line 328 of file ipoints.h.

{
FCOORD sum; //result
sum.xcoord = op1.xcoord - op2.xcoord;
sum.ycoord = op1.ycoord - op2.ycoord;
return sum;
}

FCOORD& operator-= | ( | FCOORD & | op1,
|  | const FCOORD & | op2
| ) |  |
| friend

subtract

Definition at line 346 of file ipoints.h.

{
op1.xcoord -= op2.xcoord;
op1.ycoord -= op2.ycoord;
return op1;
}

FCOORD operator/ | ( | const FCOORD & | op1,
|  | float | scale
| ) |  |
| friend

divide

Definition at line 434 of file ipoints.h.

{
FCOORD result; //output
if (scale != 0) {
result.xcoord = op1.xcoord / scale;
result.ycoord = op1.ycoord / scale;
}
return result;
}

FCOORD& operator/= | ( | FCOORD & | op1,
|  | float | scale
| ) |  |
| friend

divide

Definition at line 454 of file ipoints.h.

{
if (scale != 0) {
op1.xcoord /= scale;
op1.ycoord /= scale;
}
return op1;
}

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

- /mnt/data/src/tesseract-ocr/ccstruct/points.h
- /mnt/data/src/tesseract-ocr/ccstruct/ipoints.h