Struct ddsfile::Header

source ·
pub struct Header {
    pub height: u32,
    pub width: u32,
    pub pitch: Option<u32>,
    pub linear_size: Option<u32>,
    pub depth: Option<u32>,
    pub mip_map_count: Option<u32>,
    pub spf: PixelFormat,
    pub caps: Caps,
    pub caps2: Caps2,
    /* private fields */
}

Fields§

§height: u32

Surface height (in pixels)

§width: u32

Surface width (in pixels)

§pitch: Option<u32>

The pitch or number of bytes per scan line in an uncompressed texture;

§linear_size: Option<u32>

The total number of bytes in a top level texture for a compressed texture

§depth: Option<u32>

Depth of a volume texture (in pixels)

§mip_map_count: Option<u32>

Number of mipmap levels

§spf: PixelFormat

The pixel format

§caps: Caps

Specifies the complexity of the surfaces stored.

§caps2: Caps2

Additional detail about the surfaces stored

Implementations§

source§

impl Header

source

pub fn new_d3d( height: u32, width: u32, depth: Option<u32>, format: D3DFormat, mipmap_levels: Option<u32>, caps2: Option<Caps2> ) -> Result<Header, Error>

source

pub fn new_dxgi( height: u32, width: u32, depth: Option<u32>, format: DxgiFormat, mipmap_levels: Option<u32>, array_layers: Option<u32>, caps2: Option<Caps2> ) -> Result<Header, Error>

source

pub fn read<R: Read>(r: R) -> Result<Header, Error>

source

pub fn write<W: Write>(&self, w: &mut W) -> Result<(), Error>

Trait Implementations§

source§

impl Clone for Header

source§

fn clone(&self) -> Header

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
source§

impl Debug for Header

source§

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

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

impl Default for Header

source§

fn default() -> Header

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.