Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
profile_types.h File Reference

The colour-profile vocabulary, and nothing else. More...

#include <glib.h>
+ Include dependency graph for profile_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DT_IOP_COLOR_ICC_LEN   512
 Size of every ICC filename buffer that crosses a module boundary.
 

Typedefs

typedef enum dt_iop_color_intent_t dt_iop_color_intent_t
 ICC rendering intent, as stored in iop params and in conf.
 
typedef enum dt_colorspaces_profile_type_t dt_colorspaces_profile_type_t
 Which of the five user-visible profile SLOTS a notification concerns.
 
typedef enum dt_colorspaces_color_profile_type_t dt_colorspaces_color_profile_type_t
 
typedef enum dt_colorspaces_color_mode_t dt_colorspaces_color_mode_t
 What the output transform is being asked to show: the picture, or a proof of it.
 
typedef enum dt_colorspaces_profile_role_t dt_colorspaces_profile_role_t
 Which use a profile is eligible for – the mandatory filter on every lookup and enumeration.
 
typedef enum dt_colorspaces_cicp_color_primaries_t dt_colorspaces_cicp_color_primaries_t
 CICP colour primaries, as tagged in AVIF/HEIF/JPEG XL containers.
 
typedef enum dt_colorspaces_cicp_transfer_characteristics_t dt_colorspaces_cicp_transfer_characteristics_t
 CICP transfer characteristics, as tagged in AVIF/HEIF/JPEG XL containers.
 
typedef enum dt_colorspaces_cicp_matrix_coefficients_t dt_colorspaces_cicp_matrix_coefficients_t
 CICP matrix coefficients, as tagged in AVIF/HEIF/JPEG XL containers.
 

Enumerations

enum  dt_iop_color_intent_t {
  DT_INTENT_PERCEPTUAL = 0 ,
  DT_INTENT_RELATIVE_COLORIMETRIC = 1 ,
  DT_INTENT_SATURATION = 2 ,
  DT_INTENT_ABSOLUTE_COLORIMETRIC = 3 ,
  DT_INTENT_LAST
}
 ICC rendering intent, as stored in iop params and in conf. More...
 
enum  dt_colorspaces_profile_type_t {
  DT_COLORSPACES_PROFILE_TYPE_INPUT = 1 ,
  DT_COLORSPACES_PROFILE_TYPE_WORK = 2 ,
  DT_COLORSPACES_PROFILE_TYPE_EXPORT = 3 ,
  DT_COLORSPACES_PROFILE_TYPE_DISPLAY = 4 ,
  DT_COLORSPACES_PROFILE_TYPE_SOFTPROOF = 5
}
 Which of the five user-visible profile SLOTS a notification concerns. More...
 
enum  dt_colorspaces_color_profile_type_t {
  DT_COLORSPACE_NONE = -1 ,
  DT_COLORSPACE_FILE = 0 ,
  DT_COLORSPACE_SRGB = 1 ,
  DT_COLORSPACE_ADOBERGB = 2 ,
  DT_COLORSPACE_LIN_REC709 = 3 ,
  DT_COLORSPACE_LIN_REC2020 = 4 ,
  DT_COLORSPACE_XYZ = 5 ,
  DT_COLORSPACE_LAB = 6 ,
  DT_COLORSPACE_INFRARED = 7 ,
  DT_COLORSPACE_DISPLAY = 8 ,
  DT_COLORSPACE_EMBEDDED_ICC = 9 ,
  DT_COLORSPACE_EMBEDDED_MATRIX = 10 ,
  DT_COLORSPACE_STANDARD_MATRIX = 11 ,
  DT_COLORSPACE_ENHANCED_MATRIX = 12 ,
  DT_COLORSPACE_VENDOR_MATRIX = 13 ,
  DT_COLORSPACE_ALTERNATE_MATRIX = 14 ,
  DT_COLORSPACE_BRG = 15 ,
  DT_COLORSPACE_EXPORT = 16 ,
  DT_COLORSPACE_SOFTPROOF = 17 ,
  DT_COLORSPACE_WORK = 18 ,
  DT_COLORSPACE_DISPLAY2 = 19 ,
  DT_COLORSPACE_REC709 = 20 ,
  DT_COLORSPACE_PROPHOTO_RGB = 21 ,
  DT_COLORSPACE_PQ_REC2020 = 22 ,
  DT_COLORSPACE_HLG_REC2020 = 23 ,
  DT_COLORSPACE_PQ_P3 = 24 ,
  DT_COLORSPACE_HLG_P3 = 25 ,
  DT_COLORSPACE_ITUR_BT1886 = 26 ,
  DT_COLORSPACE_DISPLAY_P3 = 27 ,
  DT_COLORSPACE_LAST = 28
}
 
