Trait texture_packer::texture::Texture
source · pub trait Texture {
type Pixel: Pixel;
// Required methods
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);
// Provided methods
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 { ... }
}
Expand description
Describes a texture type.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel>
fn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel>
Get the pixel if it were transformed by a rotation.
sourcefn is_column_transparent(&self, col: u32) -> bool
fn is_column_transparent(&self, col: u32) -> bool
Check if a column of the texture is transparent.
sourcefn is_row_transparent(&self, row: u32) -> bool
fn is_row_transparent(&self, row: u32) -> bool
Check if a row of the texture is transparent.
Trait Implementations§
source§impl<P: Pixel> Texture for Box<dyn Texture<Pixel = P> + 'static>
impl<P: Pixel> Texture for Box<dyn Texture<Pixel = P> + 'static>
source§fn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel>
fn get_rotated(&self, x: u32, y: u32) -> Option<Self::Pixel>
Get the pixel if it were transformed by a rotation.
source§fn is_column_transparent(&self, col: u32) -> bool
fn is_column_transparent(&self, col: u32) -> bool
Check if a column of the texture is transparent.
source§fn is_row_transparent(&self, row: u32) -> bool
fn is_row_transparent(&self, row: u32) -> bool
Check if a row of the texture is transparent.