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