enum  dt_colorspaces_color_mode_t {
  DT_PROFILE_NORMAL = 0 ,
  DT_PROFILE_SOFTPROOF ,
  DT_PROFILE_GAMUTCHECK
}
 What the output transform is being asked to show: the picture, or a proof of it. More...
 
enum  dt_colorspaces_profile_role_t {
  DT_PROFILE_ROLE_INPUT = 1 << 0 ,
  DT_PROFILE_ROLE_OUTPUT = 1 << 1 ,
  DT_PROFILE_ROLE_MONITOR = 1 << 2 ,
  DT_PROFILE_ROLE_WORKING = 1 << 3 ,
  DT_PROFILE_ROLE_ANY
}
 Which use a profile is eligible for – the mandatory filter on every lookup and enumeration. More...
 
enum  dt_colorspaces_cicp_color_primaries_t {
  DT_CICP_COLOR_PRIMARIES_REC709 = 1 ,
  DT_CICP_COLOR_PRIMARIES_UNSPECIFIED = 2 ,
  DT_CICP_COLOR_PRIMARIES_REC2020 = 9 ,
  DT_CICP_COLOR_PRIMARIES_XYZ = 10 ,
  DT_CICP_COLOR_PRIMARIES_P3 = 12
}
 CICP colour primaries, as tagged in AVIF/HEIF/JPEG XL containers. More...
 
enum  dt_colorspaces_cicp_transfer_characteristics_t {
  DT_CICP_TRANSFER_CHARACTERISTICS_REC709 = 1 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_REC601 = 6 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_LINEAR = 8 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_SRGB = 13 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_REC2020_10B = 14 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_REC2020_12B = 15 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_PQ = 16 ,
  DT_CICP_TRANSFER_CHARACTERISTICS_HLG = 18
}
 CICP transfer characteristics, as tagged in AVIF/HEIF/JPEG XL containers. More...
 
enum  dt_colorspaces_cicp_matrix_coefficients_t {
  DT_CICP_MATRIX_COEFFICIENTS_IDENTITY = 0 ,
  DT_CICP_MATRIX_COEFFICIENTS_REC709 = 1 ,
  DT_CICP_MATRIX_COEFFICIENTS_UNSPECIFIED = 2 ,
  DT_CICP_MATRIX_COEFFICIENTS_SYCC = 5 ,
  DT_CICP_MATRIX_COEFFICIENTS_REC601 = 6 ,
  DT_CICP_MATRIX_COEFFICIENTS_REC2020_NCL = 9 ,
  DT_CICP_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL = 12
}
 CICP matrix coefficients, as tagged in AVIF/HEIF/JPEG XL containers. More...
 

Functions

static dt_colorspaces_color_profile_type_t sanitize_colorspaces (dt_colorspaces_color_profile_type_t colorspace)
 Coerce an integer read back from storage into a colour space this build still has.
 
static gboolean dt_colorspaces_is_raw_matrix_profile_type (const dt_colorspaces_color_profile_type_t type)
 Is this one of the four camera-matrix profile kinds?
 

Detailed Description

The colour-profile vocabulary, and nothing else.

These enums are serialised into iop params blobs in the library database and into XMP sidecars, so their numeric values are frozen ABI – they cannot move or be renumbered. That is not an abstract worry: dt_iop_colorin_params_t stores two dt_colorspaces_color_profile_type_t (input and working), a dt_iop_color_intent_t and two char[DT_IOP_COLOR_ICC_LEN]; dt_iop_colorout_params_t stores one of each. Those structs are memcpy'd into main.history.op_params and base64'd into Xmp.darktable.history_params (common/exif.cc). The export module serialises icctype/iccintent into its preset blobs too, and already carries several legacy_params versions to migrate them (libs/export.c). Renumbering any enumerator below silently repoints every stored edit at a different colour space.

