pub fn create_multi(
        mut self,
        frames: u32,
        faces: u32,
        slices: u32,
        data: &mut [&mut [u8]],
    ) -> Result<()> {
        if data.len() < frames.max(faces.max(slices)) as usize {
            return Err(Error::InvalidLength);
        }
        let image_size =
            VtfFile::compute_image_size(self.width, self.height, 1, 1, ImageFormat::Rgba8888)
                as usize;
        for slice in data.iter() {
            if slice.len() < image_size {
                return Err(Error::InvalidLength);
            }
        }
        unsafe {
            let mut data: Vec<_> = data.iter_mut().map(|e| e.as_mut_ptr()).collect();
            ffi_try!(ffi::vlImageCreateMultiple(
                self.width,
                self.height,
                frames,
                faces,
                slices,
                data.as_mut_ptr(),
                &mut self.options,
            ));
        }
        Ok(())
    }
/// Create a multi frame or cubemap image from `data`.
/// Data needs to be `mut` because some creation options are applied in place.
///
/// # Errors
///
/// Returns `Err` if `data` has the wrong length or the image creation fails.
Create a multi frame or cubemap image from `data`.
Data needs to be `mut` because some creation options are applied in place.
Create a multi frame or cubemap image from ` data ` . Data needs to be ` mut ` because some creation options are applied in place .
pub fn create_multi(
        mut self,
        frames: u32,
        faces: u32,
        slices: u32,
        data: &mut [&mut [u8]],
    ) -> Result<()> {
        if data.len() < frames.max(faces.max(slices)) as usize {
            return Err(Error::InvalidLength);
        }
        let image_size =
            VtfFile::compute_image_size(self.width, self.height, 1, 1, ImageFormat::Rgba8888)
                as usize;
        for slice in data.iter() {
            if slice.len() < image_size {
                return Err(Error::InvalidLength);
            }
        }
        unsafe {
            let mut data: Vec<_> = data.iter_mut().map(|e| e.as_mut_ptr()).collect();
            ffi_try!(ffi::vlImageCreateMultiple(
                self.width,
                self.height,
                frames,
                faces,
                slices,
                data.as_mut_ptr(),
                &mut self.options,
            ));
        }
        Ok(())
    }
pub fn create_multi ( mut self , frames : u32 , faces : u32 , slices : u32 , data : & mut [ & mut [ u8 ] ] , ) -> Result < ( ) > { if data . len ( ) < frames . max ( faces . max ( slices ) ) as usize { return Err ( Error :: InvalidLength ) ; } let image_size = VtfFile :: compute_image_size ( self . width , self . height , 1 , 1 , ImageFormat :: Rgba8888 ) as usize ; for slice in data . iter ( ) { if slice . len ( ) < image_size { return Err ( Error :: InvalidLength ) ; } } unsafe { let mut data : Vec < _ > = data . iter_mut ( ) . map ( | e | e . as_mut_ptr ( ) ) . collect ( ) ; ffi_try ! ( ffi vlImageCreateMultiple ( self width self height frames faces slices data as_mut_ptr ( ) mut self options ) ) ; } Ok ( ( ) ) }
Create a multi frame or cubemap image from `data`.
Create a multi frame or cubemap image from ` data ` .
mut self
frames
u32
faces
u32
slices
u32
data
&mut [&mut [u8]]
mut self
frames
u32
faces
u32
slices
u32
data
&mut [&mut [u8]]
errors
Returns `Err` if `data` has the wrong length or the image creation fails.
Returns ` Err ` if ` data ` has the wrong length or the image creation fails .