Skip to content

Commit

Permalink
Added offsets to SubImage to compensate for the now-deprecated bounds…
Browse files Browse the repository at this point in the history
… call from GenericImageView. (#2126)
  • Loading branch information
brykgroup-andrews authored Feb 20, 2024
1 parent 495fc75 commit 0fbf449
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,11 @@ impl<I> SubImage<I> {
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<DerefPixel<I>, Vec<DerefSubpixel<I>>>
where
Expand Down

0 comments on commit 0fbf449

Please sign in to comment.