Struct polystrip::Texture [−][src]
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]
context: &impl HasRenderer,
data: &[u8],
size: (u32, u32)
) -> Texture
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 toRgba8
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]
fn clone_context(&self) -> Rc<Renderer>
[src]
impl<'a> RenderTarget<'a> for Texture
[src]
type FrameDrop = TextureFrame<'a>
fn create_frame(&'a mut self) -> Frame<'a, TextureFrame<'a>>
[src]
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,
pub 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, 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.
pub 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>,