[][src]Struct tinytga::Tga

pub struct Tga<'a> {
    pub header: TgaHeader,
    pub footer: Option<TgaFooter>,
    pub color_map: Option<&'a [u8]>,
    pub pixel_data: &'a [u8],
}

TGA image

Fields

header: TgaHeader

TGA header

footer: Option<TgaFooter>

TGA footer (last 26 bytes of file)

color_map: Option<&'a [u8]>

Color map

pixel_data: &'a [u8]

Image pixel data

Methods

impl<'a> Tga<'a>[src]

pub fn from_slice(bytes: &'a [u8]) -> Result<Self, ParseError>[src]

Parse a TGA image from a byte slice

pub fn bpp(&self) -> u8[src]

Get the bit depth (BPP) of this image

pub fn width(&self) -> u16[src]

Get the image width in pixels

pub fn height(&self) -> u16[src]

Get the image height in pixels

pub fn image_data(&self) -> &[u8][src]

Get the raw image data contained in this image

Trait Implementations

impl<'a> Clone for Tga<'a>[src]

impl<'a> Copy for Tga<'a>[src]

impl<'a> Debug for Tga<'a>[src]

impl<'a> Eq for Tga<'a>[src]

impl<'a> Hash for Tga<'a>[src]

impl<'a> IntoIterator for &'a Tga<'a>[src]

type Item = Pixel

The type of the elements being iterated over.

type IntoIter = TgaIterator<'a>

Which kind of iterator are we turning this into?

impl<'a> Ord for Tga<'a>[src]

impl<'a> PartialEq<Tga<'a>> for Tga<'a>[src]

impl<'a> PartialOrd<Tga<'a>> for Tga<'a>[src]

impl<'a> StructuralEq for Tga<'a>[src]

impl<'a> StructuralPartialEq for Tga<'a>[src]

Auto Trait Implementations

impl<'a> Send for Tga<'a>

impl<'a> Sync for Tga<'a>

impl<'a> Unpin for Tga<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.