Trait texture_packer::texture::Texture[][src]

pub trait Texture {
    type Pixel: Pixel;
    fn width(&self) -> u32;
fn height(&self) -> u32;
fn get(&self, x: u32, y: u32) -> Option<Self::Pixel>;
fn set(&mut self, x: u32, y: u32, val: Self::Pixel); fn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel> { ... }
fn is_column_transparent(&self, col: u32) -> bool { ... }
fn is_row_transparent(&self, row: u32) -> bool { ... } }

Describes a texture type.

Associated Types

type Pixel: Pixel[src]

Pixel type of this texture.

Loading content...

Required methods

fn width(&self) -> u32[src]

Get the width of this texture.

fn height(&self) -> u32[src]

Get the height of this texture.

fn get(&self, x: u32, y: u32) -> Option<Self::Pixel>[src]

Get the pixel value at a specific coordinate.

fn set(&mut self, x: u32, y: u32, val: Self::Pixel)[src]

Set the pixel value at a specific coordinate.

Loading content...

Provided methods

fn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel>[src]

Get the pixel if it were transformed by a rotation.

fn is_column_transparent(&self, col: u32) -> bool[src]

Check if a column of the texture is transparent.

fn is_row_transparent(&self, row: u32) -> bool[src]

Check if a row of the texture is transparent.

Loading content...

Implementations on Foreign Types

impl<P: Pixel> Texture for Box<dyn Texture<Pixel = P> + 'static>[src]

type Pixel = P

Loading content...

Implementors

impl Texture for MemoryRGBA8Texture[src]

type Pixel = RGBA8

impl<'a, Pix, T: Clone> Texture for TexturePacker<'a, T> where
    Pix: Pixel,
    T: Texture<Pixel = Pix>, 
[src]

type Pixel = Pix

impl<'a, T: Texture + Clone> Texture for SubTexture<'a, T>[src]

type Pixel = T::Pixel

impl<P: Pixel + Pixel, I: GenericImage<Pixel = P>> Texture for I[src]

type Pixel = I::Pixel

Loading content...