[][src]Struct romy::Image

pub struct Image { /* fields omitted */ }

An image that can be displayed by the runtime.

Internally stores data as an array of 32 bit RGBA values.

Methods

impl Image[src]

pub fn new(width: i32, height: i32, color: Color) -> Image[src]

Create a blank image

Arguments

  • width - the number of horizontal pixels
  • height - the number of vertical pixels.
  • color - the initial color of all pixels in the image.

pub fn from_data(width: i32, height: i32, data: &[u8]) -> Image[src]

Create an image from a slice of existing data

Arguments

  • width - the number of horizontal pixels
  • height - the number of vertical pixels
  • data - slice of existing data.

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

Gets a pixel in the image

Arguments

  • x - horizontal coordinate
  • y - vertical coordinate

pub fn set_pixel(&mut self, x: i32, y: i32, color: Color)[src]

Sets a pixel in the image to a specified color

Arguments

  • x - horizontal coordinate
  • y - vertical coordinate
  • color - color to set the pixel to

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

Gets the number of horizontal pixels

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

Gets the number of vertical pixels

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

Gets a reference to the raw pixel buffer

pub fn pixels8(&self) -> &[u8][src]

Gets a reference to the raw pixel as u8s

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

Gets a mutable reference to the raw pixel buffer

pub fn pixels8_mut(&mut self) -> &mut [u8][src]

Gets a mutable reference to the raw pixel buffer as u8s

Trait Implementations

impl Clone for Image[src]

impl Debug for Image[src]

impl<'de> Deserialize<'de> for Image[src]

impl ImageEngine for Image[src]

impl Serialize for Image[src]

Auto Trait Implementations

impl RefUnwindSafe for Image

impl Send for Image

impl Sync for Image

impl Unpin for Image

impl UnwindSafe for Image

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 

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

impl<S> FromSample<S> for S

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

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> ToSample<U> for T where
    U: FromSample<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.