Function libjxl_sys::JxlDecoderSetKeepOrientation[][src]

pub unsafe extern "C" fn JxlDecoderSetKeepOrientation(
    dec: *mut JxlDecoder,
    keep_orientation: c_int
) -> JxlDecoderStatus

Enables or disables preserving of original orientation. Some images are encoded with an orientation tag indicating the image is rotated and/or mirrored (here called the original orientation).

*) If keep_orientation is JXL_FALSE (the default): the decoder will perform work to undo the transformation. This ensures the decoded pixels will not be rotated or mirrored. The decoder will always set the orientation field of the JxlBasicInfo to JXL_ORIENT_IDENTITY to match the returned pixel data. The decoder may also swap xsize and ysize in the JxlBasicInfo compared to the values inside of the codestream, to correctly match the decoded pixel data, e.g. when a 90 degree rotation was performed.

*) If this option is JXL_TRUE: then the image is returned as-is, which may be rotated or mirrored, and the user must check the orientation field in JxlBasicInfo after decoding to correctly interpret the decoded pixel data. This may be faster to decode since the decoder doesn’t have to apply the transformation, but can cause wrong display of the image if the orientation tag is not correctly taken into account by the user.

By default, this option is disabled, and the decoder automatically corrects the orientation.

@see JxlBasicInfo for the orientation field, and @see JxlOrientation for the possible values.

@param dec decoder object @param keep_orientation JXL_TRUE to enable, JXL_FALSE to disable. @return JXL_DEC_SUCCESS if no error, JXL_DEC_ERROR otherwise.