![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
One registered profile: its identity, its LCMS handle, and where it sits in each combo box. More...
#include <colorspaces.h>
Collaboration diagram for dt_colorspaces_color_profile_t:Data Fields | |
| pthread_rwlock_t | lock |
| Guards profile, and nothing else in this struct. | |
| gboolean | owns_profile |
| dt_colorspaces_color_profile_type_t | type |
| filename is only used for type DT_COLORSPACE_FILE | |
| char | filename [DT_IOP_COLOR_ICC_LEN] |
| icc file name (absolute; compare with dt_colorspaces_is_profile_equal()) | |
| char | name [512] |
| product name, displayed in GUI (translated for built-ins) | |
| cmsHPROFILE | profile |
| the actual profile; NULL for the three category entries | |
| dt_colorspaces_profile_role_t | roles |
| Which menus this entry appears in, as a dt_colorspaces_profile_role_t mask. | |
One registered profile: its identity, its LCMS handle, and where it sits in each combo box.
Entries in the application-wide list are created once at init and freed by dt_colorprofiles_cleanup() (through _colorspaces_destroy(), which closes every profile it finds). The same struct is also used for a container belonging to ONE image – see dt_colorspaces_new_image_profile() – and those set every *_pos to -1 so they are invisible to enumeration by construction.
profile == NULL: the categories DT_COLORSPACE_WORK, DT_COLORSPACE_EXPORT and DT_COLORSPACE_SOFTPROOF, which name a user setting rather than a colour space. Nothing NULL-checks the handle at ~40 call sites that dereference ->profile; what actually keeps them safe is that lookup never gives the category entries a role (see roles), so a category entry can never be returned. Do not "fix" the lookup predicate to consult them a role of their own without auditing those sites first. Definition at line 201 of file colorspaces.h.
| char dt_colorspaces_color_profile_t::filename[DT_IOP_COLOR_ICC_LEN] |
icc file name (absolute; compare with dt_colorspaces_is_profile_equal())
Definition at line 224 of file colorspaces.h.
Referenced by _get_profile(), _hash_endpoint(), _profile_choice_differs(), dt_colorprofiles_set_display_profile_choice(), dt_colorprofiles_set_softproof_profile_choice(), dt_colorspaces_cicp_to_type(), dt_colorspaces_get_name(), dt_colorspaces_get_profile(), dt_colorspaces_is_profile_equal(), dt_colorspaces_profile_exists(), dt_colorspaces_profile_index(), update_modelines.modelines_updater_t::load_lines(), load_profile_from_dir(), update_modelines.modelines_updater_t::remove_lines(), update_modelines.modelines_updater_t::update(), and update_modelines.modelines_updater_t::write_file().
| pthread_rwlock_t dt_colorspaces_color_profile_t::lock |
Guards profile, and nothing else in this struct.
TRUE when this container created profile and must close it. FALSE when profile is borrowed from the application-wide list, which owns and closes it – see dt_image_find_best_color_profile(), several of whose branches hand back a pointer into that list rather than a fresh profile. Only per-image containers set this; entries in the application list are freed by dt_colorprofiles_cleanup() as they always were.
Per ENTRY, not per module. Only the DT_COLORSPACE_DISPLAY entry's handle is actually replaced at runtime (by the monitor-profile refresh), but a caller deriving from any profile takes this rather than a module-wide lock, so a thumbnail conversion running against sRGB does not stand between a monitor change and the display entry.
Take it with dt_colorspaces_lock_profile() / dt_colorspaces_unlock_profile(); do not touch it directly. The rest of the struct – type, filename, name, the positions – is fixed at registration and needs no lock.
Definition at line 221 of file colorspaces.h.
Referenced by _create_profile().
| char dt_colorspaces_color_profile_t::name[512] |
product name, displayed in GUI (translated for built-ins)
Definition at line 225 of file colorspaces.h.
Referenced by _colorspaces_build(), _create_profile(), _sort_profiles(), and load_profile_from_dir().
| gboolean dt_colorspaces_color_profile_t::owns_profile |
Definition at line 222 of file colorspaces.h.
Referenced by dt_colorspaces_new_image_profile().
| cmsHPROFILE dt_colorspaces_color_profile_t::profile |
the actual profile; NULL for the three category entries
Definition at line 226 of file colorspaces.h.
Referenced by _colorspaces_build(), _colorspaces_get_base_name(), _colorspaces_is_base_name(), _create_profile(), _ensure_rgb_profile(), _export_image(), _generate_profile_info(), _get_xyz_to_rgb_matrix(), _icc_blob_from_profile_key(), _read_chunky_16_Lab(), _read_chunky_8_Lab(), _resolve_endpoint(), _transform_from_to_rgb_lab_lcms2(), _update_display_profile(), _update_display_transforms(), dt_colorprofiles_bgra8_to_adobergb_rgba8(), dt_colorprofiles_rgba8_to_display_bgra8(), dt_colorspaces_create_xyzmatrix_profile(), dt_colorspaces_free_image_profile(), dt_colorspaces_get_rgb_profile_from_mem(), dt_colorspaces_lock_profile(), dt_colorspaces_new_image_profile(), dt_colorspaces_unlock_profile(), dt_image_find_best_color_profile(), dt_image_get_embedded_output_profile(), dt_image_get_input_profile(), dt_imageio_jpeg_write_with_icc_profile(), dt_imageio_tiff_read_profile(), gui_init(), load_profile_from_dir(), write_image(), write_image(), write_image(), write_image(), write_image(), write_image(), and write_image().
| dt_colorspaces_profile_role_t dt_colorspaces_color_profile_t::roles |
Which menus this entry appears in, as a dt_colorspaces_profile_role_t mask.
This used to be five separate int *_pos fields holding a combo-box row number per menu, with -1 meaning "not in this one". Nothing ever read the numbers: every lookup and every enumeration only asked whether one was >= 0. The positions were therefore a second, hand-maintained copy of a fact the list order already carries – enumeration walks the list in registration order, so the k-th entry serving a role IS row k – and keeping them in step meant threading five ++counters through twenty registration calls in the right order.
Zero means no menu, which is what an image-owned container gets (see dt_colorspaces_new_image_profile()) and what makes it unreachable by any lookup. The three category entries are zero too, which is what keeps their profile == NULL away from the call sites that dereference it unchecked.
Definition at line 242 of file colorspaces.h.
Referenced by _colorspaces_build(), _create_profile(), and load_profile_from_dir().
| dt_colorspaces_color_profile_type_t dt_colorspaces_color_profile_t::type |
filename is only used for type DT_COLORSPACE_FILE
Definition at line 223 of file colorspaces.h.
Referenced by _create_profile(), _hash_endpoint(), commit_params(), and load_profile_from_dir().