#[non_exhaustive]pub enum ChromaSiting {
Unknown,
Center,
Left,
TopLeft,
Top,
BottomLeft,
Bottom,
}Expand description
Full re-export of zenpixels core types (zero module name collisions!).
Declared chroma sample location relative to the luma sample grid.
This is a fact, not a fallback policy: Unknown is retained
rather than silently defaulting to Center. A conversion that
requires siting either refuses Unknown on a subsampled axis or takes an
explicit caller fallback policy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
The source did not declare a chroma sample location (AV1 CSP_UNKNOWN).
Center
Centered horizontally and vertically in the subsampled luma cell (JPEG / H.265 type 1).
Left
Horizontally co-sited with the left luma sample, vertically centered between rows
(MPEG-2 / H.264 / AV1 CSP_VERTICAL / H.265 type 0).
TopLeft
Co-sited with the top-left luma sample (BT.2020 / AV1 CSP_COLOCATED / H.265 type 2).
Top
Horizontally centered, vertically co-sited with the top luma sample (H.265 type 3).
BottomLeft
Co-sited with the bottom-left luma sample (H.265 type 4).
Bottom
Horizontally centered, vertically co-sited with the bottom luma sample (H.265 type 5).
Implementations§
Source§impl ChromaSiting
impl ChromaSiting
Sourcepub const fn offset_in_luma_pixels(
self,
subsampling: ChromaSubsampling,
) -> Option<(f32, f32)>
pub const fn offset_in_luma_pixels( self, subsampling: ChromaSubsampling, ) -> Option<(f32, f32)>
Fractional (dx, dy) offset of chroma sample (0, 0) within its subsampling cell
in luma-pixel units relative to the top-left luma sample center at (0.0, 0.0).
Returns None for Self::Unknown or ChromaSubsampling::Mono.
For ChromaSubsampling::Yuv420 (2×2):
TopLeft→(0.0, 0.0)Left→(0.0, 0.5)Center→(0.5, 0.5)
Sourcepub const fn offset_in_luma_pixels_for_divisors(
self,
horizontal_divisor: u8,
vertical_divisor: u8,
) -> Option<(f32, f32)>
pub const fn offset_in_luma_pixels_for_divisors( self, horizontal_divisor: u8, vertical_divisor: u8, ) -> Option<(f32, f32)>
Fractional (dx, dy) offset of chroma sample (0, 0) within an arbitrary
horizontal_divisor × vertical_divisor luma cell in luma-pixel units relative to
the top-left luma sample center at (0.0, 0.0), or None for Self::Unknown.
Divisors <= 1 yield 0.0 along that axis.
Trait Implementations§
Source§impl Clone for ChromaSiting
impl Clone for ChromaSiting
Source§fn clone(&self) -> ChromaSiting
fn clone(&self) -> ChromaSiting
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more