Expand description
Extension providers: frames of formats the host’s video and image decoders do not read, supplied through one contract.
A provider probes bytes (never a file name) and opens a source that answers frames by source time. The host registers the providers its build includes, in priority order, and feeds their frames to the engine like any other source’s; the engine and the renderer know nothing of them. Each format is a cargo feature: a build without one still renders everything else, and reports that format’s sources as unsupported.
Structs§
- Animated
Image Provider - Reads GIF, animated WebP, and APNG. A still file of those formats is not this provider’s: the host’s image decoders read it.
- ExrProvider
- Reads still OpenEXR images.
- Linear
Color - What linear-light media’s RGB is: the primaries it is in, and where that was learned.
- Lottie
Provider - Reads Lottie JSON and dotLottie packages.
- NoResources
- A resolver with nothing registered.
- Probe
Report - What probing a file finds.
- Progress
Watch - Ends a
watch_progresswatch, restoring the one before it. - Registry
- The providers a host’s build includes, highest priority first.
- SvgProvider
- Reads static SVG documents.
- Visual
Frame - One frame of a source.
Enums§
- Color
Origin - Where a source’s color description comes from.
- Diagnostic
- Something a provider did that the user should know about.
- Extension
Error - Why a provider could not answer.
- Format
- A format a provider reads.
- Frame
Pixels - A frame’s pixels, rows packed without padding, in the precision its source has. Shared, never copied, with what the source keeps: a frame a source answers again (a still, a frame it holds) costs no copy.
- Timing
- When a source’s frames are shown, in source time.
Constants§
- DEFAULT_
FRAME_ BUDGET - Decoded bytes an animated source or an image sequence keeps between requests.
- MAX_
ANIMATION_ FRAMES - Most frames an animated image may have.
- MAX_
ANIMATION_ PIXELS - Most pixels an animated image’s frames may cover, all frames together: what one pass through it decodes and composites, whatever its canvas. About a thousand whole 1080p frames, which one pass decodes in about ten seconds natively.
- MAX_
CANVAS_ PIXELS - Largest canvas a provider opens, in pixels: 8K UHD.
- MAX_
CANVAS_ SIDE - Largest canvas side a provider opens, in pixels.
- MAX_
NORMALIZED_ DELAY_ MS - The longest delay not taken as meant: a frame declaring this or less
(zero included) is shown for
NORMALIZED_DELAY_MSand reported. A GIF counts delays in hundredths of a second, so its 0 and 1 are the delays normalized; APNG and WebP declare frame times exactly, and a longer delay (60 fps is 16 or 17 ms) plays as declared, in every format alike. - MAX_
SOURCE_ IMAGE_ PIXELS - Most pixels the raster images inside one source may decode to, all of
them together: four whole canvases of
MAX_CANVAS_PIXELS. An SVG decodes every image it draws on each render (an image drawn twice, as through<use>, counts twice) and a Lottie animation decodes its image assets once, when it opens, and holds them; each image is also withincheck_canvason its own. A source past it is refused. - NORMALIZED_
DELAY_ MS - What a delay of
MAX_NORMALIZED_DELAY_MSor less becomes.
Traits§
- Resource
Resolver - Bytes a source needs besides its own: an image sequence’s frames, and the fonts and images an SVG names. A provider never fetches anything else. It may be asked from inside a parser (usvg asks for each image it draws), which requires it to be shared across threads.
- Visual
Provider - Reads one family of formats.
- Visual
Source - A source a provider opened: asked for frames by source time.
Functions§
- check_
canvas - Refuses a canvas larger than a provider opens.
- check_
document_ size - Refuses a source’s file of
lengthbytes larger than itsdocument_limit, before it is read or parsed. - check_
image_ pixels - Refuses images that together decode to more than
MAX_SOURCE_IMAGE_PIXELS. - document_
limit - The most bytes a provider reads of a source’s own file, for the formats
it reads whole: a dotLottie package (
MAX_PROVIDER_DOCUMENT_BYTES), a Lottie JSON file (MAX_LOTTIE_DOCUMENT_BYTES), and an SVG document (MAX_SVG_DOCUMENT_BYTES), with what the file is called;Nonefor the formats a provider decodes as it goes.headis the file’s start: a Lottie source’s file is a package when it starts as a ZIP file does. - open_
sequence - Opens an image sequence:
framesin play order (Nonefor a gap in the numbering), atrate, their bytes fromresolveras they are shown; OpenEXR frames inprimarieswhen given. Only the first frame is read here. - premultiply
- Premultiplies straight RGBA8 in place, rounding to nearest.
- watch_
progress - Calls
progressedon this thread each time a provider call it makes gets further, until the returned watch drops.
Type Aliases§
- Shared
Resolver - A resolver a source may keep: an image sequence reads each frame from it when it shows that frame, never all of them when it opens.