Skip to main content

decode_jpeg_with_icc

Function decode_jpeg_with_icc 

Source
pub fn decode_jpeg_with_icc(data: &[u8]) -> Result<ImageData>
Expand description

Decode a JPEG image with ICC profile extraction.

This function decodes JPEG data and extracts any embedded ICC profile. The result can be passed to EvalSession::evaluate_image() for accurate quality metric calculation.

§Arguments

  • data - JPEG-compressed image data

§Returns

ImageData containing the decoded pixels and ICC profile (if present). Returns ImageData::RgbSliceWithIcc if an ICC profile was found, or ImageData::RgbSlice if no profile was embedded.

§Errors

Returns an error if the JPEG data is invalid or decoding fails.