![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/colorspaces.h"#include "common/darktable.h"#include "common/iop_profile.h"#include "common/debug.h"#include "common/matrices.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/pixelpipe.h"#include "develop/develop.h"#include <assert.h>#include <stdio.h>#include <stdlib.h>#include <string.h>
Include dependency graph for iop_profile.c:Go to the source code of this file.
Macros | |
| #define | DT_IOPPR_LUT_SAMPLES 0x10000 |
Functions | |
| static | __attribute__ ((always_inline)) |
| static __DT_CLONE_TARGETS__ void | _clear_lut_curves (dt_iop_order_iccprofile_info_t *const profile_info) |
| static void | _transform_from_to_rgb_lab_lcms2 (const float *const image_in, float *const image_out, const int width, const int height, const dt_colorspaces_color_profile_type_t type, const char *filename, const int intent, const int direction) |
| static void | _transform_lcms2 (struct dt_iop_module_t *self, const float *const image_in, float *const image_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info) |
| static int | _init_unbounded_coeffs (float *const lutr, float *const lutg, float *const lutb, float *const unbounded_coeffsr, float *const unbounded_coeffsg, float *const unbounded_coeffsb, const int lutsize) |
| static void | _apply_tonecurves (const float *const image_in, float *const image_out, const int width, const int height, const float *const restrict lutr, const float *const restrict lutg, const float *const restrict lutb, const float *const restrict unbounded_coeffsr, const float *const restrict unbounded_coeffsg, const float *const restrict unbounded_coeffsb, const int lutsize) |
| static __DT_CLONE_TARGETS__ void | _transform_rgb_to_lab_matrix (const float *const restrict image_in, float *const restrict image_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info) |
| static __DT_CLONE_TARGETS__ void | _transform_lab_to_rgb_matrix (const float *const image_in, float *const image_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info) |
| static __DT_CLONE_TARGETS__ void | _transform_matrix_rgb (const float *const restrict image_in, float *const restrict image_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info_from, const dt_iop_order_iccprofile_info_t *const profile_info_to) |
| static void | _transform_matrix (struct dt_iop_module_t *self, const float *const restrict image_in, float *const restrict image_out, const int width, const int height, const dt_iop_colorspace_type_t cst_from, const dt_iop_colorspace_type_t cst_to, dt_iop_colorspace_type_t *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info) |
| __DT_CLONE_TARGETS__ void | dt_ioppr_init_profile_info (dt_iop_order_iccprofile_info_t *profile_info, const int lutsize) |
| void | dt_ioppr_cleanup_profile_info (dt_iop_order_iccprofile_info_t *profile_info) |
| static __DT_CLONE_TARGETS__ int | dt_ioppr_generate_profile_info (dt_iop_order_iccprofile_info_t *profile_info, const int type, const char *filename, const int intent) |
| __DT_CLONE_TARGETS__ dt_iop_order_iccprofile_info_t * | dt_ioppr_get_profile_info_from_list (struct dt_develop_t *dev, const dt_colorspaces_color_profile_type_t profile_type, const char *profile_filename) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_add_profile_info_to_list (struct dt_develop_t *dev, const dt_colorspaces_color_profile_type_t profile_type, const char *profile_filename, const int intent) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_get_iop_work_profile_info (struct dt_iop_module_t *module, GList *iop_list) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_set_pipe_work_profile_info (struct dt_develop_t *dev, struct dt_dev_pixelpipe_t *pipe, const dt_colorspaces_color_profile_type_t type, const char *filename, const int intent) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_set_pipe_input_profile_info (struct dt_develop_t *dev, struct dt_dev_pixelpipe_t *pipe, const dt_colorspaces_color_profile_type_t type, const char *filename, const int intent, const dt_colormatrix_t matrix_in) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_set_pipe_output_profile_info (struct dt_develop_t *dev, struct dt_dev_pixelpipe_t *pipe, const dt_colorspaces_color_profile_type_t type, const char *filename, const int intent) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_work_profile_info (const struct dt_dev_pixelpipe_t *pipe) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_input_profile_info (const struct dt_dev_pixelpipe_t *pipe) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_output_profile_info (const struct dt_dev_pixelpipe_t *pipe) |
| dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_current_profile_info (dt_iop_module_t *module, const struct dt_dev_pixelpipe_t *pipe) |
| void | dt_ioppr_get_work_profile_type (struct dt_develop_t *dev, dt_colorspaces_color_profile_type_t *profile_type, const char **profile_filename) |
| void | dt_ioppr_get_export_profile_type (struct dt_develop_t *dev, dt_colorspaces_color_profile_type_t *profile_type, const char **profile_filename) |
| void | dt_ioppr_transform_image_colorspace (struct dt_iop_module_t *self, const float *const image_in, float *const image_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info) |
| void | dt_ioppr_transform_image_colorspace_rgb (const float *const restrict image_in, float *const restrict image_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info_from, const dt_iop_order_iccprofile_info_t *const profile_info_to, const char *message) |
| dt_colorspaces_cl_global_t * | dt_colorspaces_init_cl_global () |
| void | dt_colorspaces_free_cl_global (dt_colorspaces_cl_global_t *g) |
| void | dt_ioppr_get_profile_info_cl (const dt_iop_order_iccprofile_info_t *const profile_info, dt_colorspaces_iccprofile_info_cl_t *profile_info_cl) |
| cl_float * | dt_ioppr_get_trc_cl (const dt_iop_order_iccprofile_info_t *const profile_info) |
| cl_int | dt_ioppr_build_iccprofile_params_cl (const dt_iop_order_iccprofile_info_t *const profile_info, const int devid, dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut) |
| void | dt_ioppr_free_iccprofile_params_cl (dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut) |
| int | dt_ioppr_transform_image_colorspace_cl (struct dt_iop_module_t *self, const int devid, cl_mem dev_img_in, cl_mem dev_img_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info) |
| int | dt_ioppr_transform_image_colorspace_rgb_cl (const int devid, cl_mem dev_img_in, cl_mem dev_img_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info_from, const dt_iop_order_iccprofile_info_t *const profile_info_to, const char *message) |
| #define DT_IOPPR_LUT_SAMPLES 0x10000 |
Definition at line 574 of file iop_profile.c.
|
inlinestatic |
Definition at line 58 of file iop_profile.c.
References dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::matrix_out, and dt_iop_order_iccprofile_info_t::matrix_out_transposed.
|
inlinestatic |
Definition at line 307 of file iop_profile.c.
References __OMP_PARALLEL_FOR__, ch, height, k, lut, lutsize, unbounded_coeffs, and width.
Referenced by _transform_lab_to_rgb_matrix(), and _transform_rgb_to_lab_matrix().
|
static |
Definition at line 67 of file iop_profile.c.
References i, dt_iop_order_iccprofile_info_t::lut_in, and dt_iop_order_iccprofile_info_t::lut_out.
Referenced by dt_ioppr_generate_profile_info().
|
inlinestatic |
Definition at line 278 of file iop_profile.c.
References dt_iop_estimate_exp(), k, lut, lutsize, unbounded_coeffs, and x.
Referenced by dt_ioppr_generate_profile_info().
|
static |
Definition at line 76 of file iop_profile.c.
References darktable_t::color_profiles, darktable, DT_COLORSPACE_DISPLAY, DT_COLORSPACE_LAB, DT_COLORSPACE_LIN_REC2020, DT_COLORSPACE_NONE, dt_colorspaces_get_profile(), dt_colorspaces_transform_rgba_float_image(), DT_PROFILE_DIRECTION_ANY, DT_PROFILE_DIRECTION_WORK, height, input_format(), IS_NULL_PTR, output_format(), dt_colorspaces_color_profile_t::profile, type, width, and dt_colorspaces_t::xprofile_lock.
Referenced by _transform_lcms2().
|
inlinestatic |
Definition at line 398 of file iop_profile.c.
References __OMP_PARALLEL_FOR__, _apply_tonecurves(), ch, dt_Lab_to_XYZ(), dt_omploop_sfence, dt_store_simd_aligned(), height, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, out, rgb, and width.
Referenced by _transform_matrix().
|
static |
Definition at line 234 of file iop_profile.c.
References _transform_from_to_rgb_lab_lcms2(), DT_DEBUG_DEV, dt_iop_colorspace_is_rgb(), dt_print(), dt_iop_order_iccprofile_info_t::filename, height, dt_iop_order_iccprofile_info_t::intent, IOP_CS_LAB, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_iop_order_iccprofile_info_t::type, and width.
Referenced by dt_ioppr_transform_image_colorspace().
|
inlinestatic |
Definition at line 541 of file iop_profile.c.
References _transform_lab_to_rgb_matrix(), _transform_rgb_to_lab_matrix(), dt_iop_colorspace_is_rgb(), height, IOP_CS_LAB, and width.
Referenced by dt_ioppr_transform_image_colorspace().
|
inlinestatic |
Definition at line 442 of file iop_profile.c.
References __OMP_PARALLEL_FOR__, ch, DT_ALIGNED_PIXEL, dt_colormatrix_mul(), dt_omploop_sfence, dt_store_simd_aligned(), for_each_channel, height, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, matrix, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_order_iccprofile_info_t::nonlinearlut, out, rgb, transpose_3xSSE(), and width.
Referenced by dt_ioppr_transform_image_colorspace_rgb().
|
inlinestatic |
Definition at line 352 of file iop_profile.c.
References __OMP_PARALLEL_FOR_SIMD__, _apply_tonecurves(), ch, dt_store_simd_aligned(), dt_XYZ_to_Lab(), height, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, out, and width.
Referenced by _transform_matrix().
| void dt_colorspaces_free_cl_global | ( | dt_colorspaces_cl_global_t * | g | ) |
Definition at line 1121 of file iop_profile.c.
References dt_free, dt_opencl_free_kernel(), g, and IS_NULL_PTR.
Referenced by dt_opencl_cleanup().
| dt_colorspaces_cl_global_t * dt_colorspaces_init_cl_global | ( | void | ) |
Definition at line 1109 of file iop_profile.c.
References dt_opencl_create_kernel(), g, and dt_colorspaces_cl_global_t::kernel_colorspaces_transform_lab_to_rgb_matrix.
Referenced by dt_opencl_init().
| dt_iop_order_iccprofile_info_t * dt_ioppr_add_profile_info_to_list | ( | struct dt_develop_t * | dev, |
| const dt_colorspaces_color_profile_type_t | profile_type, | ||
| const char * | profile_filename, | ||
| const int | intent | ||
| ) |
adds the profile info from (profile_type, profile_filename) to the dev profiles info list if not already exists returns the generated profile or the existing one
Definition at line 723 of file iop_profile.c.
References dt_develop_t::allprofile_info, dt_alloc_align(), dt_free_align, dt_ioppr_generate_profile_info(), dt_ioppr_get_profile_info_from_list(), dt_ioppr_init_profile_info(), and IS_NULL_PTR.
Referenced by _refresh_slider_gradients(), _update_gui_lut_cache(), _update_gui_lut_cache(), commit_params(), dt_ioppr_get_iop_work_profile_info(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_set_pipe_output_profile_info(), dt_ioppr_set_pipe_work_profile_info(), process(), process(), process_cl(), and workicc_changed().
| cl_int dt_ioppr_build_iccprofile_params_cl | ( | const dt_iop_order_iccprofile_info_t *const | profile_info, |
| const int | devid, | ||
| dt_colorspaces_iccprofile_info_cl_t ** | _profile_info_cl, | ||
| cl_float ** | _profile_lut_cl, | ||
| cl_mem * | _dev_profile_info, | ||
| cl_mem * | _dev_profile_lut | ||
| ) |
build the required parameters for a kernel that uses a profile info
Definition at line 1169 of file iop_profile.c.
References cleanup(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), and IS_NULL_PTR.
Referenced by dt_develop_blend_process_cl(), and process_cl().
| void dt_ioppr_cleanup_profile_info | ( | dt_iop_order_iccprofile_info_t * | profile_info | ) |
must be called when done with profile_info
Definition at line 599 of file iop_profile.c.
References dt_free_align, i, dt_iop_order_iccprofile_info_t::lut_in, and dt_iop_order_iccprofile_info_t::lut_out.
Referenced by dt_dev_cleanup().
| void dt_ioppr_free_iccprofile_params_cl | ( | dt_colorspaces_iccprofile_info_cl_t ** | _profile_info_cl, |
| cl_float ** | _profile_lut_cl, | ||
| cl_mem * | _dev_profile_info, | ||
| cl_mem * | _dev_profile_lut | ||
| ) |
free parameters build with the previous function
Definition at line 1224 of file iop_profile.c.
References dt_free, and dt_opencl_release_mem_object().
Referenced by dt_develop_blend_process_cl(), and process_cl().
|
static |
generate the info for the profile (type, filename) if matrix can be retrieved from lcms2 it can be called multiple time between init and cleanup return 0 if OK, non zero otherwise
Definition at line 615 of file iop_profile.c.
References _clear_lut_curves(), _init_unbounded_coeffs(), darktable_t::color_profiles, darktable, DT_COLORSPACE_DISPLAY, dt_colorspaces_get_matrix_from_input_profile(), dt_colorspaces_get_matrix_from_output_profile(), dt_colorspaces_get_profile(), DT_PROFILE_DIRECTION_ANY, dt_iop_order_iccprofile_info_t::filename, dt_iop_order_iccprofile_info_t::grey, dt_iop_order_iccprofile_info_t::intent, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_colorspaces_color_profile_t::profile, rgb, transpose_3xSSE(), dt_iop_order_iccprofile_info_t::type, type, and dt_colorspaces_t::xprofile_lock.
Referenced by dt_ioppr_add_profile_info_to_list().
| void dt_ioppr_get_export_profile_type | ( | struct dt_develop_t * | dev, |
| dt_colorspaces_color_profile_type_t * | profile_type, | ||
| const char ** | profile_filename | ||
| ) |
returns the current setting of the export profile on colorout iop
Definition at line 952 of file iop_profile.c.
References darktable, DT_COLORSPACE_NONE, darktable_t::iop, dt_develop_t::iop, dt_iop_module_so_t::op, and dt_iop_module_t::params.
| dt_iop_order_iccprofile_info_t * dt_ioppr_get_iop_work_profile_info | ( | struct dt_iop_module_t * | module, |
| GList * | iop_list | ||
| ) |
returns a reference to the work profile info as set on colorin iop only if module is between colorin and colorout, otherwise returns NULL work profile must not be cleanup()
Definition at line 747 of file iop_profile.c.
References DT_COLORSPACE_NONE, DT_INTENT_PERCEPTUAL, dt_ioppr_add_profile_info_to_list(), dt_ioppr_get_work_profile_type(), FALSE, dt_iop_module_t::op, TRUE, and type.
Referenced by _area_draw_callback(), _brush_pipeline_color_from_display(), _draw_color_picker(), _get_current_work_profile_key(), _signal_profile_user_changed(), _update_gradient_slider_pickers(), _working_rgb_to_display_rgb(), autoset(), color_picker_apply(), dt_develop_blendif_init_masking_profile(), gui_changed(), process(), process(), process_cl(), process_fusion(), and process_lut().
| dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_current_profile_info | ( | struct dt_iop_module_t * | module, |
| const struct dt_dev_pixelpipe_t * | pipe | ||
| ) |
Get the relevant RGB -> XYZ profile at the position of current module
Definition at line 884 of file iop_profile.c.
References dt_iop_module_t::dev, dt_ioppr_get_iop_order(), dt_ioppr_get_pipe_input_profile_info(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_get_pipe_work_profile_info(), and dt_develop_t::iop_order_list.
Referenced by _auto_set_illuminant(), _pipe_rgb_to_dt_ucs_hsb(), _pipe_rgb_to_Ych(), _pipe_rgb_to_Ych(), _refresh_preview_cursor_sample(), _sample_picker_buffer(), _update_gradient_slider_pickers(), _work_rgb_to_display_rgb(), autoset(), color_picker_apply(), commit_params(), commit_params(), dt_develop_blendif_init_masking_profile(), pipe_RGB_to_Ych(), process(), process(), and process_cl().
| dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_input_profile_info | ( | const struct dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 874 of file iop_profile.c.
References dt_dev_pixelpipe_t::input_profile_info.
Referenced by _auto_set_exposure(), _ioporder_runtime_band_profile_info(), autoset(), commit_params(), dt_ioppr_get_pipe_current_profile_info(), and process().
| dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_output_profile_info | ( | const struct dt_dev_pixelpipe_t * | pipe | ) |
Definition at line 879 of file iop_profile.c.
References dt_dev_pixelpipe_t::output_profile_info.
Referenced by _area_draw_callback(), _brush_pipeline_color_from_display(), _channelmixerrgb_update_primaries_colors(), _channelmixerrgb_update_simple_colors(), _draw_color_picker(), _draw_curve(), _ioporder_runtime_band_profile_info(), _refresh_slider_gradients(), _render_preview_surface(), _update_gui_lut_cache(), _update_gui_lut_cache(), _update_point_slider_colors(), _update_RGB_colors(), _work_rgb_to_display_rgb(), _working_rgb_to_display_rgb(), dt_ioppr_get_pipe_current_profile_info(), gui_post_expose(), process(), and process_cl().
| dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_work_profile_info | ( | const struct dt_dev_pixelpipe_t * | pipe | ) |
returns the active work/input/output profile on the pipe
Definition at line 869 of file iop_profile.c.
References dt_dev_pixelpipe_t::work_profile_info.
Referenced by _channelmixerrgb_update_primaries_colors(), _channelmixerrgb_update_simple_colors(), _generate_curve_lut(), _ioporder_runtime_band_profile_info(), _refresh_module_histogram(), _refresh_preview_module_histogram_for_hash(), _render_preview_surface(), _retouch_blur(), _update_point_slider_colors(), _update_RGB_colors(), color_picker_apply(), commit_params(), dt_develop_blend_process_cl(), dt_develop_blendif_lab_blend(), dt_ioppr_get_pipe_current_profile_info(), pixelpipe_process_on_CPU(), pixelpipe_process_on_GPU(), process(), process(), process(), process_cl(), rt_adjust_levels(), and rt_process_stats().
| void dt_ioppr_get_profile_info_cl | ( | const dt_iop_order_iccprofile_info_t *const | profile_info, |
| dt_colorspaces_iccprofile_info_cl_t * | profile_info_cl | ||
| ) |
sets profile_info_cl using profile_info to be used as a parameter when calling opencl
Definition at line 1133 of file iop_profile.c.
References dt_colorspaces_iccprofile_info_cl_t::grey, dt_iop_order_iccprofile_info_t::grey, i, dt_colorspaces_iccprofile_info_cl_t::lutsize, dt_iop_order_iccprofile_info_t::lutsize, dt_colorspaces_iccprofile_info_cl_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_in, dt_colorspaces_iccprofile_info_cl_t::matrix_out, dt_iop_order_iccprofile_info_t::matrix_out, dt_colorspaces_iccprofile_info_cl_t::nonlinearlut, dt_iop_order_iccprofile_info_t::nonlinearlut, dt_colorspaces_iccprofile_info_cl_t::unbounded_coeffs_in, and dt_colorspaces_iccprofile_info_cl_t::unbounded_coeffs_out.
Referenced by dt_ioppr_build_iccprofile_params_cl(), dt_ioppr_transform_image_colorspace_cl(), and dt_ioppr_transform_image_colorspace_rgb_cl().
| __DT_CLONE_TARGETS__ dt_iop_order_iccprofile_info_t * dt_ioppr_get_profile_info_from_list | ( | struct dt_develop_t * | dev, |
| dt_colorspaces_color_profile_type_t | profile_type, | ||
| const char * | profile_filename | ||
| ) |
returns the profile info from dev profiles info list that matches (profile_type, profile_filename) NULL if not found
Definition at line 703 of file iop_profile.c.
References dt_develop_t::allprofile_info, dt_iop_order_iccprofile_info_t::filename, and dt_iop_order_iccprofile_info_t::type.
Referenced by dt_ioppr_add_profile_info_to_list().
| cl_float * dt_ioppr_get_trc_cl | ( | const dt_iop_order_iccprofile_info_t *const | profile_info | ) |
returns the profile_info trc to be used as a parameter when calling opencl
Definition at line 1153 of file iop_profile.c.
References dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, and x.
Referenced by dt_ioppr_build_iccprofile_params_cl(), dt_ioppr_transform_image_colorspace_cl(), and dt_ioppr_transform_image_colorspace_rgb_cl().
| void dt_ioppr_get_work_profile_type | ( | struct dt_develop_t * | dev, |
| dt_colorspaces_color_profile_type_t * | profile_type, | ||
| const char ** | profile_filename | ||
| ) |
returns the current setting of the work profile on colorin iop
Definition at line 905 of file iop_profile.c.
References darktable, DT_COLORSPACE_NONE, darktable_t::iop, dt_develop_t::iop, dt_iop_module_so_t::op, and dt_iop_module_t::params.
Referenced by commit_params(), and dt_ioppr_get_iop_work_profile_info().
| __DT_CLONE_TARGETS__ void dt_ioppr_init_profile_info | ( | dt_iop_order_iccprofile_info_t * | profile_info, |
| const int | lutsize | ||
| ) |
must be called before using profile_info, default lutsize = 0
Definition at line 577 of file iop_profile.c.
References dt_alloc_align_float(), DT_COLORSPACE_NONE, DT_INTENT_PERCEPTUAL, DT_IOPPR_LUT_SAMPLES, dt_iop_order_iccprofile_info_t::filename, dt_iop_order_iccprofile_info_t::grey, i, dt_iop_order_iccprofile_info_t::intent, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lut_out, dt_iop_order_iccprofile_info_t::lutsize, lutsize, dt_iop_order_iccprofile_info_t::nonlinearlut, and dt_iop_order_iccprofile_info_t::type.
Referenced by dt_ioppr_add_profile_info_to_list().
| dt_iop_order_iccprofile_info_t * dt_ioppr_set_pipe_input_profile_info | ( | struct dt_develop_t * | dev, |
| struct dt_dev_pixelpipe_t * | pipe, | ||
| const dt_colorspaces_color_profile_type_t | type, | ||
| const char * | filename, | ||
| const int | intent, | ||
| const dt_colormatrix_t | matrix_in | ||
| ) |
Definition at line 809 of file iop_profile.c.
References DT_COLORSPACE_ALTERNATE_MATRIX, DT_COLORSPACE_EMBEDDED_ICC, DT_COLORSPACE_LIN_REC2020, dt_ioppr_add_profile_info_to_list(), dt_dev_pixelpipe_t::input_profile_info, IS_NULL_PTR, mat3SSEinv(), dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_in_transposed, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_order_iccprofile_info_t::matrix_out_transposed, transpose_3xSSE(), dt_iop_order_iccprofile_info_t::type, and type.
Referenced by commit_params().
| dt_iop_order_iccprofile_info_t * dt_ioppr_set_pipe_output_profile_info | ( | struct dt_develop_t * | dev, |
| struct dt_dev_pixelpipe_t * | pipe, | ||
| const dt_colorspaces_color_profile_type_t | type, | ||
| const char * | filename, | ||
| const int | intent | ||
| ) |
Definition at line 843 of file iop_profile.c.
References DT_COLORSPACE_DISPLAY, DT_COLORSPACE_SRGB, dt_ioppr_add_profile_info_to_list(), IS_NULL_PTR, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_dev_pixelpipe_t::output_profile_info, and type.
Referenced by commit_params().
| dt_iop_order_iccprofile_info_t * dt_ioppr_set_pipe_work_profile_info | ( | struct dt_develop_t * | dev, |
| struct dt_dev_pixelpipe_t * | pipe, | ||
| const dt_colorspaces_color_profile_type_t | type, | ||
| const char * | filename, | ||
| const int | intent | ||
| ) |
set the work profile (type, filename) on the pipe, should be called on process*() if matrix cannot be generated it default to linear rec 2020 returns the actual profile that has been set
Definition at line 790 of file iop_profile.c.
References DT_COLORSPACE_LIN_REC2020, dt_ioppr_add_profile_info_to_list(), IS_NULL_PTR, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, type, and dt_dev_pixelpipe_t::work_profile_info.
Referenced by commit_params().
| void dt_ioppr_transform_image_colorspace | ( | struct dt_iop_module_t * | self, |
| const float *const | image_in, | ||
| float *const | image_out, | ||
| const int | width, | ||
| const int | height, | ||
| const int | cst_from, | ||
| const int | cst_to, | ||
| int * | converted_cst, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info | ||
| ) |
transforms image from cst_from to cst_to colorspace using profile_info
Definition at line 999 of file iop_profile.c.
References _transform_lcms2(), _transform_matrix(), dt_times_t::clock, darktable, DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_get_times(), dt_iop_colorspace_is_rgb(), height, IS_NULL_PTR, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_module_t::multi_name, dt_iop_module_t::op, dt_iop_order_iccprofile_info_t::type, darktable_t::unmuted, dt_times_t::user, and width.
Referenced by _draw_color_picker(), _refresh_preview_module_histogram_for_hash(), _retouch_blur(), dt_ioppr_transform_image_colorspace_cl(), pixelpipe_process_on_CPU(), and pixelpipe_process_on_GPU().
| int dt_ioppr_transform_image_colorspace_cl | ( | struct dt_iop_module_t * | self, |
| const int | devid, | ||
| cl_mem | dev_img_in, | ||
| cl_mem | dev_img_out, | ||
| const int | width, | ||
| const int | height, | ||
| const int | cst_from, | ||
| const int | cst_to, | ||
| int * | converted_cst, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info | ||
| ) |
same as the C version
Definition at line 1247 of file iop_profile.c.
References ch, cleanup(), dt_times_t::clock, dt_opencl_t::colorspaces, darktable, DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_free, dt_get_times(), dt_iop_colorspace_is_rgb(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_ioppr_transform_image_colorspace(), dt_opencl_copy_device_to_host(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_opencl_write_host_to_device(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, FALSE, height, IOP_CS_LAB, IS_NULL_PTR, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_lab_to_rgb_matrix, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_rgb_matrix_to_lab, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_module_t::multi_name, dt_iop_module_t::op, darktable_t::opencl, ROUNDUPDHT, ROUNDUPDWD, TRUE, dt_iop_order_iccprofile_info_t::type, darktable_t::unmuted, dt_times_t::user, and width.
Referenced by pixelpipe_process_on_GPU().
| void dt_ioppr_transform_image_colorspace_rgb | ( | const float *const restrict | image_in, |
| float *const restrict | image_out, | ||
| const int | width, | ||
| const int | height, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info_from, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info_to, | ||
| const char * | message | ||
| ) |
Definition at line 1061 of file iop_profile.c.
References _transform_matrix_rgb(), dt_times_t::clock, darktable, DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_get_times(), dt_iop_order_iccprofile_info_t::filename, height, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, dt_iop_order_iccprofile_info_t::type, darktable_t::unmuted, dt_times_t::user, and width.
Referenced by _area_draw_callback(), _brush_pipeline_color_from_display(), _draw_color_picker(), _scope_pixel_to_display_rgb(), _to_display_rgb(), _to_display_rgb_array(), _work_rgb_to_display_rgb(), _working_rgb_to_display_rgb(), dt_colorrings_apply_rgb_lut(), dt_ioppr_transform_image_colorspace_rgb_cl(), and process().
| int dt_ioppr_transform_image_colorspace_rgb_cl | ( | const int | devid, |
| cl_mem | dev_img_in, | ||
| cl_mem | dev_img_out, | ||
| const int | width, | ||
| const int | height, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info_from, | ||
| const dt_iop_order_iccprofile_info_t *const | profile_info_to, | ||
| const char * | message | ||
| ) |
Definition at line 1395 of file iop_profile.c.
References ch, cleanup(), dt_times_t::clock, dt_opencl_t::colorspaces, darktable, dt_colormatrix_mul(), DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_free, dt_get_times(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_ioppr_transform_image_colorspace_rgb(), dt_opencl_alloc_device(), dt_opencl_copy_device_to_host(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_copy_image(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_opencl_write_host_to_device(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, FALSE, dt_iop_order_iccprofile_info_t::filename, height, IS_NULL_PTR, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_rgb_matrix_to_rgb, matrix, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::matrix_out, darktable_t::opencl, pack_3xSSE_to_3x4(), ROUNDUPDHT, ROUNDUPDWD, TRUE, dt_iop_order_iccprofile_info_t::type, darktable_t::unmuted, dt_times_t::user, and width.
Referenced by process_cl().