Refactor texture image filtering

- Support only `Linear` or `Nearest`
- Simplify `Layer` groups
- Move `FilterMethod` to `Image` and `image::Viewer`
This commit is contained in:
Héctor Ramón Jiménez 2023-11-11 07:02:01 +01:00
parent 75c9afc608
commit a5125d6fea
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
12 changed files with 250 additions and 160 deletions

View file

@ -68,6 +68,8 @@ pub enum Primitive<T> {
Image {
/// The handle of the image
handle: image::Handle,
/// The filter method of the image
filter_method: image::FilterMethod,
/// The bounds of the image
bounds: Rectangle,
},

View file

@ -215,8 +215,17 @@ where
self.backend().dimensions(handle)
}
fn draw(&mut self, handle: image::Handle, bounds: Rectangle) {
self.primitives.push(Primitive::Image { handle, bounds });
fn draw(
&mut self,
handle: image::Handle,
filter_method: image::FilterMethod,
bounds: Rectangle,
) {
self.primitives.push(Primitive::Image {
handle,
filter_method,
bounds,
});
}
}