pub enum YuvMatrixCoefficients {
Identity = 0,
Bt601 = 1,
Bt709 = 2,
}
Expand description
Yuv matrix coefficients that determine how a YUV image is meant to be converted to RGB.
A rigorious definition of the yuv conversion matrix would still require to define
the transfer characteristics & color primaries of the resulting RGB space.
See re_video::decode
’s documentation.
However, at this point we generally assume that no further processing is needed after the transform.
This is acceptable for most non-HDR content because of the following properties of Bt709
/Bt601
/ sRGB:
- Bt709 & sRGB primaries are practically identical
- Bt601 PAL & Bt709 color primaries are the same (with some slight differences for Bt709 NTSC)
- Bt709 & sRGB transfer function are almost identical (and the difference is widely ignored) (sources: https://en.wikipedia.org/wiki/Rec._709, https://en.wikipedia.org/wiki/Rec._601) …which means for the moment we pretty much only care about the (actually quite) different YUV conversion matrices!
Variants§
Identity = 0
Identity matrix, interpret YUV as GBR.
Bt601 = 1
BT.601 (aka. SDTV, aka. Rec.601)
Wiki: https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion/
Bt709 = 2
BT.709 (aka. HDTV, aka. Rec.709)
Wiki: https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.709_conversion/
These are the same primaries we usually assume and use for all our rendering since they are the same primaries used by sRGB. https://en.wikipedia.org/wiki/Rec._709#Relationship_to_sRGB/ The OETF/EOTF function (https://en.wikipedia.org/wiki/Transfer_functions_in_imaging) is different, but for all other purposes they are the same. (The only reason for us to convert to optical units (“linear” instead of “gamma”) is for lighting & tonemapping where we typically start out with an sRGB image!)
Trait Implementations§
source§impl Clone for YuvMatrixCoefficients
impl Clone for YuvMatrixCoefficients
source§fn clone(&self) -> YuvMatrixCoefficients
fn clone(&self) -> YuvMatrixCoefficients
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for YuvMatrixCoefficients
impl Debug for YuvMatrixCoefficients
source§impl Display for YuvMatrixCoefficients
impl Display for YuvMatrixCoefficients
impl Copy for YuvMatrixCoefficients
Auto Trait Implementations§
impl Freeze for YuvMatrixCoefficients
impl RefUnwindSafe for YuvMatrixCoefficients
impl Send for YuvMatrixCoefficients
impl Sync for YuvMatrixCoefficients
impl Unpin for YuvMatrixCoefficients
impl UnwindSafe for YuvMatrixCoefficients
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request