Almost everything that includes colorprofiles/ wants only this: a profile type to store in its params, an intent to pass along. Carrying that vocabulary in the same header as the module's API meant <lcms2.h> and <pthread.h> reached several hundred translation units that never call either – 300 of 425 at the point this split was made.

Warning
Nothing here may include lcms2, pthread or GTK. <glib.h> is the one dependency, for gboolean and MIN. Adding any other include re-creates the fan-out this file exists to stop.
See also
colorprofiles/colorspaces.h for the API that acts on these values (CRUDE metadata queries, the lock, and dt_colorspaces_apply_profile()).

Definition in file profile_types.h.

Macro Definition Documentation

◆ DT_IOP_COLOR_ICC_LEN

#define DT_IOP_COLOR_ICC_LEN   512

Size of every ICC filename buffer that crosses a module boundary.

512 bytes. This is the declared width of filename inside the serialised iop params of colorin and colorout, so it is part of the params ABI: changing it changes the size of every stored history entry and every XMP blob. It is also the width of dt_colorspaces_color_profile_t::filename and of the filename in the value-copy descriptor the CRUDE calls hand back, so the three never need a length negotiation.

Definition at line 85 of file profile_types.h.

Typedef Documentation

◆ dt_colorspaces_cicp_color_primaries_t

CICP colour primaries, as tagged in AVIF/HEIF/JPEG XL containers.

Values are fixed by Recommendation ITU-T H.273, not by Ansel: this is an external ABI and the gaps in the numbering are the codepoints for primaries the codebase does not handle. Only imageio reads them, to map a container's CICP triplet onto one of the DT_COLORSPACE_* values above.

◆ dt_colorspaces_cicp_matrix_coefficients_t

CICP matrix coefficients, as tagged in AVIF/HEIF/JPEG XL containers.

Values fixed by Recommendation ITU-T H.273. IDENTITY is what a lossless or 4:4:4 RGB file carries; the imageio mapping accepts it, the matching YCbCr codepoint, UNSPECIFIED, and a couple of commonly mistagged neighbours for the same primaries.

◆ dt_colorspaces_cicp_transfer_characteristics_t

CICP transfer characteristics, as tagged in AVIF/HEIF/JPEG XL containers.

Values fixed by Recommendation ITU-T H.273. Several are treated as equivalent by the imageio mapping specifically to tolerate mistagged files (Rec601 and the two Rec2020 bit depths are accepted wherever Rec709 is expected).

◆ dt_colorspaces_color_mode_t

What the output transform is being asked to show: the picture, or a proof of it.

Application-wide state, not per-image: one setting shared by the darkroom toolbox toggles, the backbuf overlay label and colorout's transform construction (GAMUTCHECK adds cmsFLAGS_GAMUTCHECK to the proofing transform). It is persisted across sessions in the ui_last/color/mode conf key and range-checked on load, so an out-of-range stored value falls back to DT_PROFILE_NORMAL rather than reaching lcms2.

◆ dt_colorspaces_color_profile_type_t

◆ dt_colorspaces_profile_role_t

Which use a profile is eligible for – the mandatory filter on every lookup and enumeration.

A bitmask, but read it as "which combo box would list this profile", not as a colour-management direction. That distinction matters because the module has two entries for DT_COLORSPACE_SRGB distinguished by nothing else (see DT_COLORSPACE_SRGB): the role is what picks between them, so it cannot be omitted or approximated.

A multi-bit mask resolves to the FIRST entry in registration order that serves any of its bits. Calls that return or consume a combo-box INDEX therefore require a single bit: an index means nothing outside the enumeration that produced it, and an index taken from INPUT|OUTPUT equals neither menu's row number.

Note
This used to be called a "direction", which it is not: a profile is RGB->PCS or PCS->RGB, and nothing else. What these bits select is which MENU an entry belongs to, and the menus genuinely differ from one another – see DT_PROFILE_ROLE_MONITOR. Two further bits, CATEGORY and DISPLAY2, were declared and never tested by any lookup: one had a position field no predicate consulted, the other had no field at all. They are gone, which changes nothing at runtime and stops DT_PROFILE_ROLE_ANY claiming six meanings when it had four.

