![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "common/module_versioning.h"#include "math/math.h"#include "develop/develop.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "gui/presets.h"#include "gui/color_picker_proxy.h"#include "iop/iop_api.h"#include <assert.h>#include <stdlib.h>#include <string.h>#include "widgets/label.h"
Include dependency graph for profile_gamma.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_profilegamma_params_t |
| struct | dt_iop_profilegamma_gui_data_t |
| struct | dt_iop_profilegamma_data_t |
Typedefs | |
| typedef enum dt_iop_profilegamma_mode_t | dt_iop_profilegamma_mode_t |
| typedef struct dt_iop_profilegamma_params_t | dt_iop_profilegamma_params_t |
| typedef struct dt_iop_profilegamma_gui_data_t | dt_iop_profilegamma_gui_data_t |
| typedef struct dt_iop_profilegamma_data_t | dt_iop_profilegamma_data_t |
Enumerations | |
| enum | dt_iop_profilegamma_mode_t { PROFILEGAMMA_LOG = 0 , PROFILEGAMMA_GAMMA = 1 } |
| typedef struct dt_iop_profilegamma_data_t dt_iop_profilegamma_data_t |
| typedef struct dt_iop_profilegamma_gui_data_t dt_iop_profilegamma_gui_data_t |
| typedef enum dt_iop_profilegamma_mode_t dt_iop_profilegamma_mode_t |
| typedef struct dt_iop_profilegamma_params_t dt_iop_profilegamma_params_t |
| Enumerator | |
|---|---|
| PROFILEGAMMA_LOG | |
| PROFILEGAMMA_GAMMA | |
Definition at line 72 of file profile_gamma.c.
|
static |
Definition at line 298 of file profile_gamma.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, Log2Thres(), noise, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_min, and TRUE.
Referenced by color_picker_apply().
|
static |
Definition at line 320 of file profile_gamma.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, Log2Thres(), noise, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_max, and TRUE.
Referenced by color_picker_apply().
|
static |
Definition at line 282 of file profile_gamma.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, and TRUE.
Referenced by color_picker_apply().
|
static |
Definition at line 345 of file profile_gamma.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_gui_data(), g, Log2Thres(), noise, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_iop_module_t::picked_color_max, dt_iop_module_t::picked_color_min, and TRUE.
Referenced by color_picker_apply().
| void cleanup_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 516 of file profile_gamma.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| void color_picker_apply | ( | dt_iop_module_t * | self, |
| GtkWidget * | picker, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 422 of file profile_gamma.c.
References apply_auto_black(), apply_auto_dynamic_range(), apply_auto_grey(), apply_autotune(), dt_iop_gui_data(), and g.
| void commit_params | ( | dt_iop_module_t * | self, |
| dt_iop_params_t * | p1, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 437 of file profile_gamma.c.
References __OMP_PARALLEL_FOR__, d, dt_dev_pixelpipe_iop_t::data, dt_iop_estimate_exp(), g, k, linear, p, and x.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 140 of file profile_gamma.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 129 of file profile_gamma.c.
References IOP_GROUP_TECHNICAL.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 120 of file profile_gamma.c.
References dt_iop_set_description().
| int flags | ( | ) |
Definition at line 134 of file profile_gamma.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_INCLUDE_IN_STYLES, IOP_FLAGS_ONE_INSTANCE, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 379 of file profile_gamma.c.
References dt_bauhaus_slider_set(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_iop_color_picker_reset(), dt_iop_gui_data(), FALSE, g, p, dt_iop_module_t::params, and PROFILEGAMMA_LOG.
Referenced by gui_update().
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 536 of file profile_gamma.c.
References dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), dt_bauhaus_get_global(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_max(), dt_bauhaus_slider_set_soft_range(), dt_bauhaus_widget_set_label(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_ui_section_label_new(), FALSE, g, dt_iop_module_t::gui, IOP_GUI_ALLOC, TRUE, and dt_iop_module_gui_t::widget.
| void gui_reset | ( | dt_iop_module_t * | self | ) |
Definition at line 522 of file profile_gamma.c.
References dt_iop_color_picker_reset(), and TRUE.
| void gui_update | ( | dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 527 of file profile_gamma.c.
References dt_iop_color_picker_reset(), dt_iop_gui_data(), g, gui_changed(), and TRUE.
| void init_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 510 of file profile_gamma.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
Definition at line 145 of file profile_gamma.c.
References dt_gui_presets_add_generic(), dt_iop_module_so_t::op, p, and PROFILEGAMMA_LOG.
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
Definition at line 186 of file profile_gamma.c.
References d, dt_iop_module_t::default_params, linear, n, and PROFILEGAMMA_GAMMA.
| const char * name | ( | ) |
Definition at line 115 of file profile_gamma.c.
| __DT_CLONE_TARGETS__ int process | ( | 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 | ||
| ) |
The log2(x) -> -INF when x -> 0 thus very low values (noise) will get even lower, resulting in noise negative amplification, which leads to pepper noise in shadows. To avoid that, we need to clip values that are noise for sure. Using 16 bits RAW data, the black value (known by rawspeed for every manufacturer) could be used as a threshold. However, at this point of the pixelpipe, the RAW levels have already been corrected and everything can happen with black levels in the exposure module. So we define the threshold as the first non-null 16 bit integer
Definition at line 212 of file profile_gamma.c.
References __OMP_FOR_SIMD__, __OMP_PARALLEL_FOR__, ch, dt_iop_buffer_dsc_t::channels, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_eval_exp(), dt_iop_profilegamma_data_t::dynamic_range, fastlog2(), dt_iop_profilegamma_data_t::grey_point, dt_iop_roi_t::height, i, k, dt_dev_pixelpipe_t::mask_display, dt_iop_profilegamma_data_t::mode, noise, out, ovoid, PROFILEGAMMA_GAMMA, PROFILEGAMMA_LOG, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_profilegamma_data_t::shadows_range, dt_iop_profilegamma_data_t::table, dt_iop_profilegamma_data_t::unbounded_coeffs, and dt_iop_roi_t::width.