#[non_exhaustive]pub enum Region {
Whole,
Window(Window),
Tile(u32),
}Expand description
The area of the image a decode returns, for DecodeOptions::region.
It selects the decode area. It is not the JPEG 2000 region of interest
(RGN), which the decoder applies on its own.
One value holds the choice, so a window and a tile cannot be asked for
together. The enum is #[non_exhaustive], so a new kind of area is not a
breaking change.
use rust_j2k::{DecodeOptions, Region, Window};
assert_eq!(Region::default(), Region::Whole);
let options = DecodeOptions::default().with_region(Region::Window(Window::new(0, 0, 8, 8)));
assert_eq!(options.region, Region::Window(Window::new(0, 0, 8, 8)));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Whole
The whole image. This is the default.
Window(Window)
A rectangle of the reference grid, cut to the image area.
Tile(u32)
Trait Implementations§
impl Eq for Region
impl StructuralPartialEq for Region
Auto Trait Implementations§
impl Forget for Region
impl Freeze for Region
impl Move for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more