pub fn init_from_imageset(id: &str, imageset: &'a VeraImageSet) -> Result<Self, Error> {
		if !imageset.formatted {
			return Err(ErrorKind::ImageSetNotFormatted(imageset.id.to_owned()).into());
		}
		let depth = match imageset.depth {
			Some(d) => d,
			None => {
				return Err(ErrorKind::ImageSetNotFormatted(imageset.id.to_owned()).into());
			}
		};

		if depth == VeraPixelDepth::BPP1 {
			return Err(ErrorKind::UnexpectedDepthError(imageset.id.to_owned()).into());
		}
		Ok(VeraBitmap {
			id: id.into(),
			imageset_id: imageset.id.clone(),
			depth,
			width: VeraBitmapDim::from_u32(imageset.frame_width)?,
			imageset: Some(imageset),
		})
	}
/// initialize values from a palette-formatted image set
/// All we're really doing here is verifying that the
/// imageset conforms to allowed dimensions and
/// depths
initialize values from a palette-formatted image set
All we're really doing here is verifying that the
imageset conforms to allowed dimensions and
depths
initialize values from a palette - formatted image set All we ' re really doing here is verifying that the imageset conforms to allowed dimensions and depths
pub fn init_from_imageset(id: &str, imageset: &'a VeraImageSet) -> Result<Self, Error> {
		if !imageset.formatted {
			return Err(ErrorKind::ImageSetNotFormatted(imageset.id.to_owned()).into());
		}
		let depth = match imageset.depth {
			Some(d) => d,
			None => {
				return Err(ErrorKind::ImageSetNotFormatted(imageset.id.to_owned()).into());
			}
		};
		if depth == VeraPixelDepth::BPP1 {
			return Err(ErrorKind::UnexpectedDepthError(imageset.id.to_owned()).into());
		}
		Ok(VeraBitmap {
			id: id.into(),
			imageset_id: imageset.id.clone(),
			depth,
			width: VeraBitmapDim::from_u32(imageset.frame_width)?,
			imageset: Some(imageset),
		})
	}
pub fn init_from_imageset ( id : & str , imageset : & ' a VeraImageSet ) -> Result < Self , Error > { if ! imageset . formatted { return Err ( ErrorKind :: ImageSetNotFormatted ( imageset . id . to_owned ( ) ) . into ( ) ) ; } let depth = match imageset . depth { Some ( d ) => d , None => { return Err ( ErrorKind :: ImageSetNotFormatted ( imageset . id . to_owned ( ) ) . into ( ) ) ; } } ; if depth == VeraPixelDepth :: BPP1 { return Err ( ErrorKind :: UnexpectedDepthError ( imageset . id . to_owned ( ) ) . into ( ) ) ; } Ok ( VeraBitmap { id : id . into ( ) , imageset_id : imageset . id . clone ( ) , depth , width : VeraBitmapDim :: from_u32 ( imageset . frame_width ) ? , imageset : Some ( imageset ) , } ) }
initialize values from a palette-formatted image set
All we're really doing here is verifying that the
imageset conforms to allowed dimensions and
depths
initialize values from a palette - formatted image set All we ' re really doing here is verifying that the imageset conforms to allowed dimensions and depths
id
&str
imageset
&'a VeraImageSet