fn line_size(&self, width: u32) -> usize {
        use crate::common::ColorType::*;
        let t = self.transform;
        let info = get_info!(self);
        let trns = info.trns.is_some();
        // TODO 16 bit
        let bits = match info.color_type {
            Indexed if trns && t.contains(crate::Transformations::EXPAND) => 4 * 8,
            Indexed if t.contains(crate::Transformations::EXPAND) => 3 * 8,
            RGB if trns && t.contains(crate::Transformations::EXPAND) => 4 * 8,
            Grayscale if trns && t.contains(crate::Transformations::EXPAND) => 2 * 8,
            Grayscale if t.contains(crate::Transformations::EXPAND) => 1 * 8,
            GrayscaleAlpha if t.contains(crate::Transformations::EXPAND) => 2 * 8,
            // divide by 2 as it will get mutiplied by two later
            _ if info.bit_depth as u8 == 16 => info.bits_per_pixel() / 2,
            _ => info.bits_per_pixel(),
        } * width as usize
            * if info.bit_depth as u8 == 16 { 2 } else { 1 };
        let len = bits / 8;
        let extra = bits % 8;
        len + match extra {
            0 => 0,
            _ => 1,
        }
    }
/// Returns the number of bytes required to decode a deinterlaced row.
Returns the number of bytes required to decode a deinterlaced row.
Returns the number of bytes required to decode a deinterlaced row .
fn line_size(&self, width: u32) -> usize {
        use crate::common::ColorType::*;
        let t = self.transform;
        let info = get_info!(self);
        let trns = info.trns.is_some();
        // TODO 16 bit
        let bits = match info.color_type {
            Indexed if trns && t.contains(crate::Transformations::EXPAND) => 4 * 8,
            Indexed if t.contains(crate::Transformations::EXPAND) => 3 * 8,
            RGB if trns && t.contains(crate::Transformations::EXPAND) => 4 * 8,
            Grayscale if trns && t.contains(crate::Transformations::EXPAND) => 2 * 8,
            Grayscale if t.contains(crate::Transformations::EXPAND) => 1 * 8,
            GrayscaleAlpha if t.contains(crate::Transformations::EXPAND) => 2 * 8,
            // divide by 2 as it will get mutiplied by two later
            _ if info.bit_depth as u8 == 16 => info.bits_per_pixel() / 2,
            _ => info.bits_per_pixel(),
        } * width as usize
            * if info.bit_depth as u8 == 16 { 2 } else { 1 };
        let len = bits / 8;
        let extra = bits % 8;
        len + match extra {
            0 => 0,
            _ => 1,
        }
    }
fn line_size ( & self , width : u32 ) -> usize { use crate :: common :: ColorType :: * ; let t = self . transform ; let info = get_info ! ( self ) ; let trns = info . trns . is_some ( ) ; // TODO 16 bit let bits = match info . color_type { Indexed if trns && t . contains ( crate :: Transformations :: EXPAND ) => 4 * 8 , Indexed if t . contains ( crate :: Transformations :: EXPAND ) => 3 * 8 , RGB if trns && t . contains ( crate :: Transformations :: EXPAND ) => 4 * 8 , Grayscale if trns && t . contains ( crate :: Transformations :: EXPAND ) => 2 * 8 , Grayscale if t . contains ( crate :: Transformations :: EXPAND ) => 1 * 8 , GrayscaleAlpha if t . contains ( crate :: Transformations :: EXPAND ) => 2 * 8 , // divide by 2 as it will get mutiplied by two later _ if info . bit_depth as u8 == 16 => info . bits_per_pixel ( ) / 2 , _ => info . bits_per_pixel ( ) , } * width as usize * if info . bit_depth as u8 == 16 { 2 } else { 1 } ; let len = bits / 8 ; let extra = bits % 8 ; len + match extra { 0 => 0 , _ => 1 , } }
Returns the number of bytes required to decode a deinterlaced row.
Returns the number of bytes required to decode a deinterlaced row .
&self
width
u32
&self
width
u32