Enum printpdf::types::plugins::graphics::extgstate::SpotFunction [−][src]
pub enum SpotFunction {
Show 21 variants
SimpleDot,
InvertedSimpleDot,
DoubleDot,
InvertedDoubleDot,
CosineDot,
Double,
InvertedDouble,
Line,
LineX,
LineY,
Round,
Ellipse,
EllipseA,
InvertedEllipseA,
EllipseB,
EllipseC,
InvertedEllipseC,
Square,
Cross,
Rhomboid,
Diamond,
}
Expand description
Spot functions, Table 6.1, Page 489 in Pdf Reference v1.7 The code is pseudo code, returning the grey component at (x, y).
Variants
1 - (pow(x, 2) + pow(y, 2))
pow(x, 2) + pow(y, 2) - 1
(sin(360 * x) / 2) + (sin(360 * y) / 2)
- ((sin(360 * x) / 2) + (sin(360 * y) / 2))
(cos(180 * x) / 2) + (cos(180 * y) / 2)
(sin(360 x (x / 2)) / 2) + (sin(360 * y) / 2)
- ((sin(360 x (x / 2)) / 2) + (sin(360 * y) / 2))
- abs(y)
x
y
ⓘ
if abs(x) + abs(y) <= 1 {
1 - (pow(x, 2) + pow(y, 2))
} else {
pow((abs(x) - 1), 2) + pow((abs(y) - 1), 2) - 1
}
ⓘ
let w = (3 * abs(x)) + (4 * abs(y)) - 3;
if w < 0 {
1 - ((pow(x, 2) + pow((abs(y) / 0.75), 2)) / 4)
} else if w > 1 {
pow((pow((1 - abs(x), 2) + (1 - abs(y)) / 0.75), 2) / 4) - 1
} else {
0.5 - w
}
1 - (pow(x, 2) + 0.9 * pow(y, 2))
pow(x, 2) + 0.9 * pow(y, 2) - 1
1 - sqrt(pow(x, 2) + (5 / 8) * pow(y, 2))
1 - (0.9 * pow(x, 2) + pow(y, 2))
0.9 * pow(x, 2) + pow(y, 2) - 1
- max(abs(x), abs(y))
- min(abs(x), abs(y))
(0.9 * abs(x) + abs(y)) / 2
ⓘ
let t = abs(x) + abs(y);
if t <= 0.75 {
1 - (pow(x, 2) + pow(y, 2))
} else if t < 1.23 {
1 - (0.85 * abs(x) + abs(y))
} else {
pow((abs(x) - 1), 2) + pow((abs(y) - 1), 2) - 1
}
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SpotFunction
impl Send for SpotFunction
impl Sync for SpotFunction
impl Unpin for SpotFunction
impl UnwindSafe for SpotFunction
Blanket Implementations
Mutably borrows from an owned value. Read more