JxlEncoderAddJPEGFrame

Function JxlEncoderAddJPEGFrame 

Source
pub unsafe extern "C-unwind" fn JxlEncoderAddJPEGFrame(
    options: *const JxlEncoderFrameSettings,
    buffer: *const u8,
    size: usize,
) -> JxlEncoderStatus
Expand description

Sets the buffer to read JPEG encoded bytes from for the next frame to encode.

If JxlEncoderSetBasicInfo has not yet been called, calling JxlEncoderAddJPEGFrame will implicitly call it with the parameters of the added JPEG frame.

If JxlEncoderSetColorEncoding or JxlEncoderSetICCProfile has not yet been called, calling JxlEncoderAddJPEGFrame will implicitly call it with the parameters of the added JPEG frame.

If the encoder is set to store JPEG reconstruction metadata using JxlEncoderStoreJPEGMetadata and a single JPEG frame is added, it will be possible to losslessly reconstruct the JPEG codestream.

If this is the last frame, JxlEncoderCloseInput or JxlEncoderCloseFrames must be called before the next JxlEncoderProcessOutput call.

Note, this can only be used to add JPEG frames for lossless compression. To encode with lossy compression, the JPEG must be decoded manually and a pixel buffer added using JxlEncoderAddImageFrame.

§Parameters

  • frame_settings: set of options and metadata for this frame. Also includes reference to the encoder object.
  • buffer: bytes to read JPEG from. Owned by the caller and its contents are copied internally.
  • size: size of buffer in bytes.

§Returns