◆ dt_colorspaces_profile_type_t

Which of the five user-visible profile SLOTS a notification concerns.

Not a colour space: it names a role in the UI. Its only use is as the payload of DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, raised by colorin (input, working), the display actions (display) and the darkroom toolbox (softproof), and read back by listeners such as basicadj and the thumbtable. The signal bus carries it as a uint8_t.

Note
Numbering starts at 1: no member has the value 0, so a zero-initialised variable is not a valid slot and cannot accidentally compare equal to one.
DT_COLORSPACES_PROFILE_TYPE_EXPORT is declared but dead – nothing in the tree raises or tests it, so changing the export profile notifies no one. Kept for the numbering.

◆ dt_iop_color_intent_t

ICC rendering intent, as stored in iop params and in conf.

Spelled as literals rather than as lcms2's INTENT_* so this header needs no <lcms2.h> – the values are fixed by the ICC specification, and colorspaces.c static-asserts that they still match lcms2's (four _Static_asserts, one per intent). A divergence is therefore a compile error in the one translation unit that talks to lcms2, not a silently wrong render everywhere else.

Enumeration Type Documentation

◆ dt_colorspaces_cicp_color_primaries_t

CICP colour primaries, as tagged in AVIF/HEIF/JPEG XL containers.

Values are fixed by Recommendation ITU-T H.273, not by Ansel: this is an external ABI and the gaps in the numbering are the codepoints for primaries the codebase does not handle. Only imageio reads them, to map a container's CICP triplet onto one of the DT_COLORSPACE_* values above.

Enumerator
DT_CICP_COLOR_PRIMARIES_REC709 
DT_CICP_COLOR_PRIMARIES_UNSPECIFIED 
DT_CICP_COLOR_PRIMARIES_REC2020 
DT_CICP_COLOR_PRIMARIES_XYZ 
DT_CICP_COLOR_PRIMARIES_P3 

Definition at line 323 of file profile_types.h.

◆ dt_colorspaces_cicp_matrix_coefficients_t

CICP matrix coefficients, as tagged in AVIF/HEIF/JPEG XL containers.

Values fixed by Recommendation ITU-T H.273. IDENTITY is what a lossless or 4:4:4 RGB file carries; the imageio mapping accepts it, the matching YCbCr codepoint, UNSPECIFIED, and a couple of commonly mistagged neighbours for the same primaries.

Enumerator
DT_CICP_MATRIX_COEFFICIENTS_IDENTITY 
DT_CICP_MATRIX_COEFFICIENTS_REC709 
DT_CICP_MATRIX_COEFFICIENTS_UNSPECIFIED 
DT_CICP_MATRIX_COEFFICIENTS_SYCC 
DT_CICP_MATRIX_COEFFICIENTS_REC601 
DT_CICP_MATRIX_COEFFICIENTS_REC2020_NCL 
DT_CICP_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL 

Definition at line 359 of file profile_types.h.

◆ dt_colorspaces_cicp_transfer_characteristics_t

CICP transfer characteristics, as tagged in AVIF/HEIF/JPEG XL containers.

Values fixed by Recommendation ITU-T H.273. Several are treated as equivalent by the imageio mapping specifically to tolerate mistagged files (Rec601 and the two Rec2020 bit depths are accepted wherever Rec709 is expected).

Enumerator
DT_CICP_TRANSFER_CHARACTERISTICS_REC709 
DT_CICP_TRANSFER_CHARACTERISTICS_UNSPECIFIED 
DT_CICP_TRANSFER_CHARACTERISTICS_REC601 
DT_CICP_TRANSFER_CHARACTERISTICS_LINEAR 
DT_CICP_TRANSFER_CHARACTERISTICS_SRGB 
DT_CICP_TRANSFER_CHARACTERISTICS_REC2020_10B 
DT_CICP_TRANSFER_CHARACTERISTICS_REC2020_12B 
DT_CICP_TRANSFER_CHARACTERISTICS_PQ 
DT_CICP_TRANSFER_CHARACTERISTICS_HLG 

