diff --git a/palette/src/encoding.rs b/palette/src/encoding.rs index e50949e0..21d922ae 100644 --- a/palette/src/encoding.rs +++ b/palette/src/encoding.rs @@ -8,6 +8,7 @@ pub use self::adobe::AdobeRgb; pub use self::gamma::{F2p2, Gamma}; pub use self::linear::Linear; +pub use self::p3::{DciP3, DciP3Plus, DisplayP3}; pub use self::prophoto::ProPhotoRgb; pub use self::rec_standards::{Rec2020, Rec709}; pub use self::srgb::Srgb; @@ -15,6 +16,7 @@ pub use self::srgb::Srgb; pub mod adobe; pub mod gamma; pub mod linear; +pub mod p3; pub mod prophoto; pub mod rec_standards; pub mod srgb; diff --git a/palette/src/rgb.rs b/palette/src/rgb.rs index 65480138..d34d00b2 100644 --- a/palette/src/rgb.rs +++ b/palette/src/rgb.rs @@ -150,6 +150,59 @@ pub type AdobeRgb = Rgb; /// create a value and use it. pub type AdobeRgba = Rgba; +/// Non-linear DCI-P3, an RGB format used for digital movie distribution. +/// +/// This is an RGB standard with a color gamut wider than that of [`Srgb`] and a +/// white point similar to that of a film projector's xenon bulb. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type DciP3 = Rgb; + +/// Non-linear Canon DCI-P3+, an RGB format with a very wide gamut. +/// +/// This is an RGB standard with a color gamut much wider than that of [`Srgb`]. +/// It uses the same white point as [`DciP3`], but uses a user-defined transfer +/// function, represented here by the generic `F`. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type DciP3Plus = Rgb, T>; + +/// Non-linear Display P3, an RGB format used developed by Apple for wide-gamut +/// displays. +/// +/// This is an RGB standard with the same white point and transfer function as +/// [`Srgb`], but with a wider color gamut. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type DisplayP3 = Rgb; + +/// Linear DCI-P3. +/// +/// You probably want [`DciP3`] if you are looking for an input or output format. +/// This is the linear version of DCI-P3, which is what you would usually convert +/// to before working with the color. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type LinDciP3 = Rgb, T>; + +/// Linear DCI-P3+. +/// +/// You probably want [`DciP3Plus`] if you are looking for an input or output format. +/// This is the linear version of DCI-P3+, which is what you would usually convert +/// to before working with the color. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type LinDciP3Plus = Rgb>, T>; + +/// Linear Display P3. +/// +/// You probably want [`DisplayP3`] if you are looking for an input or output format. +/// This is the linear version of Display P3, which is what you would usually convert +/// to before working with the color. +/// +/// See [`Rgb`] for more details on how to create a value and use it. +pub type LinDisplayP3 = Rgb, T>; + /// Linear Adobe RGB. /// /// You probably want [`AdobeRgb`] if you are looking for an input or output format.