Struct Texture

Source
pub struct Texture { /* private fields */ }
Available on crate feature tex only.
Expand description

A texture and associated metadata.

Implementations§

Source§

impl Texture

Source

pub fn data(&self) -> &Vec<u8>

Byte array of pixel data.

Source§

impl Texture

Source

pub fn format(&self) -> Format

Pixel data format.

Source

pub fn width(&self) -> u16

Width in pixels.

Source

pub fn height(&self) -> u16

Height in pixels.

Source

pub fn depth(&self) -> u16

Depth. Unknown interpretation.

Source

pub fn mip_levels(&self) -> u16

Mipmap level count.

Source§

impl Texture

Source

pub fn dimension(&self) -> Dimension

Dimension kind.

Trait Implementations§

Source§

impl BinRead for Texture

Source§

type Args = ()

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_options: &ReadOptions, __binrw_generated_var_arguments: Self::Args, ) -> BinResult<Self>

Read Self from the reader using the given ReadOptions and arguments.
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args: Default,

Read Self from the reader using default arguments.
Source§

fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader using the given arguments.
Source§

fn after_parse<R>( &mut self, _: &mut R, _: &ReadOptions, _: Self::Args, ) -> Result<(), Error>
where R: Read + Seek,

Runs any post-processing steps required to finalize construction of the object.
Source§

impl Debug for Texture

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl File for Texture

Source§

fn read<'a>(data: impl Into<Cow<'a, [u8]>>) -> Result<Self, Error>

Build an instance of this file from the raw byte representation.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.