Definition at line 339 of file profile_types.h.

◆ dt_colorspaces_color_mode_t

What the output transform is being asked to show: the picture, or a proof of it.

Application-wide state, not per-image: one setting shared by the darkroom toolbox toggles, the backbuf overlay label and colorout's transform construction (GAMUTCHECK adds cmsFLAGS_GAMUTCHECK to the proofing transform). It is persisted across sessions in the ui_last/color/mode conf key and range-checked on load, so an out-of-range stored value falls back to DT_PROFILE_NORMAL rather than reaching lcms2.

Enumerator
DT_PROFILE_NORMAL 
DT_PROFILE_SOFTPROOF 
DT_PROFILE_GAMUTCHECK 

Definition at line 255 of file profile_types.h.

◆ dt_colorspaces_color_profile_type_t

Enumerator
DT_COLORSPACE_NONE 

No profile / "take it from the image settings". Never matches a list entry.

DT_COLORSPACE_FILE 

A user ICC file on disk; the only type whose filename is meaningful.

Every lookup for this type compares filenames rather than identity, and does so with dt_colorspaces_is_profile_equal() (basename-tolerant, because an iop may have recorded a bare basename). Two different files therefore share this one enum value.

DT_COLORSPACE_SRGB 

sRGB – registered TWICE, and the two entries are not interchangeable.

A v4 profile with parametric curves is registered for INPUT, and a v2 profile with a point TRC is registered for output/display/category/work. Nothing but the pattern of -1 in their five position fields distinguishes them: same type, same empty filename. A lookup with a multi-bit role mask returns the FIRST match in registration order, which for sRGB is the v4 input entry – so asking for "sRGB, any role" while meaning the working profile hands back the wrong variant. Pass DT_PROFILE_ROLE_WORKING (or OUT, or DISPLAY) explicitly.

DT_COLORSPACE_ADOBERGB 
DT_COLORSPACE_LIN_REC709 
DT_COLORSPACE_LIN_REC2020 
DT_COLORSPACE_XYZ 
DT_COLORSPACE_LAB 
DT_COLORSPACE_INFRARED 
DT_COLORSPACE_DISPLAY 

The monitor profile – the one list entry that mutates after init.

Registered with an sRGB placeholder so that code running before the real profile can be fetched has something to work with, then replaced in place (old handle closed, new one stored) every time the system profile changes – which includes moving or resizing the window onto another monitor.

Warning
Anything that derives from this entry's cmsHPROFILE (a matrix extraction, a cmsCreateTransform) must hold dt_colorspaces_lock_profiles() for the span of the derivation, or it can be reading a handle that has just been deleted.
DT_COLORSPACE_EMBEDDED_ICC 

Image-derived profiles: enum 9..14, NOT registered in the list.

These describe a profile that exists only for one image – the ICC embedded in that file, or a matrix taken from that camera's data by colorin. They cannot be resolved by identity, because there is no list entry to find, and they must not be shared: the pipe that built one owns it (dt_dev_pixelpipe_t::owned_input_profile_info) rather than putting it in the module-wide derived-profile memo, where a (type, "") key would be common to every image of the same camera-matrix kind. develop/iop_profile.c tests exactly this closed range, so a new image-derived type has to be added inside it.

DT_COLORSPACE_EMBEDDED_MATRIX 
DT_COLORSPACE_STANDARD_MATRIX 
DT_COLORSPACE_ENHANCED_MATRIX 
DT_COLORSPACE_VENDOR_MATRIX 
DT_COLORSPACE_ALTERNATE_MATRIX 
DT_COLORSPACE_BRG 
DT_COLORSPACE_EXPORT 

Category placeholders: "whatever the export/softproof/work setting currently says".

These three ARE registered, with profile == NULL and with an EMPTY role mask – they exist to occupy a row in a combo box, not to be resolved. dt_colorspaces_get_profile() returns NULL for them, but not because it knows they are categories: its predicate tests the role mask, and theirs selects nothing. That omission is the entire reason a lookup cannot hand back an entry whose ->profile is NULL, which many call sites dereference unchecked. Giving categories a role of their own would break them all.

DT_COLORSPACE_SOFTPROOF 
DT_COLORSPACE_WORK 
DT_COLORSPACE_DISPLAY2 

