![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs, plus the identity they were derived from. More...
#include <iop_profile.h>
Collaboration diagram for dt_iop_order_iccprofile_info_t:Data Fields | |
| dt_colorspaces_color_profile_type_t | type |
| Profile identity, half of the memo key. DT_COLORSPACE_NONE means "unset" and makes every apply function below refuse the buffer rather than convert it. | |
| char | filename [DT_IOP_COLOR_ICC_LEN] |
ICC file name, the other half of the memo key; "" for every built-in. Compared with strcmp, so it must be NUL-terminated (g_strlcpy writes it). | |
| dt_iop_color_intent_t | intent |
Rendering intent, passed to cmsCreateTransform on the lcms2 fallback only. The matrix path ignores it – it is NOT part of the memo key, so the first caller to ask for a given (type, filename) fixes the intent every later caller gets. | |
| dt_colormatrix_t | matrix_in |
RGB -> XYZ (D50), row-major. matrix_in[1][*] is the luminance row. NaN in [0][0] marks the whole profile as non-matrix; see the struct warning. | |
| dt_colormatrix_t | matrix_out |
| XYZ (D50) -> RGB, row-major; the inverse of matrix_in. | |
| int | lutsize |
| Entry count of each of the six LUTs. Always 65536 in practice: both callers of dt_ioppr_init_profile_info() pass 0, which selects that default. | |
| float * | lut_in [3] |
Per-channel encoded -> linear tone curve, lutsize entries each, sampled over [0,1]. lut_in[c][0] < 0 marks channel c linear (no curve). Above 1.0 the curve is extrapolated from ::unbounded_coeffs_in instead; see dt_ioppr_eval_trc(). | |
| float * | lut_out [3] |
| Per-channel linear -> encoded tone curve, same convention as lut_in. | |
| float unbounded_coeffs_in[3][3] | DT_ALIGNED_PIXEL |
Power-law fit {a, b, c} of lut_in past 1.0, evaluated by eval_exp() as b * (a*x)^c. Fitted on x = {0.7, 0.8, 0.9, 1.0} by dt_ioppr_init_unbounded_coeffs(), which is what lets the pipeline carry values above white through a curve lcms2 would have clipped. [c][0] == -1.0f marks channel c as having no fit. | |
| float unbounded_coeffs_out[3][3] | DT_ALIGNED_PIXEL |
| Same fit for lut_out. | |
| int | nonlinearlut |
Non-zero when the profile has tone curves at all; tested as a boolean everywhere, but it is really the COUNT (0..3) of non-linear channels returned by dt_ioppr_init_unbounded_coeffs(), and it is taken from the INPUT curves only – the return value of the lut_out fit is discarded. A profile whose in-curves are linear but whose out-curves are not would therefore read as linear. | |
| float | grey |
| Luminance of 18.42% grey through this profile, used by the tone-mapping modules to place middle grey. Defaults to 0.1842 and is only recomputed (through matrix_in and lut_in) when the profile has both valid matrices AND nonlinearlut – so a linear matrix profile legitimately keeps the 0.1842 literal. | |
| dt_colormatrix_t | matrix_in_transposed |
| dt_colormatrix_t | matrix_out_transposed |
A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs, plus the identity they were derived from.
This is the DERIVED form of a profile, not the profile. It is produced once by dt_colorspaces_add_profile() from the cmsHPROFILE that colorprofiles/colorspaces.c owns, and from then on it is self-contained: nothing in it points back at lcms2, so the pixel loops below need no lock and no lcms2 call per pixel.
lut_in[3] + lut_out[3]), see dt_ioppr_init_profile_info(). develop/blend.c shallow-memcpys the struct onto the stack (dt_develop_blendif_init_masking_profile()), which ALIASES those six pointers into a second struct. Such a copy is read-only borrowed state: it must never be handed to dt_ioppr_cleanup_profile_info(), and the original must outlive it. Only the allocator of an instance may free it.isnan(matrix_in[0][0]) means "not a matrix-shaper profile, use lcms2" (dt_ioppr_mark_as_nonmatrix_profile()), and lut_x[c][0] < 0.0f means "channel c has no
tone curve, treat it as linear" (dt_ioppr_clear_lut_curves()). Code that memsets or calloc's one of these structs instead of calling dt_ioppr_init_profile_info() gets the opposite meaning for both. Definition at line 115 of file colorprofiles/iop_profile.h.
| float unbounded_coeffs_in [3][3] dt_iop_order_iccprofile_info_t::DT_ALIGNED_PIXEL |
Power-law fit {a, b, c} of lut_in past 1.0, evaluated by eval_exp() as b * (a*x)^c. Fitted on x = {0.7, 0.8, 0.9, 1.0} by dt_ioppr_init_unbounded_coeffs(), which is what lets the pipeline carry values above white through a curve lcms2 would have clipped. [c][0] == -1.0f marks channel c as having no fit.
Definition at line 148 of file colorprofiles/iop_profile.h.
| float unbounded_coeffs_out [3][3] dt_iop_order_iccprofile_info_t::DT_ALIGNED_PIXEL |
Same fit for lut_out.
Definition at line 150 of file colorprofiles/iop_profile.h.
| char dt_iop_order_iccprofile_info_t::filename[DT_IOP_COLOR_ICC_LEN] |
ICC file name, the other half of the memo key; "" for every built-in. Compared with strcmp, so it must be NUL-terminated (g_strlcpy writes it).
Definition at line 122 of file colorprofiles/iop_profile.h.
Referenced by _generate_curve_lut(), _generate_profile_info(), _get_current_work_profile_key(), _get_profile_info_from_list(), _ioporder_runtime_band_text(), _ioporder_same_runtime_profile(), _save_clut_callback(), commit_params(), dt_ioppr_init_profile_info(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), dt_ioppr_transform_image_colorspace_rgb_cl(), dt_ioppr_transform_lcms2(), update_modelines.modelines_updater_t::load_lines(), update_modelines.modelines_updater_t::remove_lines(), update_modelines.modelines_updater_t::update(), and update_modelines.modelines_updater_t::write_file().
| float dt_iop_order_iccprofile_info_t::grey |
Luminance of 18.42% grey through this profile, used by the tone-mapping modules to place middle grey. Defaults to 0.1842 and is only recomputed (through matrix_in and lut_in) when the profile has both valid matrices AND nonlinearlut – so a linear matrix profile legitimately keeps the 0.1842 literal.
Definition at line 162 of file colorprofiles/iop_profile.h.
Referenced by _generate_profile_info(), dt_ioppr_get_profile_info_cl(), dt_ioppr_init_profile_info(), dt_ioppr_set_pipe_input_profile_info(), and gui_init().
| dt_iop_color_intent_t dt_iop_order_iccprofile_info_t::intent |
Rendering intent, passed to cmsCreateTransform on the lcms2 fallback only. The matrix path ignores it – it is NOT part of the memo key, so the first caller to ask for a given (type, filename) fixes the intent every later caller gets.
Definition at line 126 of file colorprofiles/iop_profile.h.
Referenced by _generate_profile_info(), _get_current_work_profile_key(), _get_profile_info_from_list(), commit_params(), dt_ioppr_init_profile_info(), dt_ioppr_set_pipe_input_profile_info(), and dt_ioppr_transform_lcms2().
| float* dt_iop_order_iccprofile_info_t::lut_in[3] |
Per-channel encoded -> linear tone curve, lutsize entries each, sampled over [0,1]. lut_in[c][0] < 0 marks channel c linear (no curve). Above 1.0 the curve is extrapolated from ::unbounded_coeffs_in instead; see dt_ioppr_eval_trc().
Definition at line 141 of file colorprofiles/iop_profile.h.
Referenced by _add_node_from_picker(), _auto_set_exposure(), _blendif_cook(), _blendif_scale(), _color_picker_convert_buffer(), _extract_luminance_kernel(), _generate_profile_info(), _process_vectorscope(), _scope_pixel_to_xyz(), _transform_matrix_rgb(), _transform_rgb_to_lab_matrix(), _transform_single_rgb_matrix(), autoset(), color_picker_apply(), dt_colorrings_profile_rgb_to_display_rgb(), dt_colorrings_profile_rgb_to_dt_ucs_jch(), dt_colorrings_profile_rgb_to_Ych(), dt_develop_blendif_lab_blend(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_clear_lut_curves(), dt_ioppr_get_trc_cl(), dt_ioppr_init_profile_info(), dt_rgb_norm(), filmic_chroma_v1(), filmic_split_v1(), filmic_split_v2_v3(), picker_scale(), pipe_RGB_to_Ych(), process(), rt_adjust_levels(), and rt_process_stats().
| float* dt_iop_order_iccprofile_info_t::lut_out[3] |
Per-channel linear -> encoded tone curve, same convention as lut_in.
Definition at line 143 of file colorprofiles/iop_profile.h.
Referenced by _color_picker_convert_buffer(), _generate_profile_info(), _profile_linear_rgb_to_display_rgb_normalized(), _transform_lab_to_rgb_matrix(), _transform_matrix_rgb(), _transform_single_rgb_matrix(), _xyz_d50_to_profile_rgb(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_clear_lut_curves(), dt_ioppr_get_trc_cl(), dt_ioppr_init_profile_info(), gui_post_expose(), and rt_adjust_levels().
| int dt_iop_order_iccprofile_info_t::lutsize |
Entry count of each of the six LUTs. Always 65536 in practice: both callers of dt_ioppr_init_profile_info() pass 0, which selects that default.
lutsize would silently mismatch the device buffer. See dt_ioppr_build_iccprofile_params_cl(). Definition at line 137 of file colorprofiles/iop_profile.h.
Referenced by _add_node_from_picker(), _auto_set_exposure(), _blendif_cook(), _blendif_scale(), _color_picker_convert_buffer(), _extract_luminance_kernel(), _generate_profile_info(), _process_vectorscope(), _profile_linear_rgb_to_display_rgb_normalized(), _scope_pixel_to_xyz(), _transform_lab_to_rgb_matrix(), _transform_matrix_rgb(), _transform_rgb_to_lab_matrix(), _transform_single_rgb_matrix(), _xyz_d50_to_profile_rgb(), autoset(), color_picker_apply(), dt_colorrings_profile_rgb_to_display_rgb(), dt_colorrings_profile_rgb_to_dt_ucs_jch(), dt_colorrings_profile_rgb_to_Ych(), dt_develop_blendif_lab_blend(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_ioppr_init_profile_info(), dt_rgb_norm(), filmic_chroma_v1(), filmic_split_v1(), filmic_split_v2_v3(), gui_post_expose(), picker_scale(), pipe_RGB_to_Ych(), process(), rt_adjust_levels(), and rt_process_stats().
| dt_colormatrix_t dt_iop_order_iccprofile_info_t::matrix_in |
RGB -> XYZ (D50), row-major. matrix_in[1][*] is the luminance row. NaN in [0][0] marks the whole profile as non-matrix; see the struct warning.
Definition at line 129 of file colorprofiles/iop_profile.h.
Referenced by __attribute__(), _add_node_from_picker(), _auto_set_illuminant(), _blendif_cook(), _blendif_scale(), _extract_luminance_kernel(), _filmic_agx_build_displaced(), _filmic_get_output_profile(), _generate_profile_info(), _to_display_rgb(), _transform_matrix_rgb(), color_picker_apply(), commit_params(), dt_colorspaces_apply_profile(), dt_colorspaces_apply_profile_cl(), dt_develop_blendif_init_masking_profile(), dt_ioppr_get_profile_info_cl(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_set_pipe_output_profile_info(), dt_ioppr_set_pipe_work_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), dt_ioppr_transform_image_colorspace_rgb_cl(), dt_rgb_norm(), filmic_agx(), filmic_chroma_v1(), filmic_split_v1(), filmic_split_v2_v3(), picker_scale(), process(), process(), process_cl(), and workicc_changed().
| dt_colormatrix_t dt_iop_order_iccprofile_info_t::matrix_in_transposed |
Definition at line 163 of file colorprofiles/iop_profile.h.
Referenced by __attribute__(), _auto_set_exposure(), _build_cat16_rgb_matrix(), _color_picker_convert_buffer(), _generate_profile_info(), _process_vectorscope(), _render_preview_surface(), _sample_fits_gamut(), _scope_pixel_to_xyz(), _transform_rgb_to_lab_matrix(), _transform_single_rgb_matrix(), autoset(), commit_params(), dt_colorrings_profile_rgb_to_display_rgb(), dt_colorrings_profile_rgb_to_dt_ucs_jch(), dt_colorrings_profile_rgb_to_Ych(), dt_develop_blendif_lab_blend(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_set_pipe_input_profile_info(), pipe_RGB_to_Ych(), rt_adjust_levels(), and rt_process_stats().
| dt_colormatrix_t dt_iop_order_iccprofile_info_t::matrix_out |
XYZ (D50) -> RGB, row-major; the inverse of matrix_in.
Definition at line 131 of file colorprofiles/iop_profile.h.
Referenced by __attribute__(), _filmic_agx_build_displaced(), _filmic_get_output_profile(), _generate_profile_info(), _to_display_rgb(), _transform_matrix_rgb(), dt_colorspaces_apply_profile(), dt_colorspaces_apply_profile_cl(), dt_develop_blendif_init_masking_profile(), dt_ioppr_get_profile_info_cl(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_set_pipe_output_profile_info(), dt_ioppr_set_pipe_work_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), dt_ioppr_transform_image_colorspace_rgb_cl(), process(), process(), process_cl(), and workicc_changed().
| dt_colormatrix_t dt_iop_order_iccprofile_info_t::matrix_out_transposed |
Definition at line 164 of file colorprofiles/iop_profile.h.
Referenced by __attribute__(), _build_cat16_rgb_matrix(), _color_picker_convert_buffer(), _create_vectorscope_image(), _generate_profile_info(), _process_vectorscope(), _transform_lab_to_rgb_matrix(), _transform_single_rgb_matrix(), _xyz_d50_to_profile_linear_rgb(), _xyz_d50_to_profile_rgb(), dt_develop_blendif_init_masking_profile(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_set_pipe_input_profile_info(), gui_post_expose(), and rt_adjust_levels().
| int dt_iop_order_iccprofile_info_t::nonlinearlut |
Non-zero when the profile has tone curves at all; tested as a boolean everywhere, but it is really the COUNT (0..3) of non-linear channels returned by dt_ioppr_init_unbounded_coeffs(), and it is taken from the INPUT curves only – the return value of the lut_out fit is discarded. A profile whose in-curves are linear but whose out-curves are not would therefore read as linear.
Definition at line 156 of file colorprofiles/iop_profile.h.
Referenced by _add_node_from_picker(), _auto_set_exposure(), _blendif_cook(), _blendif_scale(), _color_picker_convert_buffer(), _extract_luminance_kernel(), _generate_profile_info(), _process_vectorscope(), _profile_linear_rgb_to_display_rgb_normalized(), _scope_pixel_to_xyz(), _transform_lab_to_rgb_matrix(), _transform_matrix_rgb(), _transform_rgb_to_lab_matrix(), _transform_single_rgb_matrix(), _xyz_d50_to_profile_rgb(), autoset(), color_picker_apply(), dt_colorrings_profile_rgb_to_display_rgb(), dt_colorrings_profile_rgb_to_dt_ucs_jch(), dt_colorrings_profile_rgb_to_Ych(), dt_develop_blendif_lab_blend(), dt_iop_channelmixer_shared_work_rgb_to_display(), dt_ioppr_get_profile_info_cl(), dt_ioppr_init_profile_info(), dt_ioppr_set_pipe_input_profile_info(), dt_rgb_norm(), filmic_chroma_v1(), filmic_split_v1(), filmic_split_v2_v3(), gui_post_expose(), picker_scale(), pipe_RGB_to_Ych(), process(), rt_adjust_levels(), and rt_process_stats().
| dt_colorspaces_color_profile_type_t dt_iop_order_iccprofile_info_t::type |
Profile identity, half of the memo key. DT_COLORSPACE_NONE means "unset" and makes every apply function below refuse the buffer rather than convert it.
Definition at line 119 of file colorprofiles/iop_profile.h.
Referenced by _gamut_matches_lut_profile(), _generate_curve_lut(), _generate_profile_info(), _get_current_work_profile_key(), _get_profile_info_from_list(), _ioporder_runtime_band_text(), _ioporder_same_runtime_profile(), _save_clut_callback(), commit_params(), dt_colorspaces_apply_profile(), dt_colorspaces_apply_profile_cl(), dt_colorspaces_invalidate_display_profile_memo(), dt_ioppr_init_profile_info(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), dt_ioppr_transform_image_colorspace_rgb_cl(), and dt_ioppr_transform_lcms2().