Struct rin::gl::texture::DataFormat[][src]

pub struct DataFormat {
    pub width: u32,
    pub height: u32,
    pub depth: u32,
    pub format: u32,
    pub ty: u32,
    pub level: u32,
    pub xoffset: i32,
    pub yoffset: i32,
    pub zoffset: i32,
}

Used to upload data to a Texture

DataFormat implements Default so when uploading data to a texture where the data and the texture ahve the same size, format and type and the data is going to be uploaded to level 0 a Default DataFormat can be used by calling Default::default() or DataFormat::default()

If some fields are not the same the rest can be defaulted by using ..Default::default() as in

use glin::texture::DataFormat;
texture.load_data(&data, DataFormat{
   width: 20,
   height: 20,
   xoffset: 20,
   yoffset: 20,
   level: 1,
   ..Default::default()
});

Fields

width: u32height: u32depth: u32format: u32ty: u32level: u32xoffset: i32yoffset: i32zoffset: i32

Implementations

impl DataFormat[src]

pub fn bytes(&self) -> Result<usize, Error>[src]

pub fn fill_defaults_from(&mut self, tex: &Texture) -> Result<(), Error>[src]

pub fn default_from(texture: &Texture) -> Result<DataFormat, Error>[src]

Trait Implementations

impl Clone for DataFormat[src]

impl Debug for DataFormat[src]

impl Default for DataFormat[src]

impl Hash for DataFormat[src]

impl PartialEq<DataFormat> for DataFormat[src]

impl TryFrom<Format> for DataFormat[src]

type Error = Error

The type returned in the event of a conversion error.

impl Eq for DataFormat[src]

impl StructuralEq for DataFormat[src]

impl StructuralPartialEq for DataFormat[src]

Auto Trait Implementations

impl RefUnwindSafe for DataFormat

impl Send for DataFormat

impl Sync for DataFormat

impl Unpin for DataFormat

impl UnwindSafe for DataFormat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]