Dead value, kept only because old params and conf keys contain it.

The second-display feature it belonged to is gone: there is no list entry, no backing position field, and dt_colorspaces_get_name() answers "Not used. Shouldn't be here." It cannot be deleted (the numbering is frozen), so it is remapped instead – see sanitize_colorspaces().

DT_COLORSPACE_REC709 
DT_COLORSPACE_PROPHOTO_RGB 
DT_COLORSPACE_PQ_REC2020 
DT_COLORSPACE_HLG_REC2020 
DT_COLORSPACE_PQ_P3 
DT_COLORSPACE_HLG_P3 
DT_COLORSPACE_ITUR_BT1886 
DT_COLORSPACE_DISPLAY_P3 
DT_COLORSPACE_LAST 

Count, not a colour space. The last usable value is DT_COLORSPACE_LAST - 1.

Definition at line 151 of file profile_types.h.

◆ dt_colorspaces_profile_role_t

Which use a profile is eligible for – the mandatory filter on every lookup and enumeration.

A bitmask, but read it as "which combo box would list this profile", not as a colour-management direction. That distinction matters because the module has two entries for DT_COLORSPACE_SRGB distinguished by nothing else (see DT_COLORSPACE_SRGB): the role is what picks between them, so it cannot be omitted or approximated.

A multi-bit mask resolves to the FIRST entry in registration order that serves any of its bits. Calls that return or consume a combo-box INDEX therefore require a single bit: an index means nothing outside the enumeration that produced it, and an index taken from INPUT|OUTPUT equals neither menu's row number.

Note
This used to be called a "direction", which it is not: a profile is RGB->PCS or PCS->RGB, and nothing else. What these bits select is which MENU an entry belongs to, and the menus genuinely differ from one another – see DT_PROFILE_ROLE_MONITOR. Two further bits, CATEGORY and DISPLAY2, were declared and never tested by any lookup: one had a position field no predicate consulted, the other had no field at all. They are gone, which changes nothing at runtime and stops DT_PROFILE_ROLE_ANY claiming six meanings when it had four.
Enumerator
DT_PROFILE_ROLE_INPUT 

Listed in the input-profile combo (colorin).

DT_PROFILE_ROLE_OUTPUT 

Listed in the output/export-profile combo (colorout, export).

DT_PROFILE_ROLE_MONITOR 

Eligible for the monitor-profile menu.

Not the same set as OUTPUT, which is why it exists. Of the 21 built-in registrations, five diverge: DT_COLORSPACE_DISPLAY is monitor-only, DT_COLORSPACE_REC709 and DT_COLORSPACE_ITUR_BT1886 are output-only, and DT_COLORSPACE_XYZ and DT_COLORSPACE_LAB become output-only once the allow_lab_output conf key gives them the OUTPUT role. Substituting one for the other is a behaviour change, not a rename.

DT_PROFILE_ROLE_WORKING 

Listed in the working-profile combo (colorin).

DT_PROFILE_ROLE_ANY 

All four roles, in registration order.

Multi-bit, so it returns the FIRST entry that serves any role – which for DT_COLORSPACE_SRGB, registered twice, is the v4 input-only variant. Never pass it when the answer will be used as a combo index, and never pass it when the caller means one specific role. It is the right answer only for "resolve this identity to a profile handle, I do not care which menu it appears in".

Definition at line 284 of file profile_types.h.

◆ dt_colorspaces_profile_type_t

Which of the five user-visible profile SLOTS a notification concerns.

Not a colour space: it names a role in the UI. Its only use is as the payload of DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, raised by colorin (input, working), the display actions (display) and the darkroom toolbox (softproof), and read back by listeners such as basicadj and the thumbtable. The signal bus carries it as a uint8_t.

Note
Numbering starts at 1: no member has the value 0, so a zero-initialised variable is not a valid slot and cannot accidentally compare equal to one.
DT_COLORSPACES_PROFILE_TYPE_EXPORT is declared but dead – nothing in the tree raises or tests it, so changing the export profile notifies no one. Kept for the numbering.
Enumerator
DT_COLORSPACES_PROFILE_TYPE_INPUT 
DT_COLORSPACES_PROFILE_TYPE_WORK 
DT_COLORSPACES_PROFILE_TYPE_EXPORT 
DT_COLORSPACES_PROFILE_TYPE_DISPLAY 
DT_COLORSPACES_PROFILE_TYPE_SOFTPROOF 

