Struct TgaEncoder

pub struct TgaEncoder<W: Write> { /* private fields */ }

TGA encoder.

Implementations

impl<W: Write> TgaEncoder<W>

fn new(w: W) -> TgaEncoder<W>

Create a new encoder that writes its output to w.

fn disable_rle(self) -> TgaEncoder<W>

Disables run-length encoding

fn encode(self, buf: &[u8], width: u32, height: u32, color_type: ExtendedColorType) -> ImageResult<()>

Encodes the image buf that has dimensions width and height and ColorType color_type.

The dimensions of the image must be between 0 and 65535 (inclusive) or an error will be returned.

Panics

Panics if width * height * color_type.bytes_per_pixel() != data.len().

Trait Implementations

impl<W: Write> ImageEncoder for TgaEncoder<W>

fn write_image(self, buf: &[u8], width: u32, height: u32, color_type: ExtendedColorType) -> ImageResult<()>

Auto Trait Implementations

impl<W> Freeze for TgaEncoder<W> where W: Freeze,

impl<W> RefUnwindSafe for TgaEncoder<W> where W: RefUnwindSafe,

impl<W> Send for TgaEncoder<W> where W: Send,

impl<W> Sync for TgaEncoder<W> where W: Sync,

impl<W> Unpin for TgaEncoder<W> where W: Unpin,

impl<W> UnsafeUnpin for TgaEncoder<W> where W: UnsafeUnpin,

impl<W> UnwindSafe for TgaEncoder<W> where W: UnwindSafe,

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for TgaEncoder<W> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for TgaEncoder<W> where ST: ?Sized, DT: ?Sized,

impl<T> Any for TgaEncoder<W> where T: 'static + ?Sized,

impl<T> Borrow<T> for TgaEncoder<W> where T: ?Sized,

impl<T> BorrowMut<T> for TgaEncoder<W> where T: ?Sized,

impl<T> From<T> for TgaEncoder<W>

impl<T> IntoEither for TgaEncoder<W>

impl<T> Pointable for TgaEncoder<W>

impl<T> Read<Exclusive, BecauseExclusive> for TgaEncoder<W> where T: ?Sized,

impl<T, U> Into<U> for TgaEncoder<W> where U: From<T>,

impl<T, U> TryFrom<U> for TgaEncoder<W> where U: Into<T>,

impl<T, U> TryInto<U> for TgaEncoder<W> where U: TryFrom<T>,