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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Copyright (c) 2021-2025, Harbers Bik LLC
use Serialize;
use crateProfile;
use RawProfile;
/// Represents an ICC input profile, which is a specific type of ICC profile used for input devices such as scanners and cameras.
/// This struct wraps a `RawProfile` and provides methods to convert from a generic `Profile`.
///
/// # Required Tags for all Input Profiles
///
/// - `desc`: Profile Description tag
/// - `cprt`: Copyright tag
/// - `dmwp`: Device Media white point tag
/// - `chad`: Media chromatic adaptation tag, if the white point of the data is different than that of the PCS
///
/// # N-component LUT-based Input Profiles
/// For input profiles that use LUTs (Look-Up Tables) for color transformation, the following tags are required:
///
/// - `AtoB0`: A to B LUT tag for the first color component
///
/// Opinionally, the following tags can be present:
///
/// - `AtoB1`: A to B LUT tag for the second color component
/// - `AtoB2`: A to B LUT tag for the third color component
/// - `BtoA0`: B to A LUT tag for the first color component
/// - `BtoA1`: B to A LUT tag for the second color component
/// - `BtoA2`: B to A LUT tag for the third color component
/// - `DToB0`: Device to B LUT tag for the first color component
/// - `DToB1`: Device to B LUT tag for the second color component
/// - `DToB2`: Device to B LUT tag for the third color component
/// - `DToB3`: Device to B LUT tag for the fourth color component
/// - `BToD0`: B to Device LUT tag for the first color component
/// - `BToD1`: B to Device LUT tag for the second color component
/// - `BToD2`: B to Device LUT tag for the third color component
/// - `BToD3`: B to Device LUT tag for the fourth color component
///
/// # Three-component matrix-based Input Profiles
/// Only the XYZ PCS (Profile Connection Space) is supported three-component matrix-based input profiles.
/// For input profiles that use matrices for color transformation, the following tags are required:
///
/// - `rXYZ`: Red to XYZ matrix tag
/// - `gXYZ`: Green to XYZ matrix tag
/// - `bXYZ`: Blue to XYZ matrix tag
/// - `rTRC`: Red transfer function tag
/// - `gTRC`: Green transfer function tag
/// - `bTRC`: Blue transfer function tag
///
/// Optionally, the following tags can be present:
///
/// - `gamt`: Gamma tag
///
/// # Monochrome Input Profiles
///
/// For monochrome input profiles, the following tags are required:
///
/// - `kTRC`: Monochrome transfer function tag
///
/// Optionally, the following tags can be present:
///
/// - `AtoB0`: A to B LUT tag for the first color component
/// - `AtoB1`: A to B LUT tag for the second color component
/// - `AtoB2`: A to B LUT tag for the third color component
/// - `BtoA0`: B to A LUT tag for the first color component
/// - `BtoA1`: B to A LUT tag for the second color component
/// - `BtoA2`: B to A LUT tag for the third color component
///
RawProfile);