1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2026 the openpbr crate Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT
use ;
/// A linear-light RGB space suitable for OpenPBR parameter values.
///
/// Implemented for [`AcesCg`], [`Aces2065_1`], and [`LinearSrgb`]. Encoded RGB
/// spaces and XYZ are excluded, even though XYZ is linear. This bound applies
/// to the types themselves, so unsupported spaces fail during `cargo check`,
/// including when constructing values directly or converting between spaces.
///
/// # Implementing a custom space
///
/// Implementors must use linear-light RGB coordinates with
/// [`ColorSpace::IS_LINEAR`] set to true, white at `[1, 1, 1]`, and neutral
/// grays at `[v, v, v]`. Conversions must preserve extended coordinates
/// (including negative components and components above one) without clipping
/// or gamut mapping. These semantic requirements are the implementor's
/// responsibility; the marker does not verify a custom conversion's math.
///
/// ```compile_fail
/// fn encoded(_: openpbr::Parameters<openpbr::color::Srgb>) {}
/// ```
///
/// ```compile_fail
/// fn tristimulus(_: openpbr::Parameters<openpbr::color::XyzD65>) {}
/// ```
///
/// ```compile_fail
/// let p = openpbr::Parameters::<openpbr::color::AcesCg>::DEFAULT;
/// let encoded = p.convert::<openpbr::color::Srgb>();
/// ```
///
/// ```compile_fail
/// let p = openpbr::Parameters::<openpbr::color::AcesCg>::DEFAULT;
/// let tristimulus = p.convert::<openpbr::color::XyzD65>();
/// ```