30 #include "scrollview.h" 35 #define INTERSECTING INT16_MAX//no winding number 91 static void FakeOutline(
const TBOX& box, C_OUTLINE_LIST* outlines);
99 C_OUTLINE_FLAGS mask)
const {
100 return flags.bit(mask);
103 C_OUTLINE_FLAGS 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);
129 int8_t chaindir = stepdir.
get_dir() >> (DIRBITS - 2);
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;
247 void render_outline(
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;
uint8_t pixel_diff
Definition: coutln.h:64
C_OUTLINE_LIST * child()
Definition: coutln.h:108
void set_step(int16_t stepindex, int8_t stepdir)
Definition: coutln.h:116
int direction_at_index(int index) const
Definition: coutln.h:178
int16_t x() const
access function
Definition: points.h:53
int step_mem() const
Definition: coutln.h:282
static C_OUTLINE * deep_copy(const C_OUTLINE *src)
Definition: coutln.h:261
const TBOX & bounding_box() const
Definition: coutln.h:113
int chain_code(int index) const
Definition: coutln.h:195
C_OUTLINE_LIST children
Definition: coutln.h:290
int edge_strength_at_index(int index) const
Definition: coutln.h:187
EdgeOffset * offsets
Definition: coutln.h:289
TBOX box
Definition: coutln.h:284
FCOORD sub_pixel_pos_at_index(const ICOORD &pos, int index) const
Definition: coutln.h:163
int16_t stepcount
Definition: coutln.h:286
BITS16 flags
Definition: coutln.h:287
Definition: crakedge.h:26
void set_y(float yin)
rewrite function
Definition: points.h:219
C_OUTLINE()
Definition: coutln.h:74
int16_t y() const
access_function
Definition: points.h:57
ICOORD step(int index) const
Definition: coutln.h:144
uint8_t * steps
Definition: coutln.h:288
~C_OUTLINE()
Definition: coutln.h:93
integer coordinate
Definition: points.h:32
void set_step(int16_t stepindex, DIR128 stepdir)
Definition: coutln.h:125
uint8_t direction
Definition: coutln.h:65
Definition: normalis.h:50
int8_t offset_numerator
Definition: coutln.h:63
ICOORD start
Definition: coutln.h:285
int32_t pathlength() const
Definition: coutln.h:135
ICOORD position_at_index(int index) const
Definition: coutln.h:153
const ICOORD & start_pos() const
Definition: coutln.h:148
DIR128 step_dir(int index) const
Definition: coutln.h:139
int8_t get_dir() const
Definition: mod128.h:76
bool flag(C_OUTLINE_FLAGS mask) const
Definition: coutln.h:98
void set_flag(C_OUTLINE_FLAGS mask, bool value)
Definition: coutln.h:102