diff options
author | 2023-11-11 21:40:07 +0100 | |
---|---|---|
committer | 2023-11-11 21:40:07 +0100 | |
commit | 178521e8121d6f54dbaf2d0dbeb3892f7555b96a (patch) | |
tree | 92e09caf7fe952a54513424027c7935ec1d9cbed /core | |
parent | ef015a5e72802c059784e74d611f351df75403c0 (diff) | |
parent | 9d560c813566ba04be3e23ae1b14861365485b57 (diff) | |
download | iced-178521e8121d6f54dbaf2d0dbeb3892f7555b96a.tar.gz iced-178521e8121d6f54dbaf2d0dbeb3892f7555b96a.tar.bz2 iced-178521e8121d6f54dbaf2d0dbeb3892f7555b96a.zip |
Merge pull request #1894 from Remmirad/texture_filtering
Add texture filtering options
Diffstat (limited to '')
-rw-r--r-- | core/src/image.rs | 17 |
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, + ); } |