32 #define INTERSECTING MAX_INT16//no winding number 87 static void FakeOutline(
const TBOX& box, C_OUTLINE_LIST* outlines);
98 return flags.bit (mask);
103 flags.set_bit (mask, value);
117 int shift = stepindex%4 * 2;
118 uinT8 mask = 3 << shift;
119 steps[stepindex/4] = ((stepdir << shift) & mask) |
120 (steps[stepindex/4] & ~mask);
129 set_step(stepindex, chaindir);
143 return step_coords[chain_code(index)];
153 for (
int i = 0; i < index; ++i)
162 const ICOORD& step_to_next(step(index));
163 FCOORD f_pos(pos.
x() + step_to_next.
x() / 2.0f,
164 pos.
y() + step_to_next.
y() / 2.0f);
165 if (offsets != NULL && offsets[index].pixel_diff > 0) {
166 float offset = offsets[index].offset_numerator;
167 offset /= offsets[index].pixel_diff;
168 if (step_to_next.
x() != 0)
169 f_pos.
set_y(f_pos.y() + offset);
171 f_pos.set_x(f_pos.x() + offset);
177 if (offsets != NULL && offsets[index].pixel_diff > 0)
178 return offsets[index].direction;
187 return offsets[index].pixel_diff;
194 return (steps[index / 4] >> (index % 4 * 2)) &
STEP_MASK;
198 inT32 perimeter()
const;
199 inT32 outer_area()
const;
200 inT32 count_transitions(
208 return other < *
this;
210 inT16 winding_number(
213 inT16 turn_direction()
const;
223 bool IsLegallyNested()
const;
230 void RemoveSmallRecursive(
int min_size, C_OUTLINE_IT* it);
234 void ComputeEdgeOffsets(
int threshold, Pix* pix);
237 void ComputeBinaryOffsets();
241 void render(
int left,
int top, Pix* pix)
const;
247 #ifndef GRAPHICS_DISABLED 255 #endif // GRAPHICS_DISABLED 265 static ICOORD chain_step(
int chaindir);
271 static const int kMaxOutlineLength = 16000;
278 void increment_step(
int s,
int increment,
ICOORD* pos,
int* dir_counts,
279 int* pos_totals)
const;
280 int step_mem()
const {
return (stepcount+3) / 4; }
288 C_OUTLINE_LIST children;
289 static ICOORD step_coords[4];
#define ELISTIZEH(CLASSNAME)
ICOORD position_at_index(int index) const
ICOORD step(int index) const
void set_step(inT16 stepindex, DIR128 stepdir)
BOOL8 flag(C_OUTLINE_FLAGS mask) const
void set_step(inT16 stepindex, inT8 stepdir)
void render_outline(void *window, TESSLINE *outline, C_COL color)
int chain_code(int index) const
inT16 x() const
access function
void set_y(float yin)
rewrite function
const TBOX & bounding_box() const
int edge_strength_at_index(int index) const
void set_flag(C_OUTLINE_FLAGS mask, BOOL8 value)
const ICOORD & start_pos() const
DIR128 step_dir(int index) const
static C_OUTLINE * deep_copy(const C_OUTLINE *src)
void free_mem(void *oldchunk)
FCOORD sub_pixel_pos_at_index(const ICOORD &pos, int index) const
inT16 y() const
access_function
int direction_at_index(int index) const