Expand description
Raster image resolution and decode for #image(...) directives.
The lowerer hands us a relative path (typed as "path.png" in the
source) plus the source file’s location. We resolve it to an
absolute path, read the bytes, and decode them through the image
crate’s PNG / JPEG decoders. The decoded pixels are flattened to
RGB8 (alpha channels are composited onto white) so the PDF
backend can emit them as a /DeviceRGB Image XObject without
threading a soft-mask through the emit path.
Diagnostics:
MOS0037:#image(...)called without a path string.MOS0012: cannot read the file on disk.MOS0029: cannot decode the bytes as PNG/JPEG.
Structs§
- Decoded
Image 🔒 - One decoded raster image, ready to be lowered onto a
[
mos_core::NodeKind::Image] node.