pub fn output_color_type(&mut self) -> (ColorType, BitDepth) {
        use crate::common::ColorType::*;
        let t = self.transform;
        let info = get_info!(self);
        if t == crate::Transformations::IDENTITY {
            (info.color_type, info.bit_depth)
        } else {
            let bits = match info.bit_depth as u8 {
                16 if t.intersects(
                    crate::Transformations::SCALE_16 | crate::Transformations::STRIP_16,
                ) =>
                {
                    8
                }
                n if n < 8 && t.contains(crate::Transformations::EXPAND) => 8,
                n => n,
            };
            let color_type = if t.contains(crate::Transformations::EXPAND) {
                let has_trns = info.trns.is_some();
                match info.color_type {
                    Grayscale if has_trns => GrayscaleAlpha,
                    RGB if has_trns => RGBA,
                    Indexed if has_trns => RGBA,
                    Indexed => RGB,
                    ct => ct,
                }
            } else {
                info.color_type
            };
            (color_type, BitDepth::from_u8(bits).unwrap())
        }
    }
/// Returns the color type and the number of bits per sample
/// of the data returned by `Reader::next_row` and Reader::frames`.
Returns the color type and the number of bits per sample
of the data returned by `Reader::next_row` and Reader::frames`.
Returns the color type and the number of bits per sample of the data returned by ` Reader :: next_row ` and Reader :: frames ` .
pub fn output_color_type(&mut self) -> (ColorType, BitDepth) {
        use crate::common::ColorType::*;
        let t = self.transform;
        let info = get_info!(self);
        if t == crate::Transformations::IDENTITY {
            (info.color_type, info.bit_depth)
        } else {
            let bits = match info.bit_depth as u8 {
                16 if t.intersects(
                    crate::Transformations::SCALE_16 | crate::Transformations::STRIP_16,
                ) =>
                {
                    8
                }
                n if n < 8 && t.contains(crate::Transformations::EXPAND) => 8,
                n => n,
            };
            let color_type = if t.contains(crate::Transformations::EXPAND) {
                let has_trns = info.trns.is_some();
                match info.color_type {
                    Grayscale if has_trns => GrayscaleAlpha,
                    RGB if has_trns => RGBA,
                    Indexed if has_trns => RGBA,
                    Indexed => RGB,
                    ct => ct,
                }
            } else {
                info.color_type
            };
            (color_type, BitDepth::from_u8(bits).unwrap())
        }
    }
pub fn output_color_type ( & mut self ) -> ( ColorType , BitDepth ) { use crate :: common :: ColorType :: * ; let t = self . transform ; let info = get_info ! ( self ) ; if t == crate :: Transformations :: IDENTITY { ( info . color_type , info . bit_depth ) } else { let bits = match info . bit_depth as u8 { 16 if t . intersects ( crate :: Transformations :: SCALE_16 | crate :: Transformations :: STRIP_16 , ) => { 8 } n if n < 8 && t . contains ( crate :: Transformations :: EXPAND ) => 8 , n => n , } ; let color_type = if t . contains ( crate :: Transformations :: EXPAND ) { let has_trns = info . trns . is_some ( ) ; match info . color_type { Grayscale if has_trns => GrayscaleAlpha , RGB if has_trns => RGBA , Indexed if has_trns => RGBA , Indexed => RGB , ct => ct , } } else { info . color_type } ; ( color_type , BitDepth :: from_u8 ( bits ) . unwrap ( ) ) } }
Returns the color type and the number of bits per sample
of the data returned by `Reader::next_row` and Reader::frames`.
Returns the color type and the number of bits per sample of the data returned by ` Reader :: next_row ` and Reader :: frames ` .
&mut self
&mut self