![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "system/macros.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "system/simd.h"#include "common/logging.h"#include "common/module_versioning.h"#include "common/opencl.h"#include "control/control.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "math/openmp_maths.h"#include "gui/presets.h"#include "gui/color_picker_proxy.h"#include "iop/iop_api.h"#include <glib.h>#include <math.h>#include <stdlib.h>#include "widgets/label.h"#include "widgets/notebook.h"
Include dependency graph for negadoctor.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_negadoctor_params_t |
| struct | dt_iop_negadoctor_data_t |
| struct | dt_iop_negadoctor_gui_data_t |
| struct | dt_iop_negadoctor_global_data_t |
Macros | |
| #define | THRESHOLD 2.3283064365386963e-10f |
Typedefs | |
| typedef enum dt_iop_negadoctor_filmstock_t | dt_iop_negadoctor_filmstock_t |
| typedef struct dt_iop_negadoctor_params_t | dt_iop_negadoctor_params_t |
| typedef struct dt_iop_negadoctor_data_t | dt_iop_negadoctor_data_t |
| typedef struct dt_iop_negadoctor_gui_data_t | dt_iop_negadoctor_gui_data_t |
| typedef struct dt_iop_negadoctor_global_data_t | dt_iop_negadoctor_global_data_t |
Enumerations | |
| enum | dt_iop_negadoctor_filmstock_t { DT_FILMSTOCK_NB = 0 , DT_FILMSTOCK_COLOR = 1 } |
| #define THRESHOLD 2.3283064365386963e-10f |
DOCUMENTATION
This module allows to invert scanned negatives and simulate their print on paper, based on Kodak Cineon densitometry algorithm. It is better than the old invert module because it takes into account the Dmax of the film and allows white balance adjustments, as well as paper grade (gamma) simulation. It also allows density correction in log space, to account for the exposure settings of the scanner. Finally, it is applied after input colour profiling, which means the inversion happens after the scanner or the camera got color-corrected, while the old invert module invert the RAW, non-demosaiced, file before any colour correction.
References :
Definition at line 78 of file negadoctor.c.
| typedef struct dt_iop_negadoctor_data_t dt_iop_negadoctor_data_t |
| typedef struct dt_iop_negadoctor_global_data_t dt_iop_negadoctor_global_data_t |
| typedef struct dt_iop_negadoctor_gui_data_t dt_iop_negadoctor_gui_data_t |
| typedef struct dt_iop_negadoctor_params_t dt_iop_negadoctor_params_t |
| Enumerator | |
|---|---|
| DT_FILMSTOCK_NB | |
| DT_FILMSTOCK_COLOR | |
Definition at line 84 of file negadoctor.c.
| const char * aliases | ( | ) |
Definition at line 156 of file negadoctor.c.
|
static |
Definition at line 773 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), fast_exp10f(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_max, RGB, THRESHOLD, TRUE, v_maxf(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 674 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_min, RGB, THRESHOLD, TRUE, v_maxf(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 654 of file negadoctor.c.
References dt_iop_module_t::dev, Dmin_picker_update(), dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, k, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, TRUE, and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 799 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), fast_exp10f(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_min, RGB, THRESHOLD, TRUE, v_minf(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 698 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_max, RGB, THRESHOLD, TRUE, v_minf(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 747 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, THRESHOLD, TRUE, v_minf(), WB_high_picker_update(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 721 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, THRESHOLD, TRUE, v_minf(), WB_low_picker_update(), and dt_iop_module_gui_t::widget.
Referenced by color_picker_apply().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 409 of file negadoctor.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), and dt_iop_negadoctor_global_data_t::kernel_negadoctor.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 422 of file negadoctor.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 824 of file negadoctor.c.
References apply_auto_black(), apply_auto_Dmax(), apply_auto_Dmin(), apply_auto_exposure(), apply_auto_offset(), apply_auto_WB_high(), apply_auto_WB_low(), dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, and void().
| 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 240 of file negadoctor.c.
References d, dt_dev_pixelpipe_iop_t::data, DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, and p.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 182 of file negadoctor.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 176 of file negadoctor.c.
References IOP_GROUP_FILM.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 161 of file negadoctor.c.
References dt_iop_set_description().
|
static |
Definition at line 485 of file negadoctor.c.
References dt_iop_module_t::dev, Dmin_picker_update(), dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_color_picker_reset(), dt_iop_gui_data(), g, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 463 of file negadoctor.c.
References color, DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, dt_iop_gui_data(), g, p, and dt_iop_module_t::params.
Referenced by apply_auto_Dmin(), Dmin_picker_callback(), and gui_changed().
| int flags | ( | ) |
Definition at line 170 of file negadoctor.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_ONE_INSTANCE.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 1068 of file negadoctor.c.
References Dmin_picker_update(), dt_bauhaus_slider_set(), DT_FILMSTOCK_NB, dt_iop_gui_data(), g, IS_NULL_PTR, p, dt_iop_module_t::params, toggle_stock_controls(), WB_high_picker_update(), and WB_low_picker_update().
Referenced by gui_update().
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1060 of file negadoctor.c.
References dt_conf_set_int(), dt_iop_gui_data(), g, IOP_GUI_FREE, and IS_NULL_PTR.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 849 of file negadoctor.c.
References Dmin_picker_callback(), dt_action_button_new(), dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_default(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_factor(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_soft_max(), dt_bauhaus_slider_set_soft_min(), dt_bauhaus_widget_set_label(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), dt_conf_get_int(), DT_GUI_BOX_SPACING, dt_ui_notebook_new(), dt_ui_notebook_page(), dt_ui_notebook_set_picker_owner(), dt_ui_section_label_new(), FALSE, g, dt_iop_module_t::gui, IOP_GUI_ALLOC, row1, row2, TRUE, Wb_high_norm_callback(), WB_high_picker_callback(), Wb_low_norm_callback(), WB_low_picker_callback(), and dt_iop_module_gui_t::widget.
| void gui_reset | ( | dt_iop_module_t * | self | ) |
Definition at line 1118 of file negadoctor.c.
References dt_iop_color_picker_reset(), and TRUE.
| void gui_update | ( | dt_iop_module_t *const | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 1103 of file negadoctor.c.
References dt_bauhaus_slider_set(), dt_iop_color_picker_reset(), dt_iop_gui_data(), g, gui_changed(), p, dt_iop_module_t::params, and TRUE.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 354 of file negadoctor.c.
References d, dt_iop_negadoctor_params_t::Dmin, and dt_iop_default_init().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 398 of file negadoctor.c.
References dt_opencl_create_kernel(), IS_NULL_PTR, and dt_iop_negadoctor_global_data_t::kernel_negadoctor.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 416 of file negadoctor.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 365 of file negadoctor.c.
References DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, dt_gui_presets_add_generic(), dt_iop_negadoctor_params_t::film_stock, and dt_iop_module_so_t::op.
| 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 187 of file negadoctor.c.
References d, dt_iop_module_t::default_params, n, and soft_clip().
| const char * name | ( | ) |
Definition at line 151 of file negadoctor.c.
| __DT_CLONE_TARGETS__ int process | ( | struct dt_iop_module_t *const | self, |
| const dt_dev_pixelpipe_t *const | pipe, | ||
| const dt_dev_pixelpipe_iop_t *const | piece, | ||
| const void *const restrict | ivoid, | ||
| void *const restrict | ovoid | ||
| ) |
Definition at line 272 of file negadoctor.c.
References __OMP_FOR_SIMD__, d, dt_dev_pixelpipe_iop_t::data, DT_DEV_PIXELPIPE_DISPLAY_MASK, fast_exp10f(), fast_expf(), k, dt_dev_pixelpipe_t::mask_display, out, ovoid, dt_dev_pixelpipe_iop_t::roi_out, and THRESHOLD.
| int process_cl | ( | struct dt_iop_module_t *const | self, |
| const dt_dev_pixelpipe_t *const | pipe, | ||
| const dt_dev_pixelpipe_iop_t *const | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
Definition at line 315 of file negadoctor.c.
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), dt_print(), error(), FALSE, dt_iop_module_t::global_data, height, dt_iop_negadoctor_global_data_t::kernel_negadoctor, dt_dev_pixelpipe_iop_t::roi_in, ROUNDUPDHT, ROUNDUPDWD, TRUE, and width.
|
static |
Definition at line 431 of file negadoctor.c.
Referenced by toggle_stock_controls().
|
static |
Definition at line 438 of file negadoctor.c.
References dt_bauhaus_widget_set_label(), DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, dt_iop_gui_data(), FALSE, g, p, dt_iop_module_t::params, setup_color_variables(), and TRUE.
Referenced by gui_changed().
|
static |
Definition at line 628 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, TRUE, v_minf(), WB_low_picker_update(), and dt_iop_module_gui_t::widget.
Referenced by gui_init().
|
static |
Definition at line 578 of file negadoctor.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_color_picker_reset(), dt_iop_gui_data(), g, k, p, dt_iop_module_t::params, RGB, TRUE, v_minf(), and WB_high_picker_update().
Referenced by gui_init().
|
static |
Definition at line 558 of file negadoctor.c.
References color, dt_iop_gui_data(), g, p, dt_iop_module_t::params, and v_maxf().
Referenced by apply_auto_WB_high(), gui_changed(), and WB_high_picker_callback().
|
static |
Definition at line 604 of file negadoctor.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, p, dt_iop_module_t::params, TRUE, v_maxf(), WB_low_picker_update(), and dt_iop_module_gui_t::widget.
Referenced by gui_init().
|
static |
Definition at line 530 of file negadoctor.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_color_picker_reset(), dt_iop_gui_data(), g, k, p, dt_iop_module_t::params, RGB, TRUE, v_minf(), and WB_low_picker_update().
Referenced by gui_init().
|
static |
Definition at line 510 of file negadoctor.c.
References color, dt_iop_gui_data(), g, p, dt_iop_module_t::params, and v_maxf().
Referenced by apply_auto_WB_low(), gui_changed(), Wb_high_norm_callback(), Wb_low_norm_callback(), and WB_low_picker_callback().