pub struct Colorimetry {
pub space: Option<ColorSpace>,
pub transfer: Option<ColorTransfer>,
pub encoding: Option<ColorEncoding>,
pub range: Option<ColorRange>,
}Expand description
Full 4-axis colorimetry. Each axis is Option; None means “undefined”
and is never auto-filled — consumers (e.g. convert()) resolve missing
axes at use-time without mutating the value.
Fields§
§space: Option<ColorSpace>§transfer: Option<ColorTransfer>§encoding: Option<ColorEncoding>§range: Option<ColorRange>Implementations§
Source§impl Colorimetry
impl Colorimetry
Sourcepub fn jfif() -> Self
pub fn jfif() -> Self
JPEG/JFIF colorimetry: sRGB primaries, sRGB transfer, BT.601 encoding, full range.
Sourcepub fn from_v4l2(colorspace: u32, xfer: u32, ycbcr_enc: u32, quant: u32) -> Self
pub fn from_v4l2(colorspace: u32, xfer: u32, ycbcr_enc: u32, quant: u32) -> Self
Build from the four raw V4L2 colorimetry integers.
Explicit values map directly. For ycbcr_enc/quantization, the V4L2
DEFAULT (0) sentinel does NOT mean “unknown” — it means “derive from
the colorspace” (kernel V4L2_MAP_YCBCR_ENC_DEFAULT /
V4L2_MAP_QUANTIZATION_DEFAULT). So a recognised colorspace resolves
those axes here (e.g. V4L2_COLORSPACE_JPEG → BT.601 full-range) rather
than leaving them None and falling through to the at-use height
heuristic (which would wrongly pick BT.709/limited for an HD JPEG frame).
A DEFAULT/unrecognised colorspace still yields None (deferred to the
heuristic); unrecognised non-default values also map to None.
Sourcepub fn with_space(self, s: ColorSpace) -> Self
pub fn with_space(self, s: ColorSpace) -> Self
Set color primaries (consuming builder).
Sourcepub fn with_transfer(self, t: ColorTransfer) -> Self
pub fn with_transfer(self, t: ColorTransfer) -> Self
Set transfer function (consuming builder).
Sourcepub fn with_encoding(self, e: ColorEncoding) -> Self
pub fn with_encoding(self, e: ColorEncoding) -> Self
Set YCbCr encoding matrix (consuming builder).
Sourcepub fn with_range(self, r: ColorRange) -> Self
pub fn with_range(self, r: ColorRange) -> Self
Set quantization range (consuming builder).
Trait Implementations§
Source§impl Clone for Colorimetry
impl Clone for Colorimetry
Source§fn clone(&self) -> Colorimetry
fn clone(&self) -> Colorimetry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Colorimetry
Source§impl Debug for Colorimetry
impl Debug for Colorimetry
Source§impl Default for Colorimetry
impl Default for Colorimetry
Source§fn default() -> Colorimetry
fn default() -> Colorimetry
Source§impl<'de> Deserialize<'de> for Colorimetry
impl<'de> Deserialize<'de> for Colorimetry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Colorimetry
Source§impl Hash for Colorimetry
impl Hash for Colorimetry
Source§impl PartialEq for Colorimetry
impl PartialEq for Colorimetry
Source§fn eq(&self, other: &Colorimetry) -> bool
fn eq(&self, other: &Colorimetry) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Colorimetry
impl Serialize for Colorimetry
impl StructuralPartialEq for Colorimetry
Auto Trait Implementations§
impl Freeze for Colorimetry
impl RefUnwindSafe for Colorimetry
impl Send for Colorimetry
impl Sync for Colorimetry
impl Unpin for Colorimetry
impl UnsafeUnpin for Colorimetry
impl UnwindSafe for Colorimetry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more