colr-types 0.3.1

Color model ZSTs and marker traits for colr.
Documentation
//! YCbCr color model.

use core::marker::PhantomData;

use crate::BackingStore;
use crate::layout::{Ycbcr, YCbCrLayout};
use crate::primaries::Primaries;
use crate::transfer::TransferFunction;

/// YCbCr derived from an RGB space with primaries P and transfer function TF.
///
/// Y' is luma, Cb is scaled blue chroma difference, Cr is scaled red chroma
/// difference. The conversion matrix is derived from the primaries' luma
/// weights. Used in JPEG, H.264, H.265, and broadcast video. Layout defaults
/// to `Ycbcr`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct YCbCr<P: Primaries, TF: TransferFunction, L: YCbCrLayout = Ycbcr>(
    PhantomData<(P, TF, L)>,
);

impl<P: Primaries, TF: TransferFunction, L: YCbCrLayout + BackingStore<[f32; 3]>>
    BackingStore<[f32; 3]> for YCbCr<P, TF, L>
{
}
impl<P: Primaries, TF: TransferFunction, L: YCbCrLayout + BackingStore<[f32; 4]>>
    BackingStore<[f32; 4]> for YCbCr<P, TF, L>
{
}