Definition at line 127 of file profile_types.h.

◆ dt_iop_color_intent_t

ICC rendering intent, as stored in iop params and in conf.

Spelled as literals rather than as lcms2's INTENT_* so this header needs no <lcms2.h> – the values are fixed by the ICC specification, and colorspaces.c static-asserts that they still match lcms2's (four _Static_asserts, one per intent). A divergence is therefore a compile error in the one translation unit that talks to lcms2, not a silently wrong render everywhere else.

Enumerator
DT_INTENT_PERCEPTUAL 
DT_INTENT_RELATIVE_COLORIMETRIC 
DT_INTENT_SATURATION 
DT_INTENT_ABSOLUTE_COLORIMETRIC 
DT_INTENT_LAST 

Count of real intents, and the codebase's "unset" marker – never a user choice.

dt_dev_pixelpipe_t::icc_intent is initialised to it, and colorout only lets the pipe override the module's own intent when pipe->icc_intent < DT_INTENT_LAST; ansel-cli returns it for an unrecognised --icc-intent string. Storing it in params would mean storing an out-of-range intent.

Definition at line 97 of file profile_types.h.

Function Documentation

◆ dt_colorspaces_is_raw_matrix_profile_type()

static gboolean dt_colorspaces_is_raw_matrix_profile_type ( const dt_colorspaces_color_profile_type_t  type)
inlinestatic

Is this one of the four camera-matrix profile kinds?

Matches DT_COLORSPACE_STANDARD_MATRIX, _ENHANCED_MATRIX, _VENDOR_MATRIX and _ALTERNATE_MATRIX – the types whose matrix comes from the camera data for one image, and which therefore have no entry in the profile list to resolve against.

Parameters
typethe profile type stored in a module's params.
Returns
TRUE for the four raw-matrix types only.
Note
Deliberately narrower than the image-derived range documented on DT_COLORSPACE_EMBEDDED_ICC: DT_COLORSPACE_EMBEDDED_ICC and DT_COLORSPACE_EMBEDDED_MATRIX are also unregistered, but they come from the file rather than from the camera database, so they are not covered here.
The one caller uses it to stay quiet rather than to select behaviour: colorin suppresses its "profile not found" warning when a stored raw-matrix type cannot be resolved on an image whose matrix correction is unsupported, which is an expected outcome and not a user error.

Definition at line 412 of file profile_types.h.

References DT_COLORSPACE_ALTERNATE_MATRIX, DT_COLORSPACE_ENHANCED_MATRIX, DT_COLORSPACE_STANDARD_MATRIX, DT_COLORSPACE_VENDOR_MATRIX, and type.

Referenced by gui_update().

◆ sanitize_colorspaces()

static dt_colorspaces_color_profile_type_t sanitize_colorspaces ( dt_colorspaces_color_profile_type_t  colorspace)
inlinestatic

Coerce an integer read back from storage into a colour space this build still has.

Two distinct rescues, both for values that were valid when they were written: DT_COLORSPACE_DISPLAY2 is remapped to DT_COLORSPACE_DISPLAY (the second-display feature is gone, but the number survives in old conf keys and params), and anything at or above DT_COLORSPACE_LAST – a file written by a newer build – is clamped to the last enumerator this build knows.

Parameters
colorspacethe stored value, typically straight out of dt_conf_get_int().
Returns
a value this build can look up. Not necessarily the caller's colour space: clamping silently substitutes DT_COLORSPACE_DISPLAY_P3 for anything unknown.
Warning
Only the upper end is clamped. DT_COLORSPACE_NONE (-1) passes through unchanged, which is intended, but so does any other negative value – MIN() cannot catch those. A caller that must reject garbage has to test for it separately.

Definition at line 386 of file profile_types.h.

References DT_COLORSPACE_DISPLAY, DT_COLORSPACE_DISPLAY2, DT_COLORSPACE_LAST, and MIN.

Referenced by _export_button_clicked().