summaryrefslogtreecommitdiffstats
path: root/core/src/image.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
commit1781068e1c3a65551db1e832fdbaddba99124051 (patch)
tree60e0b3854cc0541712572fbb0e56f14435951ea9 /core/src/image.rs
parent41dec5bd203ff5b1574a33a17d5f7358ae1beea2 (diff)
parent7ae7fcb89855002519bab752fd3686106ce448db (diff)
downloadiced-1781068e1c3a65551db1e832fdbaddba99124051.tar.gz
iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.bz2
iced-1781068e1c3a65551db1e832fdbaddba99124051.zip
Merge branch 'master' into remove-vertex-indexing
Diffstat (limited to 'core/src/image.rs')
-rw-r--r--core/src/image.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/src/image.rs b/core/src/image.rs
index 85d9d475..e9675316 100644
--- a/core/src/image.rs
+++ b/core/src/image.rs
@@ -164,6 +164,16 @@ impl std::fmt::Debug for Data {
}
}
+/// Image filtering strategy.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
+pub enum FilterMethod {
+ /// Bilinear interpolation.
+ #[default]
+ Linear,
+ /// Nearest neighbor.
+ Nearest,
+}
+
/// A [`Renderer`] that can render raster graphics.
///
/// [renderer]: crate::renderer
@@ -178,5 +188,10 @@ pub trait Renderer: crate::Renderer {
/// Draws an image with the given [`Handle`] and inside the provided
/// `bounds`.
- fn draw(&mut self, handle: Self::Handle, bounds: Rectangle);
+ fn draw(
+ &mut self,
+ handle: Self::Handle,
+ filter_method: FilterMethod,
+ bounds: Rectangle,
+ );
}