Struct dds::Dds

source ·
pub struct Dds<S = Vec<u8>> { /* private fields */ }

Implementations§

source§

impl Dds

source

pub fn load<P: AsRef<Path>>(path: P) -> Result<Dds, Error>

source

pub fn from_bytes(bytes: &[u8]) -> Result<Dds, Error>

source§

impl<S: Borrow<[u8]>> Dds<S>

source

pub fn mipmap(&self, level: usize) -> Option<Dds<SliceOrVec<'_>>>

source

pub fn mipmap_face( &self, level: usize, face: usize ) -> Result<Dds<&[u8]>, Error>

source

pub fn face(&self, face: usize) -> Result<Dds<&[u8]>, Error>

source

pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>

source

pub fn data(&self) -> &[u8]

source§

impl<S> Dds<S>

source

pub fn width(&self) -> usize

source

pub fn height(&self) -> usize

source

pub fn mipmap_count(&self) -> usize

source

pub fn fourcc(&self) -> u32

source

pub fn fourcc_str(&self) -> String

source

pub fn bpp(&self) -> Result<usize, Error>

source

pub fn r_bitmask(&self) -> u32

source

pub fn g_bitmask(&self) -> u32

source

pub fn b_bitmask(&self) -> u32

source

pub fn a_bitmask(&self) -> u32

source

pub fn linear_size(&self) -> usize

source

pub fn pitch(&self) -> usize

source

pub fn is_compressed(&self) -> bool

source

pub fn format(&self) -> Result<DXGIFormat, Error>

source

pub fn is_cubemap(&self) -> bool

source

pub fn is_cubemap_allfaces(&self) -> bool

Trait Implementations§

source§

impl<S: Clone> Clone for Dds<S>

source§

fn clone(&self) -> Dds<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Dds<S>where S: RefUnwindSafe,

§

impl<S> Send for Dds<S>where S: Send,

§

impl<S> Sync for Dds<S>where S: Sync,

§

impl<S> Unpin for Dds<S>where S: Unpin,

§

impl<S> UnwindSafe for Dds<S>where S: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.