Skip to main content

Crate alpha2_extensions

Crate alpha2_extensions 

Source
Expand description

Extension providers for formats the host’s video and image decoders do not read.

A provider probes bytes (never a file name) and opens a source that returns frames by source time. The host registers providers in priority order; the engine and renderer never see them. Each format is a cargo feature, and a build without one reports that format as unsupported.

Structs§

AnimatedImageProvider
Reads GIF, animated WebP, and APNG. Still files of those formats are left to the host.
ExrProvider
Reads still OpenEXR images.
LinearColor
The primaries of linear-light media and where they came from.
LottieProvider
Reads Lottie JSON and dotLottie packages.
NoResources
A resolver with nothing registered.
PdfProvider
Reads pages of PDF documents.
ProbeReport
What probing a file finds.
ProgressWatch
Ends a watch_progress watch, restoring the one before it.
Registry
The providers a host’s build includes, highest priority first.
SvgProvider
Reads static SVG documents.
VisualFrame
One frame of a source.

Enums§

ColorOrigin
Where a source’s color description comes from.
Diagnostic
Something a provider did that the user should know about.
ExtensionError
Why a provider could not answer.
Format
A format a provider reads.
FramePixels
A frame’s tightly packed pixels, in the source’s precision. Shared with the source’s cache, so repeated frames cost 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 all of an animated image’s frames may cover together. About a thousand 1080p frames, roughly ten seconds of native decoding.
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
Frame delays at or below this are shown for NORMALIZED_DELAY_MS and reported. This catches GIF delays of 0 and 1 hundredths while 60 fps (16 or 17 ms) plays as declared.
MAX_SOURCE_IMAGE_PIXELS
Most pixels the raster images inside one source may decode to together. An SVG counts every image draw per render (an image reused through <use> counts twice); Lottie counts its assets once at open.
NORMALIZED_DELAY_MS
What a delay of MAX_NORMALIZED_DELAY_MS or less becomes.

Traits§

ResourceResolver
Supplies bytes a source needs besides its own (sequence frames, SVG fonts and images). Parsers may call it from other threads, hence Send + Sync.
VisualProvider
Reads one family of formats.
VisualSource
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 file of length bytes larger than its document_limit.
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 whole-file format (SVG, Lottie, dotLottie, PDF), with a name for the file kind; None for streamed formats. head is the file’s start, used to tell a dotLottie ZIP from Lottie JSON.
open_latex
Typesets latex at font_size pixels per em. The canvas covers the formula’s box and any ink past it, in whole pixels.
open_sequence
Opens an image sequence of frames in play order (None for a gap). Only the first frame is read here; primaries overrides OpenEXR color.
premultiply
Premultiplies straight RGBA8 in place, rounding to nearest.
watch_progress
Calls progressed each time a provider call on this thread gets further, until the watch drops.

Type Aliases§

SharedResolver
A resolver a source may keep, such as an image sequence that reads frames on demand.