Skip to content

Commit 0fbf449

Browse files
Added offsets to SubImage to compensate for the now-deprecated bounds call from GenericImageView. (#2126)
1 parent 495fc75 commit 0fbf449

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/image.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,11 @@ impl<I> SubImage<I> {
13011301
self.inner.ystride = height;
13021302
}
13031303

1304+
/// The offsets of this subimage relative to the underlying image.
1305+
pub fn offsets(&self) -> (u32, u32) {
1306+
(self.inner.xoffset, self.inner.yoffset)
1307+
}
1308+
13041309
/// Convert this subimage to an ImageBuffer
13051310
pub fn to_image(&self) -> ImageBuffer<DerefPixel<I>, Vec<DerefSubpixel<I>>>
13061311
where

0 commit comments

Comments
 (0)