Struct polystrip::Texture[][src]

pub struct Texture { /* fields omitted */ }

A texture which can be copied to and rendered by a Frame.

It can be used only with the Renderer which created it.

Implementations

impl Texture[src]

pub fn new_from_rgba(
    context: &impl HasRenderer,
    data: &[u8],
    size: (u32, u32)
) -> Texture
[src]

Create a new texture from the given rgba data, associated with this Renderer.

Arguments

  • data: A reference to a byte array containing the pixel data. The data must be formatted to Rgba8 in the sRGB color space, in row-major order.
  • size: The size of the texture, in pixels, in (width, height) order.

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

Get the dimensions of this texture, in (width, height) order.

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

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

pub fn get_data(&self) -> Box<[u8]>[src]

pub fn pixel(&self, x: i32, y: i32) -> Vector2[src]

Converts pixel coordinates to texture space coordinates

Trait Implementations

impl Drop for Texture[src]

impl HasRenderer for Texture[src]

impl<'a> RenderTarget<'a> for Texture[src]

type FrameDrop = TextureFrame<'a>

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, 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.