Skip to main content

ImageDecoder

Trait ImageDecoder 

Source
pub trait ImageDecoder: Send + Sync {
    // Required methods
    fn decode_image(
        &self,
        image_ref: &ImageRef,
        matrix: &Matrix,
    ) -> Result<DecodedImage, RenderError>;
    fn decode_inline_image(
        &self,
        properties: &HashMap<Name, Operand>,
        data: &[u8],
        matrix: &Matrix,
    ) -> Result<DecodedImage, RenderError>;
}
Expand description

Trait for decoding PDF images at render time.

Implementations resolve image XObject references and inline image data into decoded pixel buffers.

Required Methods§

Source

fn decode_image( &self, image_ref: &ImageRef, matrix: &Matrix, ) -> Result<DecodedImage, RenderError>

Decode an image XObject.

Source

fn decode_inline_image( &self, properties: &HashMap<Name, Operand>, data: &[u8], matrix: &Matrix, ) -> Result<DecodedImage, RenderError>

Decode an inline image.

Implementors§