pub fn icc_profile(&self) -> Option<Vec<u8>> {
        let mut marker_present: [Option<&IccChunk>; 256] = [None; 256];
        let num_markers = self.icc_markers.len();
        if num_markers == 0 && num_markers < 256 {
            return None;
        }
        // check the validity of the markers
        for chunk in &self.icc_markers {
            if usize::from(chunk.num_markers) != num_markers {
                // all the lengths must match
                return None;
            }
            if chunk.seq_no == 0 {
                return None;
            }
            if marker_present[usize::from(chunk.seq_no)].is_some() {
                // duplicate seq_no
                return None;
            } else {
                marker_present[usize::from(chunk.seq_no)] = Some(chunk);
            }
        }

        // assemble them together by seq_no failing if any are missing
        let mut data = Vec::new();
        // seq_no's start at 1
        for &chunk in marker_present.get(1..=num_markers)? {
            data.extend_from_slice(&chunk?.data);
        }
        Some(data)
    }
/// Returns the embeded icc profile if the image contains one.
Returns the embeded icc profile if the image contains one.
Returns the embeded icc profile if the image contains one .
pub fn icc_profile(&self) -> Option<Vec<u8>> {
        let mut marker_present: [Option<&IccChunk>; 256] = [None; 256];
        let num_markers = self.icc_markers.len();
        if num_markers == 0 && num_markers < 256 {
            return None;
        }
        // check the validity of the markers
        for chunk in &self.icc_markers {
            if usize::from(chunk.num_markers) != num_markers {
                // all the lengths must match
                return None;
            }
            if chunk.seq_no == 0 {
                return None;
            }
            if marker_present[usize::from(chunk.seq_no)].is_some() {
                // duplicate seq_no
                return None;
            } else {
                marker_present[usize::from(chunk.seq_no)] = Some(chunk);
            }
        }
        // assemble them together by seq_no failing if any are missing
        let mut data = Vec::new();
        // seq_no's start at 1
        for &chunk in marker_present.get(1..=num_markers)? {
            data.extend_from_slice(&chunk?.data);
        }
        Some(data)
    }
pub fn icc_profile ( & self ) -> Option < Vec < u8 > > { let mut marker_present : [ Option < & IccChunk > ; 256 ] = [ None ; 256 ] ; let num_markers = self . icc_markers . len ( ) ; if num_markers == 0 && num_markers < 256 { return None ; } // check the validity of the markers for chunk in & self . icc_markers { if usize :: from ( chunk . num_markers ) != num_markers { // all the lengths must match return None ; } if chunk . seq_no == 0 { return None ; } if marker_present [ usize :: from ( chunk . seq_no ) ] . is_some ( ) { // duplicate seq_no return None ; } else { marker_present [ usize :: from ( chunk . seq_no ) ] = Some ( chunk ) ; } } // assemble them together by seq_no failing if any are missing let mut data = Vec :: new ( ) ; // seq_no's start at 1 for & chunk in marker_present . get ( 1 ..= num_markers ) ? { data . extend_from_slice ( & chunk ? . data ) ; } Some ( data ) }
Returns the embeded icc profile if the image contains one.
Returns the embeded icc profile if the image contains one .
&self