Module encode

Source
Expand description

Paints for drawing shapes.

Modulesยง

private ๐Ÿ”’

Structsยง

EncodedBlurredRoundedRectangle
An encoded blurred, rounded rectangle.
EncodedGradient
An encoded gradient.
EncodedImage
An encoded image.
FocalData
Focal data for a radial gradient.
GradientLut
A lookup table for sampled gradient values.
GradientRange
An encoded ange between two color stops.
LinearKind
Computed properties of a linear gradient.
SweepKind
Computed properties of a sweep gradient.

Enumsยง

EncodedKind
A kind of encoded gradient.
EncodedPaint
An encoded paint.
RadialKind
A radial gradient.

Constantsยง

DEGENERATE_THRESHOLD ๐Ÿ”’
NUDGE_VAL ๐Ÿ”’
PIXEL_CENTER_OFFSET ๐Ÿ”’

Traitsยง

EncodeExt
A trait for encoding gradients.
FromF32Color
A helper trait for converting a premultiplied f32 color to Self.

Functionsยง

apply_reflect ๐Ÿ”’
Extend the stops so that we can treat a repeated gradient like a reflected gradient.
determine_lut_size ๐Ÿ”’
encode_stops ๐Ÿ”’
Encode all stops into a sequence of ranges.
exp ๐Ÿ”’
ts_from_line_to_line ๐Ÿ”’
Calculates the transform necessary to map the line spanned by points src1, src2 to the line spanned by dst1, dst2.
unit_to_line ๐Ÿ”’
Calculate the transform necessary to map the unit vector to the line spanned by the points p1 and p2.
validate ๐Ÿ”’
Returns a fallback paint in case the gradient is invalid.
x_y_advances ๐Ÿ”’