Struct graphics_buffer::RenderBuffer [−][src]
pub struct RenderBuffer { /* fields omitted */ }
A buffer that can be rendered to with Piston's graphics library.
Methods
impl RenderBuffer
[src]
impl RenderBuffer
pub fn new(width: u32, height: u32) -> RenderBuffer
[src]
pub fn new(width: u32, height: u32) -> RenderBuffer
Create a new RenderBuffer
with the given witdth or height.
pub fn open<P: AsRef<Path>>(path: P) -> ImageResult<RenderBuffer>
[src]
pub fn open<P: AsRef<Path>>(path: P) -> ImageResult<RenderBuffer>
Creates a new RenderBuffer
by opening it from a file.
pub fn decode_from_bytes(bytes: &[u8]) -> ImageResult<RenderBuffer>
[src]
pub fn decode_from_bytes(bytes: &[u8]) -> ImageResult<RenderBuffer>
Creates a new RenderBuffer
by decoding image data.
pub fn clear(&mut self, color: [f32; 4])
[src]
pub fn clear(&mut self, color: [f32; 4])
Clear the buffer with a color.
pub fn pixel(&self, x: u32, y: u32) -> [f32; 4]
[src]
pub fn pixel(&self, x: u32, y: u32) -> [f32; 4]
Returns the color of the pixel at the given coordinates.
pub fn set_pixel(&mut self, x: u32, y: u32, color: [f32; 4])
[src]
pub fn set_pixel(&mut self, x: u32, y: u32, color: [f32; 4])
Sets the color of the pixel at the given coordinates.
Trait Implementations
impl Debug for RenderBuffer
[src]
impl Debug for RenderBuffer
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for RenderBuffer
[src]
impl Clone for RenderBuffer
fn clone(&self) -> RenderBuffer
[src]
fn clone(&self) -> RenderBuffer
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl From<RgbaImage> for RenderBuffer
[src]
impl From<RgbaImage> for RenderBuffer
impl From<DynamicImage> for RenderBuffer
[src]
impl From<DynamicImage> for RenderBuffer
fn from(image: DynamicImage) -> Self
[src]
fn from(image: DynamicImage) -> Self
Performs the conversion.
impl Deref for RenderBuffer
[src]
impl Deref for RenderBuffer
type Target = RgbaImage
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl ImageSize for RenderBuffer
[src]
impl ImageSize for RenderBuffer
fn get_size(&self) -> (u32, u32)
[src]
fn get_size(&self) -> (u32, u32)
Get the image size.
fn get_width(&self) -> u32
fn get_width(&self) -> u32
Gets the image width.
fn get_height(&self) -> u32
fn get_height(&self) -> u32
Gets the image height.
impl Graphics for RenderBuffer
[src]
impl Graphics for RenderBuffer
type Texture = RenderBuffer
The texture type associated with the back-end. Read more
fn clear_color(&mut self, color: Color)
[src]
fn clear_color(&mut self, color: Color)
Clears background with a color. Read more
fn clear_stencil(&mut self, _value: u8)
[src]
fn clear_stencil(&mut self, _value: u8)
Clears stencil buffer with a value, usually 0. Read more
fn tri_list<F>(&mut self, _draw_state: &DrawState, color: &[f32; 4], f: F) where
F: FnMut(&mut FnMut(&[[f32; 2]])),
[src]
fn tri_list<F>(&mut self, _draw_state: &DrawState, color: &[f32; 4], f: F) where
F: FnMut(&mut FnMut(&[[f32; 2]])),
Renders list of 2d triangles using a solid color. Read more
fn tri_list_uv<F>(
&mut self,
_draw_state: &DrawState,
color: &[f32; 4],
texture: &Self::Texture,
f: F
) where
F: FnMut(&mut FnMut(&[[f32; 2]], &[[f32; 2]])),
[src]
fn tri_list_uv<F>(
&mut self,
_draw_state: &DrawState,
color: &[f32; 4],
texture: &Self::Texture,
f: F
) where
F: FnMut(&mut FnMut(&[[f32; 2]], &[[f32; 2]])),
Renders list of 2d triangles using a color and a texture. Read more
fn rectangle<R>(
&mut self,
r: &Rectangle,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
) where
R: Into<[f64; 4]>,
[src]
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
fn polygon(
&mut self,
p: &Polygon,
polygon: &[[f64; 2]],
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
[src]
fn polygon(
&mut self,
p: &Polygon,
polygon: &[[f64; 2]],
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
Draws a polygon. Read more
fn polygon_tween_lerp(
&mut self,
p: &Polygon,
polygons: &[&[[f64; 2]]],
tween_factor: f64,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
[src]
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
fn image(
&mut self,
image: &Image,
texture: &Self::Texture,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
[src]
fn image(
&mut self,
image: &Image,
texture: &Self::Texture,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
Draws image. Read more
fn ellipse<R>(
&mut self,
e: &Ellipse,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
) where
R: Into<[f64; 4]>,
[src]
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
fn line<L>(
&mut self,
l: &Line,
line: L,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
) where
L: Into<[f64; 4]>,
[src]
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
fn circle_arc<R>(
&mut self,
c: &CircleArc,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
) where
R: Into<[f64; 4]>,
[src]
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
fn deform_image(
&mut self,
d: &DeformGrid,
texture: &Self::Texture,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
[src]
fn deform_image(
&mut self,
d: &DeformGrid,
texture: &Self::Texture,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
Draws deformed image. Read more
Auto Trait Implementations
impl Send for RenderBuffer
impl Send for RenderBuffer
impl Sync for RenderBuffer
impl Sync for RenderBuffer