Skip to content

Commit cbc5b47

Browse files
author
BuildTools
committed
Deal with merge conflicts
1 parent ef1e6cd commit cbc5b47

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

palette/src/encoding.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
pub use self::adobe::AdobeRgb;
99
pub use self::gamma::{F2p2, Gamma};
1010
pub use self::linear::Linear;
11+
pub use self::p3::{DciP3, DciP3Plus, DisplayP3};
1112
pub use self::prophoto::ProPhotoRgb;
1213
pub use self::rec_standards::{Rec2020, Rec709};
1314
pub use self::srgb::Srgb;
1415

1516
pub mod adobe;
1617
pub mod gamma;
1718
pub mod linear;
19+
pub mod p3;
1820
pub mod prophoto;
1921
pub mod rec_standards;
2022
pub mod srgb;

palette/src/rgb.rs

+53
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,59 @@ pub type AdobeRgb<T = f32> = Rgb<encoding::AdobeRgb, T>;
150150
/// create a value and use it.
151151
pub type AdobeRgba<T = f32> = Rgba<encoding::AdobeRgb, T>;
152152

153+
/// Non-linear DCI-P3, an RGB format used for digital movie distribution.
154+
///
155+
/// This is an RGB standard with a color gamut wider than that of [`Srgb`] and a
156+
/// white point similar to that of a film projector's xenon bulb.
157+
///
158+
/// See [`Rgb`] for more details on how to create a value and use it.
159+
pub type DciP3<T = f32> = Rgb<encoding::DciP3, T>;
160+
161+
/// Non-linear Canon DCI-P3+, an RGB format with a very wide gamut.
162+
///
163+
/// This is an RGB standard with a color gamut much wider than that of [`Srgb`].
164+
/// It uses the same white point as [`DciP3`], but uses a user-defined transfer
165+
/// function, represented here by the generic `F`.
166+
///
167+
/// See [`Rgb`] for more details on how to create a value and use it.
168+
pub type DciP3Plus<F, T = f32> = Rgb<encoding::DciP3Plus<F>, T>;
169+
170+
/// Non-linear Display P3, an RGB format used developed by Apple for wide-gamut
171+
/// displays.
172+
///
173+
/// This is an RGB standard with the same white point and transfer function as
174+
/// [`Srgb`], but with a wider color gamut.
175+
///
176+
/// See [`Rgb`] for more details on how to create a value and use it.
177+
pub type DisplayP3<T = f32> = Rgb<encoding::DisplayP3, T>;
178+
179+
/// Linear DCI-P3.
180+
///
181+
/// You probably want [`DciP3`] if you are looking for an input or output format.
182+
/// This is the linear version of DCI-P3, which is what you would usually convert
183+
/// to before working with the color.
184+
///
185+
/// See [`Rgb`] for more details on how to create a value and use it.
186+
pub type LinDciP3<T = f32> = Rgb<Linear<encoding::DciP3>, T>;
187+
188+
/// Linear DCI-P3+.
189+
///
190+
/// You probably want [`DciP3Plus`] if you are looking for an input or output format.
191+
/// This is the linear version of DCI-P3+, which is what you would usually convert
192+
/// to before working with the color.
193+
///
194+
/// See [`Rgb`] for more details on how to create a value and use it.
195+
pub type LinDciP3Plus<F, T = f32> = Rgb<Linear<encoding::DciP3Plus<F>>, T>;
196+
197+
/// Linear Display P3.
198+
///
199+
/// You probably want [`DisplayP3`] if you are looking for an input or output format.
200+
/// This is the linear version of Display P3, which is what you would usually convert
201+
/// to before working with the color.
202+
///
203+
/// See [`Rgb`] for more details on how to create a value and use it.
204+
pub type LinDisplayP3<T = f32> = Rgb<Linear<encoding::DisplayP3>, T>;
205+
153206
/// Linear Adobe RGB.
154207
///
155208
/// You probably want [`AdobeRgb`] if you are looking for an input or output format.

0 commit comments

Comments
 (0)