#[non_exhaustive]pub enum ColorTransfer {
Bt709,
Srgb,
Pq,
Hlg,
Linear,
}Expand description
Transfer function (color_transfer in the EdgeFirst schema).
Limitation: this axis is stored, propagated, and round-tripped, but it is
not applied by any conversion backend. All YUV↔RGB paths operate only on
the matrix (ColorEncoding) and range (ColorRange); the transfer
function (gamma / TRC) is assumed to be the platform-native curve and is left
unchanged. HDR transfer curves (Self::Pq / Self::Hlg) are therefore
not tone-mapped — consumers needing linear-light or HDR handling must apply
the curve themselves.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bt709
Srgb
Pq
Hlg
Hybrid Log-Gamma. Present for EdgeFirst-schema / libcamera parity; the
V4L2 UAPI defines no V4L2_XFER_FUNC_HLG, so from_v4l2 never yields
this variant.
Linear
Implementations§
Source§impl ColorTransfer
impl ColorTransfer
Sourcepub fn from_v4l2(v: u32) -> Option<Self>
pub fn from_v4l2(v: u32) -> Option<Self>
Map a raw V4L2 xfer_func field to a ColorTransfer.
Returns None for V4L2_XFER_FUNC_DEFAULT (0) and any
unrecognised value.
Note: OPRGB (3), SMPTE240M (4), and DCI_P3 (6) have no HAL equivalent
and map to None. ColorTransfer::Hlg is never produced because the
V4L2 UAPI defines no V4L2_XFER_FUNC_HLG value.
Trait Implementations§
Source§impl Clone for ColorTransfer
impl Clone for ColorTransfer
Source§fn clone(&self) -> ColorTransfer
fn clone(&self) -> ColorTransfer
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 ColorTransfer
Source§impl Debug for ColorTransfer
impl Debug for ColorTransfer
Source§impl<'de> Deserialize<'de> for ColorTransfer
impl<'de> Deserialize<'de> for ColorTransfer
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>,
Source§impl Display for ColorTransfer
impl Display for ColorTransfer
impl Eq for ColorTransfer
Source§impl Hash for ColorTransfer
impl Hash for ColorTransfer
Source§impl PartialEq for ColorTransfer
impl PartialEq for ColorTransfer
Source§fn eq(&self, other: &ColorTransfer) -> bool
fn eq(&self, other: &ColorTransfer) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ColorTransfer
impl Serialize for ColorTransfer
impl StructuralPartialEq for ColorTransfer
Auto Trait Implementations§
impl Freeze for ColorTransfer
impl RefUnwindSafe for ColorTransfer
impl Send for ColorTransfer
impl Sync for ColorTransfer
impl Unpin for ColorTransfer
impl UnsafeUnpin for ColorTransfer
impl UnwindSafe for ColorTransfer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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