![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/color_picker.h"#include "common/colorspaces_inline_conversions.h"#include "pixel/bspline.h"#include "system/macros.h"#include "system/openmp.h"#include "system/mem_alloc.h"#include "system/simd.h"#include "common/logging.h"#include "common/times.h"#include "caches/pixelpipe_cache_alloc.h"#include "colorprofiles/iop_profile.h"#include "pixel/format.h"#include "develop/imageop_math.h"Go to the source code of this file.
Functions | |
| static size_t | _box_size (const int *const box) |
| static void | rgb_to_JzCzhz (const dt_aligned_pixel_t rgb, dt_aligned_pixel_t JzCzhz, const dt_iop_order_iccprofile_info_t *const profile) |
| static gboolean | _picker_cst_wants_lab (const dt_iop_colorspace_type_t picker_cst) |
| Whether a picker colorspace derives from Lab (Lab, LCh) rather than from RGB (RGB, HSL, JzCzhz). | |
| static void | _color_picker_convert_buffer (const float *const restrict input, float *const restrict output, const size_t pixels, const dt_iop_colorspace_type_t image_cst, const dt_iop_colorspace_type_t picker_cst, const dt_iop_order_iccprofile_info_t *const profile) |
| Convert a 4-channel sampling buffer into the picker colorspace. | |
| __OMP_DECLARE_SIMD__ (aligned(rgb, JzCzhz:16) uniform(profile)) | |
| static void | _color_picker_rgb_or_lab (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width) |
| static void | _color_picker_direct_hsl (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width) |
| static void | _color_picker_direct_lch_or_jzczhz (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width) |
| static void | _color_picker_lch (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width) |
| static void | _color_picker_hsl (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width) |
| static void | _color_picker_jzczhz (dt_aligned_pixel_t avg, dt_aligned_pixel_t min, dt_aligned_pixel_t max, const float *const pixels, const float w, const size_t width, const dt_iop_order_iccprofile_info_t *const profile) |
| static void | color_picker_helper_4ch_seq (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t cst_to, const dt_iop_order_iccprofile_info_t *const profile) |
| static void | color_picker_helper_4ch_parallel (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t cst_to, const dt_iop_order_iccprofile_info_t *const profile) |
| static void | color_picker_helper_4ch (const dt_iop_buffer_dsc_t *dsc, const float *const pixel, const dt_iop_roi_t *roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t cst_to, const dt_iop_order_iccprofile_info_t *const profile) |
| static void | color_picker_helper_4ch_converted_seq (const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t picker_cst) |
| static void | color_picker_helper_4ch_converted_parallel (const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t picker_cst) |
| static void | color_picker_helper_4ch_converted (const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t picker_cst) |
| static void | color_picker_helper_bayer_seq (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | color_picker_helper_bayer_parallel (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | color_picker_helper_bayer (const dt_iop_buffer_dsc_t *dsc, const float *const pixel, const dt_iop_roi_t *roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | color_picker_helper_xtrans_seq (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | color_picker_helper_xtrans_parallel (const dt_iop_buffer_dsc_t *const dsc, const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | color_picker_helper_xtrans (const dt_iop_buffer_dsc_t *dsc, const float *const pixel, const dt_iop_roi_t *roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max) |
| static void | _color_picker_locate_extremes (const float *const pixel, const dt_iop_roi_t *const roi, const int *const box, dt_color_picker_extremes_t *const extremes) |
| void | dt_color_picker_helper (const dt_iop_buffer_dsc_t *dsc, const float *const pixel, const dt_iop_roi_t *roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t image_cst, const dt_iop_colorspace_type_t picker_cst, const dt_iop_order_iccprofile_info_t *const profile, dt_color_picker_extremes_t *extremes) |
| __OMP_DECLARE_SIMD__ | ( | aligned(rgb, JzCzhz:16) uniform(profile) | ) |
Definition at line 113 of file color_picker.c.
References JzAzBz, 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, rgb, XYZ_D50, and XYZ_D65.
|
inlinestatic |
Definition at line 45 of file color_picker.c.
Referenced by _color_picker_locate_extremes(), color_picker_helper_4ch(), color_picker_helper_4ch_converted(), color_picker_helper_4ch_converted_parallel(), color_picker_helper_4ch_converted_seq(), color_picker_helper_4ch_parallel(), color_picker_helper_4ch_seq(), color_picker_helper_bayer(), and color_picker_helper_xtrans().
|
static |
Convert a 4-channel sampling buffer into the picker colorspace.
GUI sampling must never rewrite live pixelpipe cachelines. When the picker needs a colorspace conversion, we therefore copy the denoised sampling buffer into a disposable external cache allocation and overwrite that private copy in place. The conversion keeps the alpha slot untouched because some callers reuse channel 3 for auxiliary picker statistics.
Definition at line 69 of file color_picker.c.
References __OMP_PARALLEL_FOR__, _picker_cst_wants_lab(), IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LAB, IOP_CS_LCH, k, 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_transposed, dt_iop_order_iccprofile_info_t::matrix_out_transposed, dt_iop_order_iccprofile_info_t::nonlinearlut, and rgb_to_JzCzhz().
Referenced by dt_color_picker_helper().
|
inlinestatic |
Definition at line 150 of file color_picker.c.
References i, k, max, min, and width.
Referenced by color_picker_helper_4ch_converted_parallel(), and color_picker_helper_4ch_converted_seq().
|
inlinestatic |
Definition at line 165 of file color_picker.c.
References i, k, max, min, and width.
Referenced by color_picker_helper_4ch_converted_parallel(), and color_picker_helper_4ch_converted_seq().
|
inlinestatic |
Definition at line 197 of file color_picker.c.
References i, k, max, min, and width.
Referenced by color_picker_helper_4ch_parallel(), and color_picker_helper_4ch_seq().
|
inlinestatic |
Definition at line 213 of file color_picker.c.
References i, k, max, min, rgb_to_JzCzhz(), and width.
Referenced by color_picker_helper_4ch_parallel(), and color_picker_helper_4ch_seq().
|
inlinestatic |
Definition at line 181 of file color_picker.c.
References i, k, max, min, and width.
Referenced by color_picker_helper_4ch_parallel(), and color_picker_helper_4ch_seq().
|
static |
Definition at line 767 of file color_picker.c.
References _box_size(), i, IS_NULL_PTR, k, dt_color_picker_extremes_t::max, max, dt_color_picker_extremes_t::max_pixel, memcpy(), dt_color_picker_extremes_t::min, min, dt_color_picker_extremes_t::min_pixel, TRUE, dt_color_picker_extremes_t::valid, and dt_iop_roi_t::width.
Referenced by dt_color_picker_helper().
|
inlinestatic |
Definition at line 136 of file color_picker.c.
References i, k, max, min, and width.
Referenced by color_picker_helper_4ch_converted_parallel(), color_picker_helper_4ch_converted_seq(), color_picker_helper_4ch_parallel(), and color_picker_helper_4ch_seq().
|
inlinestatic |
Whether a picker colorspace derives from Lab (Lab, LCh) rather than from RGB (RGB, HSL, JzCzhz).
Definition at line 54 of file color_picker.c.
References IOP_CS_LAB, and IOP_CS_LCH.
Referenced by _color_picker_convert_buffer(), and dt_color_picker_helper().
|
static |
Definition at line 390 of file color_picker.c.
References _box_size(), color_picker_helper_4ch_parallel(), color_picker_helper_4ch_seq(), and size.
Referenced by dt_color_picker_helper().
|
static |
Definition at line 497 of file color_picker.c.
References _box_size(), color_picker_helper_4ch_converted_parallel(), and color_picker_helper_4ch_converted_seq().
Referenced by dt_color_picker_helper().
|
static |
Definition at line 431 of file color_picker.c.
References __OMP_FOR__, __OMP_PARALLEL__, _box_size(), _color_picker_direct_hsl(), _color_picker_direct_lch_or_jzczhz(), _color_picker_rgb_or_lab(), dt_get_bythread, dt_get_num_openmp_threads(), dt_get_perthread, dt_pixelpipe_cache_alloc_perthread_float, dt_pixelpipe_cache_free_align, error(), for_four_channels, IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LCH, IS_NULL_PTR, k, n, size, dt_iop_roi_t::width, and width.
Referenced by color_picker_helper_4ch_converted().
|
static |
Definition at line 406 of file color_picker.c.
References _box_size(), _color_picker_direct_hsl(), _color_picker_direct_lch_or_jzczhz(), _color_picker_rgb_or_lab(), IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LCH, size, dt_iop_roi_t::width, and width.
Referenced by color_picker_helper_4ch_converted().
|
static |
Definition at line 281 of file color_picker.c.
References __OMP_FOR__, __OMP_PARALLEL__, _box_size(), _color_picker_hsl(), _color_picker_jzczhz(), _color_picker_lch(), _color_picker_rgb_or_lab(), dt_get_perthread, dt_pixelpipe_cache_alloc_perthread_float, dt_pixelpipe_cache_free_align, error(), IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LCH, IS_NULL_PTR, k, MAX, n, omp_get_max_threads, size, dt_iop_roi_t::width, and width.
Referenced by color_picker_helper_4ch().
|
static |
Definition at line 231 of file color_picker.c.
References _box_size(), _color_picker_hsl(), _color_picker_jzczhz(), _color_picker_lch(), _color_picker_rgb_or_lab(), IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LCH, size, dt_iop_roi_t::width, and width.
Referenced by color_picker_helper_4ch().
|
static |
Definition at line 623 of file color_picker.c.
References _box_size(), color_picker_helper_bayer_parallel(), color_picker_helper_bayer_seq(), and size.
Referenced by dt_color_picker_helper().
|
static |
Definition at line 545 of file color_picker.c.
References __OMP_FOR__, __OMP_PARALLEL__, dt_free, dt_get_num_openmp_threads(), dt_get_thread_num(), error(), FC(), dt_iop_buffer_dsc_t::filters, i, IS_NULL_PTR, k, n, v, dt_iop_roi_t::width, width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by color_picker_helper_bayer().
|
static |
Definition at line 511 of file color_picker.c.
References FC(), dt_iop_buffer_dsc_t::filters, i, k, v, dt_iop_roi_t::width, width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by color_picker_helper_bayer().
|
static |
Definition at line 751 of file color_picker.c.
References _box_size(), color_picker_helper_xtrans_parallel(), color_picker_helper_xtrans_seq(), and size.
Referenced by dt_color_picker_helper().
|
static |
Definition at line 671 of file color_picker.c.
References __OMP_FOR__, __OMP_PARALLEL__, dt_free, dt_get_thread_num(), error(), FCxtrans(), i, IS_NULL_PTR, k, MAX, n, omp_get_max_threads, v, dt_iop_roi_t::width, width, and dt_iop_buffer_dsc_t::xtrans.
Referenced by color_picker_helper_xtrans().
|
static |
Definition at line 636 of file color_picker.c.
References FCxtrans(), i, k, v, dt_iop_roi_t::width, width, and dt_iop_buffer_dsc_t::xtrans.
Referenced by color_picker_helper_xtrans().
| void dt_color_picker_helper | ( | const dt_iop_buffer_dsc_t * | dsc, |
| const float *const | pixel, | ||
| const dt_iop_roi_t * | roi, | ||
| const int *const | box, | ||
| dt_aligned_pixel_t | picked_color, | ||
| dt_aligned_pixel_t | picked_color_min, | ||
| dt_aligned_pixel_t | picked_color_max, | ||
| const dt_iop_colorspace_type_t | image_cst, | ||
| const dt_iop_colorspace_type_t | picker_cst, | ||
| const dt_iop_order_iccprofile_info_t *const | profile, | ||
| dt_color_picker_extremes_t * | extremes ) |
Definition at line 812 of file color_picker.c.
References _color_picker_convert_buffer(), _color_picker_locate_extremes(), _picker_cst_wants_lab(), blur_2D_Bspline(), dt_iop_buffer_dsc_t::channels, dt_times_t::clock, color_picker_helper_4ch(), color_picker_helper_4ch_converted(), color_picker_helper_bayer(), color_picker_helper_xtrans(), DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_times(), dt_iop_colorspace_is_rgb(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_alloc_perthread_float, dt_pixelpipe_cache_free_align, dt_unreachable_codepath, error(), FALSE, dt_iop_buffer_dsc_t::filters, dt_iop_roi_t::height, IOP_CS_HSL, IOP_CS_JZCZHZ, IOP_CS_LAB, IOP_CS_NONE, IS_NULL_PTR, dt_times_t::user, dt_color_picker_extremes_t::valid, and dt_iop_roi_t::width.
Referenced by _pixelpipe_pick_from_image(), and _sample_picker_buffer().
|
inlinestatic |
References rgb.
Referenced by _color_picker_convert_buffer(), and _color_picker_jzczhz().