tesseract 3.04.01

EDGEPT Struct Reference

#include <blobs.h>

List of all members.

Public Member Functions

 EDGEPT ()
 EDGEPT (const EDGEPT &src)
EDGEPToperator= (const EDGEPT &src)
void CopyFrom (const EDGEPT &src)
int WeightedDistance (const EDGEPT &other, int x_factor) const
bool EqualPos (const EDGEPT &other) const
TBOX SegmentBox (const EDGEPT *end) const
int SegmentArea (const EDGEPT *end) const
bool ShortNonCircularSegment (int min_points, const EDGEPT *end) const
void Hide ()
void Reveal ()
bool IsHidden () const
void MarkChop ()
bool IsChopPt () const

Public Attributes

TPOINT pos
VECTOR vec
char flags [EDGEPTFLAGS]
EDGEPTnext
EDGEPTprev
C_OUTLINEsrc_outline
int start_step
int step_count

Detailed Description

Definition at line 76 of file blobs.h.


Constructor & Destructor Documentation

EDGEPT::EDGEPT ( ) [inline]

Definition at line 77 of file blobs.h.

  : next(NULL), prev(NULL), src_outline(NULL), start_step(0), step_count(0) {
    memset(flags, 0, EDGEPTFLAGS * sizeof(flags[0]));
  }
EDGEPT::EDGEPT ( const EDGEPT src) [inline]

Definition at line 81 of file blobs.h.

                            : next(NULL), prev(NULL) {
    CopyFrom(src);
  }

Member Function Documentation

void EDGEPT::CopyFrom ( const EDGEPT src) [inline]

Definition at line 89 of file blobs.h.

                                   {
    pos = src.pos;
    vec = src.vec;
    memcpy(flags, src.flags, EDGEPTFLAGS * sizeof(flags[0]));
    src_outline = src.src_outline;
    start_step = src.start_step;
    step_count = src.step_count;
  }
bool EDGEPT::EqualPos ( const EDGEPT other) const [inline]

Definition at line 105 of file blobs.h.

{ return pos == other.pos; }
void EDGEPT::Hide ( ) [inline]

Definition at line 147 of file blobs.h.

              {
    flags[0] = true;
  }
bool EDGEPT::IsChopPt ( ) const [inline]

Definition at line 159 of file blobs.h.

                        {
    return flags[2] != 0;
  }
bool EDGEPT::IsHidden ( ) const [inline]

Definition at line 153 of file blobs.h.

                        {
    return flags[0] != 0;
  }
void EDGEPT::MarkChop ( ) [inline]

Definition at line 156 of file blobs.h.

                  {
    flags[2] = true;
  }
EDGEPT& EDGEPT::operator= ( const EDGEPT src) [inline]

Definition at line 84 of file blobs.h.

                                       {
    CopyFrom(src);
    return *this;
  }
void EDGEPT::Reveal ( ) [inline]

Definition at line 150 of file blobs.h.

                {
    flags[0] = false;
  }
int EDGEPT::SegmentArea ( const EDGEPT end) const [inline]

Definition at line 122 of file blobs.h.

                                           {
    int area = 0;
    const EDGEPT* pt = this->next;
    do {
      TPOINT origin_vec(pt->pos.x - pos.x, pt->pos.y - pos.y);
      area += CROSS(origin_vec, pt->vec);
      pt = pt->next;
    } while (pt != end && pt != this);
    return area;
  }
TBOX EDGEPT::SegmentBox ( const EDGEPT end) const [inline]

Definition at line 108 of file blobs.h.

                                           {
    TBOX box(pos.x, pos.y, pos.x, pos.y);
    const EDGEPT* pt = this;
    do {
      pt = pt->next;
      if (pt->pos.x < box.left()) box.set_left(pt->pos.x);
      if (pt->pos.x > box.right()) box.set_right(pt->pos.x);
      if (pt->pos.y < box.bottom()) box.set_bottom(pt->pos.y);
      if (pt->pos.y > box.top()) box.set_top(pt->pos.y);
    } while (pt != end && pt != this);
    return box;
  }
bool EDGEPT::ShortNonCircularSegment ( int  min_points,
const EDGEPT end 
) const [inline]

Definition at line 135 of file blobs.h.

                                                                        {
    int count = 0;
    const EDGEPT* pt = this;
    do {
      if (pt == end) return true;
      pt = pt->next;
      ++count;
    } while (pt != this && count <= min_points);
    return false;
  }
int EDGEPT::WeightedDistance ( const EDGEPT other,
int  x_factor 
) const [inline]

Definition at line 99 of file blobs.h.

                                                                {
    int x_dist = pos.x - other.pos.x;
    int y_dist = pos.y - other.pos.y;
    return x_dist * x_dist * x_factor + y_dist * y_dist;
  }

Member Data Documentation

char EDGEPT::flags[EDGEPTFLAGS]

Definition at line 168 of file blobs.h.

Definition at line 169 of file blobs.h.

Definition at line 163 of file blobs.h.

Definition at line 170 of file blobs.h.

Definition at line 171 of file blobs.h.

Definition at line 173 of file blobs.h.

Definition at line 174 of file blobs.h.

Definition at line 164 of file blobs.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines