![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"#include "common/colorspaces_inline_conversions.h"#include "common/debug.h"#include "common/imagebuf.h"#include "common/opencl.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "develop/tiling.h"#include "gui/gtk.h"#include "gui/presets.h"#include "iop/iop_api.h"#include <assert.h>#include <gtk/gtk.h>#include <inttypes.h>#include <math.h>#include <stdlib.h>#include <string.h>
Include dependency graph for colorreconstruction.c:Data Structures | |
| struct | dt_iop_colorreconstruct_params1_t |
| struct | dt_iop_colorreconstruct_params2_t |
| struct | dt_iop_colorreconstruct_params_t |
| struct | dt_iop_colorreconstruct_Lab_t |
| struct | dt_iop_colorreconstruct_bilateral_frozen_t |
| struct | dt_iop_colorreconstruct_gui_data_t |
| struct | dt_iop_colorreconstruct_data_t |
| struct | dt_iop_colorreconstruct_global_data_t |
| struct | dt_iop_colorreconstruct_bilateral_t |
| struct | dt_iop_colorreconstruct_bilateral_cl_t |
Macros | |
| #define | DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S 500 |
| #define | DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R 100 |
| #define | DT_COLORRECONSTRUCT_SPATIAL_APPROX 100.0f |
Typedefs | |
| typedef enum dt_iop_colorreconstruct_precedence_t | dt_iop_colorreconstruct_precedence_t |
| typedef struct dt_iop_colorreconstruct_params1_t | dt_iop_colorreconstruct_params1_t |
| typedef struct dt_iop_colorreconstruct_params2_t | dt_iop_colorreconstruct_params2_t |
| typedef struct dt_iop_colorreconstruct_params_t | dt_iop_colorreconstruct_params_t |
| typedef struct dt_iop_colorreconstruct_Lab_t | dt_iop_colorreconstruct_Lab_t |
| typedef struct dt_iop_colorreconstruct_bilateral_frozen_t | dt_iop_colorreconstruct_bilateral_frozen_t |
| typedef struct dt_iop_colorreconstruct_gui_data_t | dt_iop_colorreconstruct_gui_data_t |
| typedef struct dt_iop_colorreconstruct_data_t | dt_iop_colorreconstruct_data_t |
| typedef struct dt_iop_colorreconstruct_global_data_t | dt_iop_colorreconstruct_global_data_t |
| typedef struct dt_iop_colorreconstruct_bilateral_t | dt_iop_colorreconstruct_bilateral_t |
| typedef struct dt_iop_colorreconstruct_bilateral_cl_t | dt_iop_colorreconstruct_bilateral_cl_t |
Enumerations | |
| enum | dt_iop_colorreconstruct_precedence_t { COLORRECONSTRUCT_PRECEDENCE_NONE , COLORRECONSTRUCT_PRECEDENCE_CHROMA , COLORRECONSTRUCT_PRECEDENCE_HUE } |
| #define DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R 100 |
| #define DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S 500 |
| #define DT_COLORRECONSTRUCT_SPATIAL_APPROX 100.0f |
| typedef struct dt_iop_colorreconstruct_bilateral_frozen_t dt_iop_colorreconstruct_bilateral_frozen_t |
| typedef struct dt_iop_colorreconstruct_data_t dt_iop_colorreconstruct_data_t |
| typedef struct dt_iop_colorreconstruct_Lab_t dt_iop_colorreconstruct_Lab_t |
| typedef struct dt_iop_colorreconstruct_params_t dt_iop_colorreconstruct_params_t |
|
inlinestatic |
|
static |
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_blur_line, dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_slice, dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_splat, and dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_zero.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| void commit_params | ( | struct dt_iop_module_t * | self, |
| dt_iop_params_t * | p1, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References IOP_CS_LAB.
| int default_group | ( | ) |
References IOP_GROUP_REPAIR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
|
static |
References dt_opencl_enqueue_copy_buffer_to_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), IS_NULL_PTR, ROUNDUPDHT, and ROUNDUPDWD.
Referenced by process_cl().
|
static |
References dt_free, dt_opencl_release_mem_object(), and IS_NULL_PTR.
Referenced by dt_iop_colorreconstruct_bilateral_init_cl(), and process_cl().
|
static |
References dt_iop_colorreconstruct_bilateral_frozen_t::buf, dt_pixelpipe_cache_alloc_align_cache, dt_iop_colorreconstruct_bilateral_frozen_t::height, IS_NULL_PTR, dt_iop_colorreconstruct_bilateral_frozen_t::scale, dt_iop_colorreconstruct_bilateral_frozen_t::sigma_r, dt_iop_colorreconstruct_bilateral_frozen_t::sigma_s, dt_iop_colorreconstruct_bilateral_frozen_t::size_x, dt_iop_colorreconstruct_bilateral_frozen_t::size_y, dt_iop_colorreconstruct_bilateral_frozen_t::size_z, dt_iop_colorreconstruct_bilateral_frozen_t::width, dt_iop_colorreconstruct_bilateral_frozen_t::x, and dt_iop_colorreconstruct_bilateral_frozen_t::y.
Referenced by process().
|
static |
References dt_iop_colorreconstruct_bilateral_frozen_t::buf, DT_DEBUG_OPENCL, dt_opencl_read_buffer_from_device(), dt_pixelpipe_cache_alloc_align_cache, dt_print(), dt_iop_colorreconstruct_bilateral_frozen_t::height, IS_NULL_PTR, dt_iop_colorreconstruct_bilateral_frozen_t::scale, dt_iop_colorreconstruct_bilateral_frozen_t::sigma_r, dt_iop_colorreconstruct_bilateral_frozen_t::sigma_s, dt_iop_colorreconstruct_bilateral_frozen_t::size_x, dt_iop_colorreconstruct_bilateral_frozen_t::size_y, dt_iop_colorreconstruct_bilateral_frozen_t::size_z, dt_iop_colorreconstruct_bilateral_frozen_t::width, dt_iop_colorreconstruct_bilateral_frozen_t::x, and dt_iop_colorreconstruct_bilateral_frozen_t::y.
Referenced by process_cl().
|
static |
References CLAMPS, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S, dt_pixelpipe_cache_alloc_align_cache, dt_iop_roi_t::height, IS_NULL_PTR, iscale, MAX, dt_iop_roi_t::scale, sigma_r, sigma_s, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by process().
|
static |
References CLAMPS, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S, DT_DEBUG_OPENCL, dt_iop_colorreconstruct_bilateral_free_cl(), dt_opencl_alloc_device_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_local_buffer_opt(), dt_opencl_set_kernel_arg(), dt_print(), dt_iop_roi_t::height, IS_NULL_PTR, iscale, dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_splat, MAX, ROUNDUPDHT, ROUNDUPDWD, dt_iop_roi_t::scale, sigma_r, sigma_s, dt_opencl_local_buffer_t::sizex, dt_opencl_local_buffer_t::sizey, dt_iop_roi_t::width, dt_iop_roi_t::x, dt_opencl_local_buffer_t::xoffset, and dt_iop_roi_t::y.
Referenced by process_cl().
|
static |
References CLAMPS, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S, height, sigma_r, sigma_s, size_x, size_y, size_z, and width.
Referenced by tiling_callback().
|
static |
References CLAMPS, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_R, DT_COLORRECONSTRUCT_BILATERAL_MAX_RES_S, height, sigma_r, sigma_s, size_x, size_y, size_z, and width.
Referenced by tiling_callback().
|
static |
References __OMP_PARALLEL_FOR__, CLAMPS, grid_rescale(), dt_iop_roi_t::height, i, image_to_grid(), IS_NULL_PTR, iscale, MIN, out, dt_iop_roi_t::scale, threshold, weight(), dt_iop_roi_t::width, and x.
Referenced by process().
|
static |
References dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), dt_iop_roi_t::height, IS_NULL_PTR, iscale, out, ROUNDUPDHT, ROUNDUPDWD, dt_iop_roi_t::scale, threshold, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by process_cl().
|
static |
References __OMP_PARALLEL_FOR__, CLAMPS, COLORRECONSTRUCT_PRECEDENCE_CHROMA, COLORRECONSTRUCT_PRECEDENCE_HUE, COLORRECONSTRUCT_PRECEDENCE_NONE, i, image_to_grid(), IS_NULL_PTR, m, M_PI, threshold, weight(), and x.
Referenced by process().
|
static |
References dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_set_kernel_arg(), IS_NULL_PTR, ROUNDUP, and threshold.
Referenced by process_cl().
| int flags | ( | ) |
References IOP_FLAGS_DEPRECATED, IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
|
inlinestatic |
References i, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by dt_iop_colorreconstruct_bilateral_slice().
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
References COLORRECONSTRUCT_PRECEDENCE_HUE, g, dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
References g, dt_iop_module_t::gui_data, and IOP_GUI_FREE.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
References dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_factor(), dt_bauhaus_slider_set_feedback(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_stop(), DT_BAUHAUS_SPACE, dt_ui_label_new(), FALSE, g, IOP_GUI_ALLOC, TRUE, and dt_iop_module_t::widget.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
References COLORRECONSTRUCT_PRECEDENCE_HUE, dt_iop_module_t::dev, dt_image_is_monochrome(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), g, dt_iop_module_t::gui_data, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, p, dt_iop_module_t::params, and dt_iop_module_t::widget.
|
inlinestatic |
References dt_XYZ_to_Lab(), hsl2rgb(), Lab, rgb, and XYZ.
Referenced by process(), and process_cl().
|
inlinestatic |
References CLAMPS, i, L, and x.
Referenced by dt_bilateral_slice(), dt_bilateral_slice_to_output(), dt_iop_colorreconstruct_bilateral_slice(), and dt_iop_colorreconstruct_bilateral_splat().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
References dt_opencl_create_kernel(), dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_blur_line, dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_slice, dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_splat, and dt_iop_colorreconstruct_global_data_t::kernel_colorreconstruct_zero.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
References COLORRECONSTRUCT_PRECEDENCE_NONE, dt_iop_colorreconstruct_params2_t::precedence, dt_iop_colorreconstruct_params1_t::range, dt_iop_colorreconstruct_params2_t::range, dt_iop_colorreconstruct_params1_t::spatial, dt_iop_colorreconstruct_params2_t::spatial, dt_iop_colorreconstruct_params1_t::threshold, dt_iop_colorreconstruct_params2_t::threshold, and dt_iop_colorreconstruct_params_t::threshold.
| const char * name | ( | ) |
| int process | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | ivoid, | ||
| void *const | ovoid | ||
| ) |
References dt_iop_buffer_dsc_t::channels, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_dev_pixelpipe_iop_t::dsc_in, dt_control_log(), dt_dev_get_module_scale(), dt_dev_pixelpipe_has_preview_output(), dt_iop_colorreconstruct_bilateral_freeze(), dt_iop_colorreconstruct_bilateral_init(), dt_iop_colorreconstruct_bilateral_slice(), dt_iop_colorreconstruct_bilateral_splat(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_image_copy_by_size(), error(), g, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_iop_module_t::gui_data, dt_iop_roi_t::height, dt_iop_colorreconstruct_data_t::hue, hue_conversion(), IS_NULL_PTR, dt_dev_pixelpipe_t::iscale, M_PI, out, ovoid, dt_iop_colorreconstruct_data_t::precedence, dt_iop_colorreconstruct_data_t::range, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, sigma_r, sigma_s, dt_iop_colorreconstruct_data_t::spatial, dt_iop_colorreconstruct_data_t::threshold, and dt_iop_roi_t::width.
| int process_cl | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
References d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_dev_get_module_scale(), dt_dev_pixelpipe_has_preview_output(), dt_iop_colorreconstruct_bilateral_blur_cl(), dt_iop_colorreconstruct_bilateral_free_cl(), dt_iop_colorreconstruct_bilateral_freeze_cl(), dt_iop_colorreconstruct_bilateral_init_cl(), dt_iop_colorreconstruct_bilateral_slice_cl(), dt_iop_colorreconstruct_bilateral_splat_cl(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_print(), error(), FALSE, g, dt_iop_module_t::global_data, dt_dev_pixelpipe_iop_t::global_hash, dt_develop_t::gui_attached, dt_iop_module_t::gui_data, hue_conversion(), IS_NULL_PTR, dt_dev_pixelpipe_t::iscale, M_PI, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, sigma_r, sigma_s, and TRUE.
| void tiling_callback | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| const struct dt_dev_pixelpipe_iop_t * | piece, | ||
| struct dt_develop_tiling_t * | tiling | ||
| ) |
References dt_iop_buffer_dsc_t::channels, d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, dt_dev_get_module_scale(), dt_iop_colorreconstruct_bilateral_memory_use(), dt_iop_colorreconstruct_bilateral_singlebuffer_size(), height, dt_iop_roi_t::height, dt_dev_pixelpipe_iop_t::roi_in, sigma_r, sigma_s, width, and dt_iop_roi_t::width.