Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dt_colorspaces_t Struct Reference

The module's private state. Declared here for the module's own .c files only. More...

#include <colorspaces.h>

+ Collaboration diagram for dt_colorspaces_t:

Data Fields

GList * profiles
 
gchar * colord_profile_file
 
uint8_t * xprofile_data
 
int xprofile_size
 
cmsHTRANSFORM transform_srgb_to_display
 
cmsHTRANSFORM transform_adobe_rgb_to_display
 
cmsHTRANSFORM transform_xyz_to_display
 
cmsHTRANSFORM transform_display_to_adobe_rgb
 
Settings group

The seven fields the GUI writes and the pipeline reads. Read them through dt_colorprofiles_get_settings() and write them through the setters, which serialise on a lock private to colorspaces.c. Reading them directly is seven unsynchronised loads, and a 512-byte filename read while g_strlcpy() is writing it is a TORN string, not merely a stale one.

dt_colorspaces_color_profile_type_t display_type
 
dt_colorspaces_color_profile_type_t softproof_type
 
char display_filename [512]
 
char softproof_filename [512]
 
dt_iop_color_intent_t display_intent
 
dt_iop_color_intent_t softproof_intent
 
dt_colorspaces_color_mode_t mode
 

Detailed Description

The module's private state. Declared here for the module's own .c files only.

Nothing outside src/colorprofiles/ names this type, and the single instance is file-static in colorspaces.c – there is no accessor for it in this header. It is documented because the module's own translation units share it, not because it is an interface.

Almost all of it is immutable after dt_colorprofiles_init(). Exactly two things mutate afterwards, both guarded by the transforms lock: the DT_COLORSPACE_DISPLAY entry's cmsHPROFILE, and the four prepared transforms derived from it.

Warning
LOCK ORDER, where both are involved: _transforms_lock OUTER, the settings lock (private to colorspaces.c) INNER. The display setters need both, because changing the display profile identity also rebuilds the four transforms. Nothing takes them the other way round.

Definition at line 136 of file colorspaces.h.

Field Documentation

◆ colord_profile_file

gchar* dt_colorspaces_t::colord_profile_file

Guards the DT_COLORSPACE_DISPLAY entry's cmsHPROFILE and the four transforms below – the only mutable state in the module. Do not take it by hand: use dt_colorspaces_lock_profiles() / dt_colorspaces_unlock_profiles(). Path colord last reported for this window, kept so an unchanged path costs nothing.

Definition at line 150 of file colorspaces.h.

Referenced by _colorspaces_destroy().

◆ display_filename

char dt_colorspaces_t::display_filename[512]

◆ display_intent

◆ display_type

◆ mode

◆ profiles

GList* dt_colorspaces_t::profiles

Every registered profile, as dt_colorspaces_color_profile_t *, in REGISTRATION order. That order is load-bearing: it is what dt_colorspaces_enumerate_profiles() reproduces and what every stored combo index in every preset and conf key refers to. Built once by init, sorted per directory batch before positions are handed out, and never appended to at runtime.

Definition at line 143 of file colorspaces.h.

Referenced by _colorspaces_destroy(), _get_profile(), _update_display_profile(), dt_colorspaces_enumerate_profiles(), dt_colorspaces_profile_at(), dt_colorspaces_profile_exists(), and dt_colorspaces_profile_index().

◆ softproof_filename

char dt_colorspaces_t::softproof_filename[512]

◆ softproof_intent

dt_iop_color_intent_t dt_colorspaces_t::softproof_intent

◆ softproof_type

◆ transform_adobe_rgb_to_display

cmsHTRANSFORM dt_colorspaces_t::transform_adobe_rgb_to_display

◆ transform_display_to_adobe_rgb

cmsHTRANSFORM dt_colorspaces_t::transform_display_to_adobe_rgb

◆ transform_srgb_to_display

cmsHTRANSFORM dt_colorspaces_t::transform_srgb_to_display

The prepared display transforms. Deleted and rebuilt in one go whenever the monitor profile or the display intent changes, so a borrowed handle can be freed under its user. They are reachable only through the entry points further down this header, each of which holds the read lock for the whole conversion.

Definition at line 179 of file colorspaces.h.

Referenced by _colorspaces_destroy(), _update_display_transforms(), dt_colorprofiles_rgba8_to_display_bgra8(), and dt_colorprofiles_srgb_to_display_strided().

◆ transform_xyz_to_display

cmsHTRANSFORM dt_colorspaces_t::transform_xyz_to_display

◆ xprofile_data

uint8_t* dt_colorspaces_t::xprofile_data

Raw bytes of the monitor profile last read from the xatom or colord, and their length. A new read is compared against these, and the transforms are rebuilt only when the bytes actually differ.

Definition at line 154 of file colorspaces.h.

Referenced by _colorspaces_destroy(), _update_display_profile(), and dt_colorspaces_set_display_profile().

◆ xprofile_size

int dt_colorspaces_t::xprofile_size

Definition at line 155 of file colorspaces.h.

Referenced by _update_display_profile(), and dt_colorspaces_set_display_profile().


The documentation for this struct was generated from the following file: