From 0fbf44922d6f985a7cd65f47a4a54cdf23251f5c Mon Sep 17 00:00:00 2001 From: brykgroup-andrews <153681020+brykgroup-andrews@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:28:53 +1100 Subject: [PATCH] Added offsets to SubImage to compensate for the now-deprecated bounds call from GenericImageView. (#2126) --- src/image.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/image.rs b/src/image.rs index 738ad41258..3fa81092d5 100644 --- a/src/image.rs +++ b/src/image.rs @@ -1301,6 +1301,11 @@ impl SubImage { self.inner.ystride = height; } + /// The offsets of this subimage relative to the underlying image. + pub fn offsets(&self) -> (u32, u32) { + (self.inner.xoffset, self.inner.yoffset) + } + /// Convert this subimage to an ImageBuffer pub fn to_image(&self) -> ImageBuffer, Vec>> where