pub unsafe extern "C-unwind" fn JxlEncoderProcessOutput(
enc: *mut JxlEncoder,
next_out: *mut *mut u8,
avail_out: *mut usize,
) -> JxlEncoderStatusExpand description
Encodes a JPEG XL file using the available bytes. *avail_out indicates how
many output bytes are available, and *next_out points to the input bytes.
*avail_out will be decremented by the amount of bytes that have been
processed by the encoder and *next_out will be incremented by the same
amount, so *next_out will now point at the amount of *avail_out unprocessed
bytes.
The returned status indicates whether the encoder needs more output bytes.
When the return value is not JxlEncoderStatus::Error or JxlEncoderStatus::Success, the
encoding requires more JxlEncoderProcessOutput calls to continue.
The caller must guarantee that *avail_out >= 32 when calling
JxlEncoderProcessOutput; otherwise, JxlEncoderStatus::NeedMoreOutput will
be returned. It is guaranteed that, if *avail_out >= 32, at least one byte of
output will be written.
This encodes the frames and/or boxes added so far. If the last frame or last
box has been added, JxlEncoderCloseInput, JxlEncoderCloseFrames
and/or JxlEncoderCloseBoxes must be called before the next
JxlEncoderProcessOutput call, or the codestream won’t be encoded
correctly.
§Parameters
enc: Encoder object.next_out: Pointer to next bytes to write to.avail_out: Amount of bytes available starting from*next_out.
§Returns
JxlEncoderStatus::Successwhen encoding finished and all events handled.JxlEncoderStatus::Errorwhen encoding failed, e.g. invalid input.JxlEncoderStatus::NeedMoreOutputmore output buffer is necessary.