[−][src]Struct graphics_buffer::RenderBuffer
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) -> ImageResult<RenderBuffer>
[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 From<ImageBuffer<Rgba<u8>, Vec<u8>>> for RenderBuffer
[src]
impl From<DynamicImage> for RenderBuffer
[src]
fn from(image: DynamicImage) -> Self
[src]
impl Clone for RenderBuffer
[src]
fn clone(&self) -> RenderBuffer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for RenderBuffer
[src]
impl Deref for RenderBuffer
[src]
type Target = RgbaImage
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl Graphics for RenderBuffer
[src]
type Texture = RenderBuffer
The texture type associated with the back-end. Read more
fn clear_color(&mut self, color: Color)
[src]
fn clear_stencil(&mut self, _value: u8)
[src]
fn tri_list<F>(&mut self, _draw_state: &DrawState, color: &[f32; 4], f: F) where
F: FnMut(&mut dyn FnMut(&[[f32; 2]])),
[src]
F: FnMut(&mut dyn FnMut(&[[f32; 2]])),
fn tri_list_uv<F>(
&mut self,
_draw_state: &DrawState,
color: &[f32; 4],
texture: &Self::Texture,
f: F
) where
F: FnMut(&mut dyn FnMut(&[[f32; 2]], &[[f32; 2]])),
[src]
&mut self,
_draw_state: &DrawState,
color: &[f32; 4],
texture: &Self::Texture,
f: F
) where
F: FnMut(&mut dyn FnMut(&[[f32; 2]], &[[f32; 2]])),
fn rectangle<R>(
&mut self,
r: &Rectangle,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
) where
R: Into<[f64; 4]>,
&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]
)
&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]
)
&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]
)
&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]>,
&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]>,
&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]>,
&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]
)
&mut self,
d: &DeformGrid,
texture: &Self::Texture,
draw_state: &DrawState,
transform: [[f64; 3]; 2]
)
Draws deformed image. Read more
impl ImageSize for RenderBuffer
[src]
Auto Trait Implementations
impl Send for RenderBuffer
impl Sync for RenderBuffer
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.