pub unsafe extern "C" 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. @p *avail_out indicates how many output bytes are available, and @p *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 ::JXL_ENC_ERROR or ::JXL_ENC_SUCCESS, the encoding requires more @ref JxlEncoderProcessOutput calls to continue.
The caller must guarantee that *avail_out >= 32 when calling @ref JxlEncoderProcessOutput; otherwise, ::JXL_ENC_NEED_MORE_OUTPUT 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, @ref JxlEncoderCloseInput, @ref JxlEncoderCloseFrames and/or @ref JxlEncoderCloseBoxes must be called before the next @ref JxlEncoderProcessOutput call, or the codestream won’t be encoded correctly.
@param enc encoder object. @param next_out pointer to next bytes to write to. @param avail_out amount of bytes available starting from *next_out. @return ::JXL_ENC_SUCCESS when encoding finished and all events handled. @return ::JXL_ENC_ERROR when encoding failed, e.g. invalid input. @return ::JXL_ENC_NEED_MORE_OUTPUT more output buffer is necessary.