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,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoEither for TgaEncoder<W>

impl<T> Pointable for TgaEncoder<W>

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

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

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>