![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"#include "common/darktable.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 "develop/openmp_maths.h"#include "dtgtk/button.h"#include "dtgtk/resetlabel.h"#include "gui/gtk.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 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 72 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 78 of file negadoctor.c.
| const char * aliases | ( | ) |
Definition at line 150 of file negadoctor.c.
|
static |
Definition at line 767 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, fast_exp10f(), g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_max, dt_gui_gtk_t::reset, RGB, THRESHOLD, TRUE, v_maxf(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 668 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_min, dt_gui_gtk_t::reset, RGB, THRESHOLD, TRUE, v_maxf(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 648 of file negadoctor.c.
References darktable, darktable_t::develop, Dmin_picker_update(), dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, k, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_gui_gtk_t::reset, TRUE, and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 793 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, fast_exp10f(), g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_min, dt_gui_gtk_t::reset, RGB, THRESHOLD, TRUE, v_minf(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 692 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color_max, dt_gui_gtk_t::reset, RGB, THRESHOLD, TRUE, v_minf(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 741 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_gui_gtk_t::reset, THRESHOLD, TRUE, v_minf(), WB_high_picker_update(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
|
static |
Definition at line 715 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, dt_gui_gtk_t::reset, THRESHOLD, TRUE, v_minf(), WB_low_picker_update(), and dt_iop_module_t::widget.
Referenced by color_picker_apply().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 403 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 416 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 818 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(), darktable, g, darktable_t::gui, dt_iop_module_t::gui_data, dt_gui_gtk_t::reset, 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 234 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 176 of file negadoctor.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 170 of file negadoctor.c.
References IOP_GROUP_FILM.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 155 of file negadoctor.c.
References dt_iop_set_description().
|
static |
Definition at line 479 of file negadoctor.c.
References darktable, darktable_t::develop, Dmin_picker_update(), dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_iop_color_picker_reset(), g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 457 of file negadoctor.c.
References DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, g, dt_iop_module_t::gui_data, p, and dt_iop_module_t::params.
Referenced by apply_auto_Dmin(), Dmin_picker_callback(), and gui_changed().
| int flags | ( | ) |
Definition at line 164 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 1058 of file negadoctor.c.
References Dmin_picker_update(), dt_bauhaus_slider_set(), DT_FILMSTOCK_NB, g, dt_iop_module_t::gui_data, 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 1050 of file negadoctor.c.
References dt_conf_set_int(), g, dt_iop_module_t::gui_data, IOP_GUI_FREE, and IS_NULL_PTR.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 843 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_section_label_new(), FALSE, g, 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_t::widget.
| void gui_reset | ( | dt_iop_module_t * | self | ) |
Definition at line 1108 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 1093 of file negadoctor.c.
References dt_bauhaus_slider_set(), dt_iop_color_picker_reset(), g, gui_changed(), dt_iop_module_t::gui_data, p, dt_iop_module_t::params, and TRUE.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 348 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 392 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 410 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 359 of file negadoctor.c.
References DEVELOP_BLEND_CS_RGB_DISPLAY, 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 181 of file negadoctor.c.
References d, dt_iop_module_t::default_params, n, and soft_clip().
| const char * name | ( | ) |
Definition at line 145 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 266 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 309 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 425 of file negadoctor.c.
Referenced by toggle_stock_controls().
|
static |
Definition at line 432 of file negadoctor.c.
References dt_bauhaus_widget_set_label(), DT_FILMSTOCK_COLOR, DT_FILMSTOCK_NB, FALSE, g, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, setup_color_variables(), and TRUE.
Referenced by gui_changed().
|
static |
Definition at line 622 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_gui_gtk_t::reset, TRUE, v_minf(), WB_low_picker_update(), and dt_iop_module_t::widget.
Referenced by gui_init().
|
static |
Definition at line 572 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_iop_color_picker_reset(), g, darktable_t::gui, dt_iop_module_t::gui_data, k, p, dt_iop_module_t::params, dt_gui_gtk_t::reset, RGB, TRUE, v_minf(), and WB_high_picker_update().
Referenced by gui_init().
|
static |
Definition at line 552 of file negadoctor.c.
References g, dt_iop_module_t::gui_data, 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 598 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_control_queue_redraw_widget(), dt_dev_add_history_item, g, darktable_t::gui, dt_iop_module_t::gui_data, p, dt_iop_module_t::params, dt_gui_gtk_t::reset, TRUE, v_maxf(), WB_low_picker_update(), and dt_iop_module_t::widget.
Referenced by gui_init().
|
static |
Definition at line 524 of file negadoctor.c.
References darktable, darktable_t::develop, dt_bauhaus_slider_set(), dt_dev_add_history_item, dt_iop_color_picker_reset(), g, darktable_t::gui, dt_iop_module_t::gui_data, k, p, dt_iop_module_t::params, dt_gui_gtk_t::reset, RGB, TRUE, v_minf(), and WB_low_picker_update().
Referenced by gui_init().
|
static |
Definition at line 504 of file negadoctor.c.
References g, dt_iop_module_t::gui_data, 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().