pub fn from_u8(val: u8) -> Result<TgaImageType, TgaError> {
        match val {
            0 => Ok(NoImage),
            1 => Ok(ColorMappedImage),
            2 => Ok(TrueColorImage),
            3 => Ok(BlackAndWhiteImage),
            9 => Ok(RleColorMappedImage),
            10 => Ok(RleTrueColorImage),
            11 => Ok(RleBlackAndWhiteImage),
            _ => Err(InvalidImageType)
        }
    }
/// Tries to convert `val` to one of the possible `TgaImageType`s.
/// 
/// # Errors
/// If `val` is not a valid image type, then returns `InvalidImageType` error.
Tries to convert `val` to one of the possible `TgaImageType`s.
Tries to convert ` val ` to one of the possible ` TgaImageType ` s .
pub fn from_u8(val: u8) -> Result<TgaImageType, TgaError> {
        match val {
            0 => Ok(NoImage),
            1 => Ok(ColorMappedImage),
            2 => Ok(TrueColorImage),
            3 => Ok(BlackAndWhiteImage),
            9 => Ok(RleColorMappedImage),
            10 => Ok(RleTrueColorImage),
            11 => Ok(RleBlackAndWhiteImage),
            _ => Err(InvalidImageType)
        }
    }
pub fn from_u8 ( val : u8 ) -> Result < TgaImageType , TgaError > { match val { 0 => Ok ( NoImage ) , 1 => Ok ( ColorMappedImage ) , 2 => Ok ( TrueColorImage ) , 3 => Ok ( BlackAndWhiteImage ) , 9 => Ok ( RleColorMappedImage ) , 10 => Ok ( RleTrueColorImage ) , 11 => Ok ( RleBlackAndWhiteImage ) , _ => Err ( InvalidImageType ) } }
Tries to convert `val` to one of the possible `TgaImageType`s.
Tries to convert ` val ` to one of the possible ` TgaImageType ` s .
val
u8
val
u8
errors
If `val` is not a valid image type, then returns `InvalidImageType` error.
If ` val ` is not a valid image type then returns ` InvalidImageType ` error .