Skip to main content

Module decode

Module decode 

Source
Expand description

Turning a file into pixels a renderer can take, within a budget.

The order is the design, and each step exists because the one before it made it safe:

  1. crate::measure reads the header. Nothing is allocated.
  2. crate::budget decides whether this may be decoded at all, and at what size.
  3. The decoder runs under image’s own Limits, so a file whose header lied is refused while allocating rather than after.
  4. The EXIF orientation is applied — ours to apply, because the renderer only does it for handle kinds a viewer cannot use. See crate::orientation.
  5. The result is resized down to the budget and handed over as RGBA8.

Structs§

Decoded
A decoded picture, ready to become a renderer’s handle.

Functions§

decode_to_fit
Decodes path to fit within budget.