All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
C_OUTLINE_FRAG Class Reference

#include <fpchop.h>

Inheritance diagram for C_OUTLINE_FRAG:
ELIST_LINK

Public Member Functions

 C_OUTLINE_FRAG ()
 
 ~C_OUTLINE_FRAG ()
 
 C_OUTLINE_FRAG (ICOORD start_pt, ICOORD end_pt, C_OUTLINE *outline, inT16 start_index, inT16 end_index)
 
 C_OUTLINE_FRAG (C_OUTLINE_FRAG *head, inT16 tail_y)
 
C_OUTLINEclose ()
 
C_OUTLINE_FRAGoperator= (const C_OUTLINE_FRAG &src)
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Public Attributes

ICOORD start
 
ICOORD end
 
DIR128steps
 
inT32 stepcount
 
C_OUTLINE_FRAGother_end
 
inT16 ycoord
 

Detailed Description

Definition at line 26 of file fpchop.h.

Constructor & Destructor Documentation

C_OUTLINE_FRAG::C_OUTLINE_FRAG ( )
inline

Definition at line 29 of file fpchop.h.

29  { //empty constructor
30  steps = NULL;
31  stepcount = 0;
32  }
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
inT32 stepcount
Definition: fpchop.h:52
C_OUTLINE_FRAG::~C_OUTLINE_FRAG ( )
inline

Definition at line 33 of file fpchop.h.

33  {
34  if (steps != NULL)
35  delete [] steps;
36  }
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
C_OUTLINE_FRAG::C_OUTLINE_FRAG ( ICOORD  start_pt,
ICOORD  end_pt,
C_OUTLINE outline,
inT16  start_index,
inT16  end_index 
)

Definition at line 562 of file fpchop.cpp.

567  {
568  start = start_pt;
569  end = end_pt;
570  ycoord = start_pt.y ();
571  stepcount = end_index - start_index;
572  if (stepcount < 0)
573  stepcount += outline->pathlength ();
574  ASSERT_HOST (stepcount > 0);
575  steps = new DIR128[stepcount];
576  if (end_index > start_index) {
577  for (int i = start_index; i < end_index; ++i)
578  steps[i - start_index] = outline->step_dir(i);
579  }
580  else {
581  int len = outline->pathlength();
582  int i = start_index;
583  for (; i < len; ++i)
584  steps[i - start_index] = outline->step_dir(i);
585  if (end_index > 0)
586  for (; i < end_index + len; ++i)
587  steps[i - start_index] = outline->step_dir(i - len);
588  }
589  other_end = NULL;
590  delete close();
591 }
C_OUTLINE_FRAG * other_end
Definition: fpchop.h:53
inT16 ycoord
Definition: fpchop.h:54
ICOORD end
Definition: fpchop.h:50
inT32 pathlength() const
Definition: coutln.h:133
C_OUTLINE * close()
Definition: fpchop.cpp:779
#define ASSERT_HOST(x)
Definition: errcode.h:84
Definition: mod128.h:29
inT16 y() const
access_function
Definition: points.h:56
ICOORD start
Definition: fpchop.h:49
DIR128 step_dir(int index) const
Definition: coutln.h:137
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
inT32 stepcount
Definition: fpchop.h:52
C_OUTLINE_FRAG::C_OUTLINE_FRAG ( C_OUTLINE_FRAG head,
inT16  tail_y 
)

Definition at line 594 of file fpchop.cpp.

596  {
597  ycoord = tail_y;
598  other_end = head;
599  start = head->start;
600  end = head->end;
601  steps = NULL;
602  stepcount = 0;
603 }
C_OUTLINE_FRAG * other_end
Definition: fpchop.h:53
head_table head
Definition: GlyphLessFont.c:29
inT16 ycoord
Definition: fpchop.h:54
ICOORD end
Definition: fpchop.h:50
ICOORD start
Definition: fpchop.h:49
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
inT32 stepcount
Definition: fpchop.h:52

Member Function Documentation

C_OUTLINE * C_OUTLINE_FRAG::close ( )

Definition at line 779 of file fpchop.cpp.

779  { //join pieces
780  DIR128 *new_steps; //new steps
781  inT32 new_stepcount; //no of steps
782  inT16 fake_count; //fake steps
783  DIR128 fake_step; //step entry
784 
785  ASSERT_HOST (start.x () == end.x ());
786  fake_count = start.y () - end.y ();
787  if (fake_count < 0) {
788  fake_count = -fake_count;
789  fake_step = 32;
790  }
791  else
792  fake_step = 96;
793 
794  new_stepcount = stepcount + fake_count;
795  if (new_stepcount > C_OUTLINE::kMaxOutlineLength)
796  return NULL; // Can't join them
797  new_steps = new DIR128[new_stepcount];
798  memmove(new_steps, steps, stepcount);
799  memset (new_steps + stepcount, fake_step.get_dir(), fake_count);
800  C_OUTLINE* result = new C_OUTLINE (start, new_steps, new_stepcount);
801  delete [] new_steps;
802  return result;
803 }
ICOORD end
Definition: fpchop.h:50
#define ASSERT_HOST(x)
Definition: errcode.h:84
Definition: mod128.h:29
inT16 y() const
access_function
Definition: points.h:56
ICOORD start
Definition: fpchop.h:49
class DLLSYM C_OUTLINE
Definition: coutln.h:65
static const int kMaxOutlineLength
Definition: coutln.h:271
inT16 x() const
access function
Definition: points.h:52
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
inT8 get_dir() const
Definition: mod128.h:77
inT32 stepcount
Definition: fpchop.h:52
short inT16
Definition: host.h:100
int inT32
Definition: host.h:102
C_OUTLINE_FRAG & C_OUTLINE_FRAG::operator= ( const C_OUTLINE_FRAG src)

Definition at line 813 of file fpchop.cpp.

815  {
816  if (steps != NULL)
817  delete [] steps;
818 
819  stepcount = src.stepcount;
820  steps = new DIR128[stepcount];
821  memmove (steps, src.steps, stepcount);
822  start = src.start;
823  end = src.end;
824  ycoord = src.ycoord;
825  return *this;
826 }
inT16 ycoord
Definition: fpchop.h:54
ICOORD end
Definition: fpchop.h:50
Definition: mod128.h:29
ICOORD start
Definition: fpchop.h:49
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
inT32 stepcount
Definition: fpchop.h:52

Member Data Documentation

ICOORD C_OUTLINE_FRAG::end

Definition at line 50 of file fpchop.h.

C_OUTLINE_FRAG* C_OUTLINE_FRAG::other_end

Definition at line 53 of file fpchop.h.

ICOORD C_OUTLINE_FRAG::start

Definition at line 49 of file fpchop.h.

inT32 C_OUTLINE_FRAG::stepcount

Definition at line 52 of file fpchop.h.

DIR128* C_OUTLINE_FRAG::steps

Definition at line 51 of file fpchop.h.

inT16 C_OUTLINE_FRAG::ycoord

Definition at line 54 of file fpchop.h.


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