35 #define INTERSECTING INT16_MAX//no winding number 91 static void FakeOutline(
const TBOX& box, C_OUTLINE_LIST* outlines);
100 return flags.bit(mask);
105 flags.set_bit(mask, value);
119 int shift = stepindex%4 * 2;
120 uint8_t mask = 3 << shift;
121 steps[stepindex/4] = ((stepdir << shift) & mask) |
122 (steps[stepindex/4] & ~mask);
131 set_step(stepindex, chaindir);
140 return DIR128((int16_t)(((steps[index/4] >> (index%4 * 2)) &
STEP_MASK) <<
145 return step_coords[chain_code(index)];
155 for (
int i = 0; i < index; ++i)
164 const ICOORD& step_to_next(step(index));
165 FCOORD f_pos(pos.
x() + step_to_next.
x() / 2.0f,
166 pos.
y() + step_to_next.
y() / 2.0f);
167 if (offsets !=
nullptr && offsets[index].pixel_diff > 0) {
168 float offset = offsets[index].offset_numerator;
169 offset /= offsets[index].pixel_diff;
170 if (step_to_next.
x() != 0)
171 f_pos.
set_y(f_pos.y() + offset);
173 f_pos.set_x(f_pos.x() + offset);
179 if (offsets !=
nullptr && offsets[index].pixel_diff > 0)
180 return offsets[index].direction;
188 if (offsets !=
nullptr)
189 return offsets[index].pixel_diff;
196 return (steps[index / 4] >> (index % 4 * 2)) &
STEP_MASK;
199 int32_t area()
const;
200 int32_t perimeter()
const;
201 int32_t outer_area()
const;
202 int32_t count_transitions(
210 return other < *
this;
212 int16_t winding_number(
215 int16_t turn_direction()
const;
225 bool IsLegallyNested()
const;
232 void RemoveSmallRecursive(
int min_size, C_OUTLINE_IT* it);
236 void ComputeEdgeOffsets(
int threshold, Pix* pix);
239 void ComputeBinaryOffsets();
243 void render(
int left,
int top, Pix* pix)
const;
249 #ifndef GRAPHICS_DISABLED 257 #endif // GRAPHICS_DISABLED 267 static ICOORD chain_step(
int chaindir);
273 static const int kMaxOutlineLength = 16000;
280 void increment_step(
int s,
int increment,
ICOORD* pos,
int* dir_counts,
281 int* pos_totals)
const;
282 int step_mem()
const {
return (stepcount+3) / 4; }
290 C_OUTLINE_LIST children;
291 static ICOORD step_coords[4];
int direction_at_index(int index) const
#define ELISTIZEH(CLASSNAME)
FCOORD sub_pixel_pos_at_index(const ICOORD &pos, int index) const
int16_t y() const
access_function
const ICOORD & start_pos() const
void set_step(int16_t stepindex, int8_t stepdir)
bool flag(C_OUTLINE_FLAGS mask) const
void render_outline(void *window, TESSLINE *outline, C_COL color)
int16_t x() const
access function
ICOORD position_at_index(int index) const
int edge_strength_at_index(int index) const
int32_t pathlength() const
const TBOX & bounding_box() const
static C_OUTLINE * deep_copy(const C_OUTLINE *src)
void set_flag(C_OUTLINE_FLAGS mask, bool value)
void set_step(int16_t stepindex, DIR128 stepdir)
DIR128 step_dir(int index) const
int chain_code(int index) const
void set_y(float yin)
rewrite function
ICOORD step(int index) const