[−][src]Struct cat_engine::image::Texture
Обёртка для 2D текстуры. Wrapper for 2D texture.
Implementations
impl Texture
[src]
pub fn create<S: Into<[u32; 2]>>(
memory: &[u8],
size: S,
factory: &Display
) -> TextureCreationResult
[src]
memory: &[u8],
size: S,
factory: &Display
) -> TextureCreationResult
Создаёт текстуру из массива байт.
Creates a texture from byte array.
pub fn from_path<P: AsRef<Path>>(
path: P,
factory: &Display
) -> TextureCreationResult
[src]
path: P,
factory: &Display
) -> TextureCreationResult
Загружает текстуру из файла.
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,