Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dt_masks_skip_range_t Struct Reference

One cut in a shape's border outline: while walking the border buffer forward, on reaching index jump_from, resume at index resume_at. More...

#include <masks_types.h>

+ Collaboration diagram for dt_masks_skip_range_t:

Data Fields

int jump_from
 
int resume_at
 

Detailed Description

One cut in a shape's border outline: while walking the border buffer forward, on reaching index jump_from, resume at index resume_at.

A brush's or a polygon's border is its centreline offset by the local radius, and that offset curve folds over itself wherever the centreline bends tighter than the radius, and runs through the shape wherever the centreline comes back on itself. The samples that are not on the shape's boundary are found by dt_masks_outline_boundary_skips() – a border sample is on the boundary iff it is not strictly inside any other sample's disc – and are skipped by the GUI's drawer and by every walk that counts crossings (the hit-test). The rasterisers paint every sample: a spoke inside another disc paints nothing new.

These used to travel IN-BAND, encoded into the border buffer itself: NaN in the x slot, the jump target smuggled as an integer in the float y slot. Both bugs this mechanism ever had lived in that encoding, not in the geometry – a cycle when overlapping ranges pointed into each other (fixed by sorting and merging), then issue #1313, where a fold straddling the buffer seam was encoded as its own complement and swallowed 99.8% of the contour. An out-of-band range cannot express either mistake: resume_at > jump_from IS the forward-only invariant, checkable at a glance and validated by the consumers.

Invariants a producer must guarantee (dt_masks_outline_boundary_skips() does):

  • resume_at > jump_from (every skip moves the walk strictly forward);
  • ranges sorted by jump_from and pairwise disjoint (resume_at < next jump_from).

Definition at line 225 of file masks_types.h.

Field Documentation

◆ jump_from

int dt_masks_skip_range_t::jump_from

◆ resume_at

int dt_masks_skip_range_t::resume_at

The documentation for this struct was generated from the following file: