[−][src]Struct romy::Image
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 pixelsheight
- 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 pixelsheight
- the number of vertical pixelsdata
- slice of existing data.
pub fn get_pixel(&self, x: i32, y: i32) -> Color
[src]
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 coordinatey
- vertical coordinatecolor
- 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]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Image, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Image, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl ImageEngine for Image
[src]
fn is_inside(&self, x: i32, y: i32) -> bool
[src]
fn blit(&mut self, x: i32, y: i32, image: &Image)
[src]
impl Serialize for Image
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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]
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
U: FromSample<T>,
fn to_sample_(self) -> U
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>,