Enum printpdf::path::WindingOrder
source · pub enum WindingOrder {
EvenOdd,
NonZero,
}
Expand description
The rule to use in filling/clipping paint operations.
This is meaningful in the following cases:
- When a path uses one of the fill paint operations, this will determine the rule used to fill the paths.
- When a path uses a clip painting mode, this will determine the rule used to limit the regions of the page affected by painting operators.
Most of the time, NonZero
is the appropriate option.
Variants§
EvenOdd
Make any filling or clipping paint operators follow the even-odd rule.
This rule determines whether a point is inside a path by drawing a ray from that point in any direction and simply counting the number of path segments that cross the ray, regardless of direction. If this number is odd, the point is inside; if even, the point is outside. This yields the same results as the nonzero winding number rule for paths with simple shapes, but produces different results for more complex shapes.
NonZero
Make any filling or clipping paint operators follow the nonzero rule.
This rule determines whether a given point is inside a path by conceptually drawing a ray from that point to infinity in any direction and then examining the places where a segment of the path crosses the ray. Starting with a count of 0, the rule adds 1 each time a path segment crosses the ray from left to right and subtracts 1 each time a segment crosses from right to left. After counting all the crossings, if the result is 0, the point is outside the path; otherwise, it is inside.
Implementations§
source§impl WindingOrder
impl WindingOrder
sourcepub fn get_clip_op(&self) -> &'static str
pub fn get_clip_op(&self) -> &'static str
Gets the operator for a clip paint operation.
sourcepub fn get_fill_op(&self) -> &'static str
pub fn get_fill_op(&self) -> &'static str
Gets the operator for a fill paint operation.
sourcepub fn get_fill_stroke_close_op(&self) -> &'static str
pub fn get_fill_stroke_close_op(&self) -> &'static str
Gets the operator for a close, fill and stroke painting operation.
sourcepub fn get_fill_stroke_op(&self) -> &'static str
pub fn get_fill_stroke_op(&self) -> &'static str
Gets the operator for a fill and stroke painting operation.
Trait Implementations§
source§impl Clone for WindingOrder
impl Clone for WindingOrder
source§fn clone(&self) -> WindingOrder
fn clone(&self) -> WindingOrder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WindingOrder
impl Debug for WindingOrder
source§impl Default for WindingOrder
impl Default for WindingOrder
source§fn default() -> WindingOrder
fn default() -> WindingOrder
source§impl Hash for WindingOrder
impl Hash for WindingOrder
source§impl PartialEq for WindingOrder
impl PartialEq for WindingOrder
source§fn eq(&self, other: &WindingOrder) -> bool
fn eq(&self, other: &WindingOrder) -> bool
self
and other
values to be equal, and is used
by ==
.