[][src]Struct tinytga::Tga

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

TGA image

Fields

header: TgaHeader

TGA header

footer: TgaFooter

TGA footer (last 26 bytes of file)

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

TGA images are encoded as packets, either [RawPacket]s or [RlePacket]s

Trait Implementations

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

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

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

type Item = u32

The type of the elements being iterated over.

type IntoIter = TgaIterator<'a>

Which kind of iterator are we turning this into?

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

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

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

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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