[][src]Struct cat_engine::image::Texture

pub struct Texture(pub SrgbTexture2d);

Обёртка для 2D текстуры. Wrapper for 2D texture.

Implementations

impl Texture[src]

pub fn create<S: Into<[u32; 2]>>(
    memory: &[u8],
    size: S,
    factory: &Display
) -> TextureCreationResult
[src]

Создаёт текстуру из массива байт.

Creates a texture from byte array.

pub fn from_path<P: AsRef<Path>>(
    path: P,
    factory: &Display
) -> TextureCreationResult
[src]

Загружает текстуру из файла.

Loading a texture from file.

pub fn from_image(img: &RgbaImage, factory: &Display) -> TextureCreationResult[src]

Создаёт текстуру из изображения.

Creates a texture from given image.

pub fn update(&mut self, img: &RgbaImage)[src]

Обновляет изображение текстуры, сохраняя размеры. При не совпадающих размераx возникают ошибки.

Updates the texture with the new image. If the sizes aren't equal something bad can happen :)

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

Возвращает ширину изображения.

Returns the width of the image.

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

Возвращает высоту изображения.

Returns the height of the image.

pub fn dimensions(&self) -> (u32, u32)[src]

Возвращает ширину и высоту изображения.

Returns the width and height of the image.

Auto Trait Implementations

impl !RefUnwindSafe for Texture

impl !Send for Texture

impl !Sync for Texture

impl Unpin for Texture

impl !UnwindSafe for Texture

Blanket Implementations

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

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

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

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

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

impl<T> SetParameter for T

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.