![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/colorspaces_inline_conversions.h"
#include "common/colorspaces.h"
#include "common/matrices.h"
#include "develop/imageop.h"
Go to the source code of this file.
Data Structures | |
struct | dt_iop_order_iccprofile_info_t |
Typedefs | |
typedef struct dt_iop_order_iccprofile_info_t | dt_iop_order_iccprofile_info_t |
Functions | |
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) |
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) |
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_get_iop_input_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_histogram_profile_info (struct dt_develop_t *dev) |
dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_work_profile_info (struct dt_dev_pixelpipe_t *pipe) |
dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_input_profile_info (struct dt_dev_pixelpipe_t *pipe) |
dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_output_profile_info (struct dt_dev_pixelpipe_t *pipe) |
dt_iop_order_iccprofile_info_t * | dt_ioppr_get_pipe_current_profile_info (struct dt_iop_module_t *module, 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_input_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 image_in, float *const 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) |
static float | extrapolate_lut (const float *const lut, const float v, const int lutsize) |
static float | eval_exp (const float coeff[3], const float x) |
static void | _apply_trc (const dt_aligned_pixel_t rgb_in, dt_aligned_pixel_t rgb_out, float *const lut[3], const float unbounded_coeffs[3][3], const int lutsize) |
static float | dt_ioppr_get_rgb_matrix_luminance (const dt_aligned_pixel_t rgb, const dt_colormatrix_t matrix_in, float *const lut_in[3], const float unbounded_coeffs_in[3][3], const int lutsize, const int nonlinearlut) |
static void | dt_ioppr_rgb_matrix_to_xyz (const dt_aligned_pixel_t rgb, dt_aligned_pixel_t xyz, const dt_colormatrix_t matrix_in_transposed, float *const lut_in[3], const float unbounded_coeffs_in[3][3], const int lutsize, const int nonlinearlut) |
static void | dt_ioppr_lab_to_rgb_matrix (const dt_aligned_pixel_t lab, dt_aligned_pixel_t rgb, const dt_colormatrix_t matrix_out_transposed, float *const lut_out[3], const float unbounded_coeffs_out[3][3], const int lutsize, const int nonlinearlut) |
static void | dt_ioppr_rgb_matrix_to_lab (const dt_aligned_pixel_t rgb, dt_aligned_pixel_t lab, const dt_colormatrix_t matrix_in_transposed, float *const lut_in[3], const float unbounded_coeffs_in[3][3], const int lutsize, const int nonlinearlut) |
static float | dt_ioppr_get_profile_info_middle_grey (const dt_iop_order_iccprofile_info_t *const profile_info) |
static float | dt_ioppr_compensate_middle_grey (const float x, const dt_iop_order_iccprofile_info_t *const profile_info) |
static float | dt_ioppr_uncompensate_middle_grey (const float x, const dt_iop_order_iccprofile_info_t *const profile_info) |
typedef struct dt_iop_order_iccprofile_info_t dt_iop_order_iccprofile_info_t |
|
inlinestatic |
References eval_exp(), and extrapolate_lut().
Referenced by dt_ioppr_get_rgb_matrix_luminance(), dt_ioppr_lab_to_rgb_matrix(), and dt_ioppr_rgb_matrix_to_xyz().
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
References dt_develop_t::allprofile_info, dt_alloc_align, dt_free_align, dt_ioppr_generate_profile_info(), dt_ioppr_get_profile_info_from_list(), and dt_ioppr_init_profile_info().
Referenced by 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(), and workicc_changed().
void dt_ioppr_cleanup_profile_info | ( | dt_iop_order_iccprofile_info_t * | profile_info | ) |
must be called when done with profile_info
References dt_free_align, dt_iop_order_iccprofile_info_t::lut_in, and dt_iop_order_iccprofile_info_t::lut_out.
Referenced by dt_dev_cleanup().
|
inlinestatic |
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
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_histogram_profile_info | ( | struct dt_develop_t * | dev | ) |
returns a reference to the histogram profile info histogram profile must not be cleanup()
void dt_ioppr_get_input_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 input profile on colorin iop
dt_iop_order_iccprofile_info_t * dt_ioppr_get_iop_input_profile_info | ( | struct dt_iop_module_t * | module, |
GList * | iop_list | ||
) |
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()
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(), _draw_color_picker(), _signal_profile_user_changed(), _update_gradient_slider_pickers(), apply_auto_black(), apply_auto_grey(), apply_auto_white_point_source(), apply_autotune(), blend_color_picker_apply(), dt_develop_blendif_init_masking_profile(), gui_changed(), process(), process(), process_fusion(), and process_lut().
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_current_profile_info | ( | struct dt_iop_module_t * | module, |
struct dt_dev_pixelpipe_t * | pipe | ||
) |
Get the relevant RGB -> XYZ profile at the position of current module
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 _update_gradient_slider_pickers(), blend_color_picker_apply(), color_picker_apply(), commit_params(), dt_develop_blendif_init_masking_profile(), pipe_RGB_to_Ych(), pixelpipe_picker(), process(), and process().
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_input_profile_info | ( | struct dt_dev_pixelpipe_t * | pipe | ) |
References dt_dev_pixelpipe_t::input_profile_info.
Referenced by _auto_set_exposure(), commit_params(), dt_ioppr_get_pipe_current_profile_info(), and process().
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_output_profile_info | ( | struct dt_dev_pixelpipe_t * | pipe | ) |
References dt_dev_pixelpipe_t::output_profile_info.
Referenced by _area_draw_callback(), _draw_color_picker(), _update_RGB_colors(), dt_ioppr_get_pipe_current_profile_info(), gui_post_expose(), and process().
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_work_profile_info | ( | struct dt_dev_pixelpipe_t * | pipe | ) |
returns the active work/input/output profile on the pipe
References dt_dev_pixelpipe_t::work_profile_info.
Referenced by _auto_set_illuminant(), _generate_curve_lut(), _retouch_blur(), _sample_color_picker(), collect_histogram_on_CPU(), color_picker_apply(), dt_develop_blendif_lab_blend(), dt_ioppr_get_pipe_current_profile_info(), histogram_collect(), pixelpipe_process_on_CPU(), process(), process(), process(), rt_adjust_levels(), and rt_process_stats().
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
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().
|
inlinestatic |
References dt_iop_order_iccprofile_info_t::grey.
Referenced by _signal_profile_user_changed().
|
inlinestatic |
References _apply_trc().
Referenced by _add_node_from_picker(), _blendif_cook(), _blendif_gray(), _blendif_gray(), _blendif_scale(), _rgb_luminance(), _rgb_luminance(), color_picker_apply(), dt_ioppr_generate_profile_info(), dt_rgb_norm(), filmic_chroma_v1(), filmic_split_v1(), filmic_split_v2_v3(), get_pixel_norm(), picker_scale(), and process().
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
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 dt_ioppr_get_iop_work_profile_info().
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
References _mark_as_nonmatrix_profile(), 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, 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::nonlinearlut, and dt_iop_order_iccprofile_info_t::type.
Referenced by dt_ioppr_add_profile_info_to_list().
|
inlinestatic |
References _apply_trc(), dt_apply_transposed_color_matrix(), and dt_Lab_to_XYZ().
Referenced by dt_ioppr_uncompensate_middle_grey(), gui_post_expose(), and rt_adjust_levels().
|
inlinestatic |
References dt_ioppr_rgb_matrix_to_xyz(), and dt_XYZ_to_Lab().
Referenced by dt_develop_blendif_lab_blend(), dt_ioppr_compensate_middle_grey(), rt_adjust_levels(), and rt_process_stats().
|
inlinestatic |
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 | ||
) |
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, 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 | ||
) |
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
References DT_COLORSPACE_LIN_REC2020, dt_ioppr_add_profile_info_to_list(), 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
References _transform_lcms2(), _transform_matrix(), dt_times_t::clock, darktable, DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_get_times(), height, IOP_CS_RGB, 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(), _retouch_blur(), _sample_color_picker(), collect_histogram_on_CPU(), and pixelpipe_process_on_CPU().
void dt_ioppr_transform_image_colorspace_rgb | ( | 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_from, | ||
const dt_iop_order_iccprofile_info_t *const | profile_info_to, | ||
const char * | message | ||
) |
|
inlinestatic |
|
inlinestatic |
Referenced by _apply_tonecurves(), _apply_trc(), and _transform_matrix_rgb().
|
inlinestatic |
the following must have the matrix_in and matrix_out generated
Referenced by _apply_tonecurves(), _apply_trc(), _init_unbounded_coeffs(), and _transform_matrix_rgb().