Trait DrawRenderer
pub trait DrawRenderer {
Show 29 methods
// Required methods
fn pixel<C>(&self, x: i16, y: i16, color: C) -> Result<(), String> ⓘ
where C: ToColor;
fn hline<C>(&self, x1: i16, x2: i16, y: i16, color: C) -> Result<(), String> ⓘ
where C: ToColor;
fn vline<C>(&self, x: i16, y1: i16, y2: i16, color: C) -> Result<(), String> ⓘ
where C: ToColor;
fn rectangle<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn rounded_rectangle<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn box_<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn rounded_box<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn aa_line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn thick_line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
width: u8,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn circle<C>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn aa_circle<C>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn filled_circle<C>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn arc<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn aa_ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn filled_ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn pie<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn filled_pie<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn aa_trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn filled_trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn polygon<C>(&self, vx: &[i16], vy: &[i16], color: C) -> Result<(), String> ⓘ
where C: ToColor;
fn aa_polygon<C>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn filled_polygon<C>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn textured_polygon<C>(
&self,
vx: &[i16],
vy: &[i16],
texture: &Surface<'_>,
texture_dx: i16,
texture_dy: i16,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn bezier<C>(
&self,
vx: &[i16],
vy: &[i16],
s: i32,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn character<C>(
&self,
x: i16,
y: i16,
c: char,
color: C,
) -> Result<(), String> ⓘ
where C: ToColor;
fn string<C>(&self, x: i16, y: i16, s: &str, color: C) -> Result<(), String> ⓘ
where C: ToColor;
}
Available on crate feature
dep_sdl2
only.Expand description
For drawing with rust-sdl2 Renderer
Required Methods§
fn pixel<C>(&self, x: i16, y: i16, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn hline<C>(&self, x1: i16, x2: i16, y: i16, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn vline<C>(&self, x: i16, y1: i16, y2: i16, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn rectangle<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn rounded_rectangle<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn box_<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn rounded_box<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn aa_line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn thick_line<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
width: u8,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn circle<C>(&self, x: i16, y: i16, rad: i16, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn aa_circle<C>(&self, x: i16, y: i16, rad: i16, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn filled_circle<C>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn arc<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn aa_ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn filled_ellipse<C>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn pie<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn filled_pie<C>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn aa_trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn filled_trigon<C>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn polygon<C>(&self, vx: &[i16], vy: &[i16], color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn aa_polygon<C>(&self, vx: &[i16], vy: &[i16], color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn filled_polygon<C>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn textured_polygon<C>(
&self,
vx: &[i16],
vy: &[i16],
texture: &Surface<'_>,
texture_dx: i16,
texture_dy: i16,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn bezier<C>(
&self,
vx: &[i16],
vy: &[i16],
s: i32,
color: C,
) -> Result<(), String> ⓘwhere
C: ToColor,
fn character<C>(&self, x: i16, y: i16, c: char, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
fn string<C>(&self, x: i16, y: i16, s: &str, color: C) -> Result<(), String> ⓘwhere
C: ToColor,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.