[][src]Struct graphics_buffer::RenderBuffer

pub struct RenderBuffer { /* fields omitted */ }

A buffer that can be rendered to with Piston's graphics library.

Methods

impl RenderBuffer[src]

pub fn new(width: u32, height: u32) -> RenderBuffer[src]

Create a new RenderBuffer with the given witdth or height.

pub fn open<P: AsRef<Path>>(path: P) -> Result<RenderBuffer, Box<dyn Error>>[src]

Creates a new RenderBuffer by opening it from a file.

pub fn decode_from_bytes(bytes: &[u8]) -> ImageResult<RenderBuffer>[src]

Creates a new RenderBuffer by decoding image data.

pub fn clear(&mut self, color: [f32; 4])[src]

Clear the buffer with a color.

pub fn pixel(&self, x: u32, y: u32) -> [f32; 4][src]

Returns the color of the pixel at the given coordinates.

pub fn set_pixel(&mut self, x: u32, y: u32, color: [f32; 4])[src]

Sets the color of the pixel at the given coordinates.

Trait Implementations

impl Clone for RenderBuffer[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<ImageBuffer<Rgba<u8>, Vec<u8>>> for RenderBuffer[src]

impl From<DynamicImage> for RenderBuffer[src]

impl Debug for RenderBuffer[src]

impl Deref for RenderBuffer[src]

type Target = RgbaImage

The resulting type after dereferencing.

impl Graphics for RenderBuffer[src]

type Texture = RenderBuffer

The texture type associated with the back-end. Read more

default fn rectangle<R>(
    &mut self,
    r: &Rectangle,
    rectangle: R,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
) where
    R: Into<[f64; 4]>, 

Draws a rectangle. Read more

default fn polygon(
    &mut self,
    p: &Polygon,
    polygon: &[[f64; 2]],
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
)

Draws a polygon. Read more

default fn polygon_tween_lerp(
    &mut self,
    p: &Polygon,
    polygons: &[&[[f64; 2]]],
    tween_factor: f64,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
)

Draws a tweened polygon using linear interpolation. Read more

default fn image(
    &mut self,
    image: &Image,
    texture: &Self::Texture,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
)

Draws image. Read more

default fn ellipse<R>(
    &mut self,
    e: &Ellipse,
    rectangle: R,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
) where
    R: Into<[f64; 4]>, 

Draws ellipse. Read more

default fn line<L>(
    &mut self,
    l: &Line,
    line: L,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
) where
    L: Into<[f64; 4]>, 

Draws line. Read more

default fn circle_arc<R>(
    &mut self,
    c: &CircleArc,
    rectangle: R,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
) where
    R: Into<[f64; 4]>, 

Draws circle arc. Read more

default fn deform_image(
    &mut self,
    d: &DeformGrid,
    texture: &Self::Texture,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2]
)

Draws deformed image. Read more

impl ImageSize for RenderBuffer[src]

default fn get_width(&self) -> u32

Gets the image width.

default fn get_height(&self) -> u32

Gets the image height.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> SetParameter for T

default fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.