[][src]Struct graphics_buffer::RenderBuffer

pub struct RenderBuffer { /* fields omitted */ }

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

Enabling the piston_window_texture feature exposes a function called to_g2d_texture, with the following signature:

This example is not tested
pub fn to_g2d_texture(
    &self,
    context: &mut G2dTextureContext,
    settings: &TextureSettings,
) -> Result<G2dTexture, Box<dyn std::error::Error>>;

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]

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

impl From<DynamicImage> for RenderBuffer[src]

impl Deref for RenderBuffer[src]

type Target = RgbaImage

The resulting type after dereferencing.

impl Debug for RenderBuffer[src]

impl Graphics for RenderBuffer[src]

type Texture = RenderBuffer

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

impl ImageSize for RenderBuffer[src]

impl UpdateTexture<()> for RenderBuffer[src]

impl CreateTexture<()> for RenderBuffer[src]

impl TextureOp<()> for RenderBuffer[src]

type Error = Error

The error when performing an operation.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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

impl<T> SetParameter for T