Struct gfx::device::tex::TextureInfo [] [src]

pub struct TextureInfo {
    pub width: Size,
    pub height: Size,
    pub depth: Size,
    pub levels: u8,
    pub kind: TextureKind,
    pub format: Format,
}

Describes the storage of a texture.

Portability note

Textures larger than 1024px in any dimension are unlikely to be supported by mobile platforms.

Fields

width
height
depth
levels

Number of mipmap levels. Defaults to -1, which stands for unlimited. Mipmap levels at equal or above levels can not be loaded or sampled by the shader. width and height of each consecutive mipmap level is halved, starting from level 0.

kind
format

Methods

impl TextureInfo

fn new() -> TextureInfo

Create a new empty texture info.

fn to_image_info(&self) -> ImageInfo

Convert to a default ImageInfo that could be used to update the contents of the whole texture.

fn to_surface_info(&self) -> SurfaceInfo

Convert to a SurfaceInfo, used as a common denominator between surfaces and textures.

fn contains(&self, img: &ImageInfo) -> bool

Check if given ImageInfo is a part of the texture.

Trait Implementations

impl Default for TextureInfo

fn default() -> TextureInfo

Derived Implementations

impl Debug for TextureInfo

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for TextureInfo

fn clone(&self) -> TextureInfo

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

impl Copy for TextureInfo

impl Hash for TextureInfo

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl PartialOrd for TextureInfo

fn partial_cmp(&self, __arg_0: &TextureInfo) -> Option<Ordering>

fn lt(&self, __arg_0: &TextureInfo) -> bool

fn le(&self, __arg_0: &TextureInfo) -> bool

fn gt(&self, __arg_0: &TextureInfo) -> bool

fn ge(&self, __arg_0: &TextureInfo) -> bool

impl PartialEq for TextureInfo

fn eq(&self, __arg_0: &TextureInfo) -> bool

fn ne(&self, __arg_0: &TextureInfo) -> bool

impl Ord for TextureInfo

fn cmp(&self, __arg_0: &TextureInfo) -> Ordering

impl Eq for TextureInfo