pub trait Renderer {
type Image;
fn set_size(&mut self, width: u32, height: u32, dpi: f32);
fn render(
&mut self,
images: &mut ImageStore<Self::Image>,
verts: &[Vertex],
commands: Vec<Command>
);
fn alloc_image(&mut self, info: ImageInfo) -> Result<Self::Image, ErrorKind>;
fn update_image(
&mut self,
image: &mut Self::Image,
data: ImageSource<'_>,
x: usize,
y: usize
) -> Result<(), ErrorKind>;
fn delete_image(&mut self, image: Self::Image, image_id: ImageId);
fn screenshot(&mut self) -> Result<ImgVec<RGBA8>, ErrorKind>;
}
Expand description
This is the main renderer trait that the Canvas draws to.