Enum Region

Source
#[non_exhaustive]
pub enum Region { Point(PointRegion), Rectangle(RectangleRegion), Ellipse(EllipseRegion), Polygon(PolygonRegion), Polyline(PolylineRegion), ReferencedMask(ReferencedMaskRegion), InlineMask(InlineMaskRegion), }
Available on crate feature v1_18 only.

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.
§

Point(PointRegion)

Point geometry.

The region is represented by a single point.

§

Rectangle(RectangleRegion)

Rectangle geometry.

The region is represented by a top left position, and a size defined by a width and height. All the interior points and the edge are part of the region.

§

Ellipse(EllipseRegion)

Ellipse geometry.

The region is represented by a center point, and radii in the X and Y directions. All the interior points and the edge are part of the region.

§

Polygon(PolygonRegion)

Polygon geometry.

The region is represented by a sequence of points, which is considered implicitly closed. All the interior points and the edge are part of the region.

§

Polyline(PolylineRegion)

Polyline geometry.

The region is represented by a sequence of points, which are not considered to form a closed surface. Only the edge is part of the region.

§

ReferencedMask(ReferencedMaskRegion)

Referenced mask.

The mask location is represented by a left-top corner position, and a size defined by a width and height. The value of each sample in that mask identifies whether the corresponding pixel is part of the region.

The region geometry is described by the pixels in another image item, which has an item reference of type mask from the region item to the image item containing the mask.

The image item containing the mask is one of:

  • a mask item (see ISO/IEC 23008-12:2022 Section 6.10.2), or a derived image from a mask item;
  • an image item in monochrome format (4:0:0 chroma);
  • an image item in format of color with luma and chroma planes (e.g. 4:2:0).

If the pixel value is equal to the minimum sample value (e.g. 0 for unsigned integer), the pixel is not part of the region. If the pixel value is equal to the maximum sample value (e.g. 255 for 8 bit unsigned integer), the pixel is part of the region. If the pixel value is between the minimum sample value and maximum sample value, the pixel value represents an (application defined) probability that the pixel is part of the region, where higher pixel values correspond to higher probability values.

§

InlineMask(InlineMaskRegion)

Inline mask.

The region geometry is described by a sequence of bits stored in inline in the region, one bit per pixel. If the bit value is 1, the pixel is part of the region. If the bit value is 0, the pixel is not part of the region.

Trait Implementations§

Source§

impl Drop for Region

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Region

§

impl RefUnwindSafe for Region

§

impl !Send for Region

§

impl !Sync for Region

§

impl Unpin for Region

§

impl UnwindSafe for Region

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.