![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "develop/iop_profile.h"#include "pixel/rgb_norms.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/module_versioning.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "gui/color_picker_proxy.h"#include "widgets/gdkkeys.h"#include "gui/presets.h"#include "widgets/draw.h"#include "control/control.h"#include "libs/colorpicker.h"#include "widgets/notebook.h"#include "widgets/scroll_wrap.h"#include "gui/screen_metrics.h"#include "widgets/togglebutton.h"
Include dependency graph for rgbcurve.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_rgbcurve_node_t |
| struct | dt_iop_rgbcurve_params_t |
| struct | dt_iop_rgbcurve_gui_data_t |
| struct | dt_iop_rgbcurve_data_t |
Macros | |
| #define | DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(1) |
| #define | DT_IOP_RGBCURVE_RES 256 |
| #define | DT_IOP_RGBCURVE_MAXNODES 20 |
| #define | DT_IOP_RGBCURVE_MIN_X_DISTANCE 0.0025f |
| #define | DT_IOP_COLOR_ICC_LEN 512 |
| #define | RGBCURVE_DEFAULT_STEP (0.001f) |
Typedefs | |
| typedef enum rgbcurve_channel_t | rgbcurve_channel_t |
| typedef enum dt_iop_rgbcurve_autoscale_t | dt_iop_rgbcurve_autoscale_t |
| typedef struct dt_iop_rgbcurve_node_t | dt_iop_rgbcurve_node_t |
| typedef struct dt_iop_rgbcurve_params_t | dt_iop_rgbcurve_params_t |
| typedef struct dt_iop_rgbcurve_gui_data_t | dt_iop_rgbcurve_gui_data_t |
| typedef struct dt_iop_rgbcurve_data_t | dt_iop_rgbcurve_data_t |
| typedef float(* | _curve_table_ptr)[0x10000] |
| typedef float(* | _coeffs_table_ptr)[3] |
Enumerations | |
| enum | rgbcurve_channel_t { DT_IOP_RGBCURVE_R = 0 , DT_IOP_RGBCURVE_G = 1 , DT_IOP_RGBCURVE_B = 2 , DT_IOP_RGBCURVE_MAX_CHANNELS = 3 } |
| enum | dt_iop_rgbcurve_autoscale_t { DT_S_SCALE_AUTOMATIC_RGB = 0 , DT_S_SCALE_MANUAL_RGB = 1 } |
| #define DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(1) |
Definition at line 73 of file rgbcurve.c.
| #define DT_IOP_COLOR_ICC_LEN 512 |
Definition at line 79 of file rgbcurve.c.
| #define DT_IOP_RGBCURVE_MAXNODES 20 |
Definition at line 75 of file rgbcurve.c.
| #define DT_IOP_RGBCURVE_MIN_X_DISTANCE 0.0025f |
Definition at line 76 of file rgbcurve.c.
| #define DT_IOP_RGBCURVE_RES 256 |
Definition at line 74 of file rgbcurve.c.
| #define RGBCURVE_DEFAULT_STEP (0.001f) |
Definition at line 622 of file rgbcurve.c.
| typedef float(* _coeffs_table_ptr)[3] |
Definition at line 150 of file rgbcurve.c.
| typedef float(* _curve_table_ptr)[0x10000] |
Definition at line 149 of file rgbcurve.c.
| typedef enum dt_iop_rgbcurve_autoscale_t dt_iop_rgbcurve_autoscale_t |
| typedef struct dt_iop_rgbcurve_data_t dt_iop_rgbcurve_data_t |
| typedef struct dt_iop_rgbcurve_gui_data_t dt_iop_rgbcurve_gui_data_t |
| typedef struct dt_iop_rgbcurve_node_t dt_iop_rgbcurve_node_t |
| typedef struct dt_iop_rgbcurve_params_t dt_iop_rgbcurve_params_t |
| typedef enum rgbcurve_channel_t rgbcurve_channel_t |
| Enumerator | |
|---|---|
| DT_S_SCALE_AUTOMATIC_RGB | |
| DT_S_SCALE_MANUAL_RGB | |
Definition at line 91 of file rgbcurve.c.
| enum rgbcurve_channel_t |
| Enumerator | |
|---|---|
| DT_IOP_RGBCURVE_R | |
| DT_IOP_RGBCURVE_G | |
| DT_IOP_RGBCURVE_B | |
| DT_IOP_RGBCURVE_MAX_CHANNELS | |
Definition at line 83 of file rgbcurve.c.
|
inlinestatic |
Definition at line 468 of file rgbcurve.c.
References i, k, selected, x, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by _add_node_from_picker(), _area_button_press_callback(), _area_motion_notify_callback(), and color_picker_apply().
|
inlinestatic |
Definition at line 497 of file rgbcurve.c.
References _add_node(), ch, dt_camera_rgb_luminance(), DT_S_SCALE_AUTOMATIC_RGB, IS_NULL_PTR, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::nonlinearlut, p, and x.
Referenced by color_picker_apply().
|
static |
Definition at line 1126 of file rgbcurve.c.
References _add_node(), _curve_to_mouse(), _mouse_to_curve(), ch, d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dist(), dt_bauhaus_combobox_set(), dt_dev_add_history_item, dt_draw_curve_calc_value(), DT_GUI_CURVE_EDITOR_INSET, dt_iop_color_picker_reset(), dt_iop_gui_data(), DT_IOP_RGBCURVE_MAXNODES, DT_IOP_RGBCURVE_R, dt_modifier_is(), DT_PRIMARY_MASK, DT_S_SCALE_MANUAL_RGB, FALSE, g, dt_iop_module_t::gui, height, k, min, p, dt_iop_module_t::params, selected, TRUE, dt_iop_module_gui_t::widget, width, x, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
Definition at line 701 of file rgbcurve.c.
References _curve_to_mouse(), ch, dt_develop_t::color_picker, dt_iop_module_t::dev, dt_bauhaus_get_global(), dt_cairo_image_surface_create(), dt_draw_curve_add_point(), dt_draw_curve_calc_values(), dt_draw_curve_destroy(), dt_draw_curve_new(), dt_draw_curve_set_point(), dt_draw_grid_zoomed(), dt_draw_histogram_8_zoomed(), DT_GUI_CURVE_EDITOR_INSET, dt_iop_estimate_exp(), dt_iop_eval_exp(), dt_iop_gui_data(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_R, DT_IOP_RGBCURVE_RES, dt_ioppr_get_iop_work_profile_info(), dt_ioppr_get_pipe_output_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), DT_LIB_COLORPICKER_STATISTIC_MAX, DT_LIB_COLORPICKER_STATISTIC_MEAN, DT_LIB_COLORPICKER_STATISTIC_MIN, DT_PIXEL_APPLY_DPI, DT_REQUEST_COLORPICK_OFF, DT_S_SCALE_AUTOMATIC_RGB, DT_S_SCALE_MANUAL_RGB, dt_iop_module_t::enabled, FALSE, g, height, dt_iop_module_t::histogram, dt_iop_module_t::histogram_max, dt_develop_t::iop, IS_NULL_PTR, k, M_PI, 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, dt_iop_module_t::picked_output_color, picker_scale(), dt_develop_t::pipe, dt_iop_module_t::request_color_pick, dt_develop_t::samples, dt_colorpicker_sample_t::scope, set_color(), TRUE, unbounded_coeffs, width, x, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
|
static |
Definition at line 647 of file rgbcurve.c.
References _move_point_internal(), dt_iop_color_picker_reset(), dt_iop_gui_data(), DT_IOP_RGBCURVE_R, dt_keys_mainpad_alternatives(), DT_S_SCALE_MANUAL_RGB, FALSE, g, key, p, dt_iop_module_t::params, RGBCURVE_DEFAULT_STEP, and TRUE.
Referenced by gui_init().
|
static |
|
static |
Definition at line 1045 of file rgbcurve.c.
References _add_node(), _curve_to_mouse(), _mouse_to_curve(), _move_point_internal(), ch, dt_iop_module_t::dev, dist(), dt_dev_add_history_item, DT_GUI_CURVE_EDITOR_INSET, dt_iop_color_picker_reset(), dt_iop_gui_data(), DT_IOP_RGBCURVE_R, DT_S_SCALE_MANUAL_RGB, g, height, k, min, p, dt_iop_module_t::params, selected, TRUE, width, x, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
|
static |
Definition at line 624 of file rgbcurve.c.
References _move_point_internal(), dt_gui_get_scroll_delta(), dt_iop_color_picker_reset(), dt_iop_gui_data(), DT_IOP_RGBCURVE_R, DT_S_SCALE_MANUAL_RGB, g, p, dt_iop_module_t::params, RGBCURVE_DEFAULT_STEP, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 302 of file rgbcurve.c.
References x.
Referenced by _area_button_press_callback(), _area_draw_callback(), and _area_motion_notify_callback().
|
static |
Definition at line 1471 of file rgbcurve.c.
References ch, d, dt_draw_curve_add_point(), dt_draw_curve_calc_values(), dt_draw_curve_destroy(), dt_draw_curve_new(), dt_draw_curve_set_point(), dt_iop_estimate_exp(), DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_MAXNODES, dt_ioppr_get_pipe_work_profile_info(), dt_iop_order_iccprofile_info_t::filename, IS_NULL_PTR, k, dt_iop_order_iccprofile_info_t::type, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by process().
|
static |
Definition at line 360 of file rgbcurve.c.
References FALSE, k, p, and TRUE.
Referenced by gui_changed().
|
static |
Definition at line 307 of file rgbcurve.c.
References x.
Referenced by _area_button_press_callback(), and _area_motion_notify_callback().
|
static |
Definition at line 598 of file rgbcurve.c.
References _sanity_check(), ch, dt_iop_module_t::dev, dt_dev_add_history_item, dt_iop_gui_data(), g, p, dt_iop_module_t::params, TRUE, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by _area_key_press_callback(), _area_motion_notify_callback(), and _area_scrolled_callback().
|
static |
Definition at line 353 of file rgbcurve.c.
References DT_S_SCALE_AUTOMATIC_RGB, DT_S_SCALE_MANUAL_RGB, g, and p.
Referenced by gui_changed(), and gui_update().
|
static |
Definition at line 577 of file rgbcurve.c.
References DT_IOP_RGBCURVE_MIN_X_DISTANCE, FALSE, selected, TRUE, and x.
Referenced by _move_point_internal().
| void change_image | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1273 of file rgbcurve.c.
References dt_iop_gui_data(), DT_IOP_RGBCURVE_R, g, and IS_NULL_PTR.
Referenced by gui_init().
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1442 of file rgbcurve.c.
References ch, d, dt_dev_pixelpipe_iop_t::data, dt_draw_curve_destroy(), dt_free_align, DT_IOP_RGBCURVE_MAX_CHANNELS, and IS_NULL_PTR.
| 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 529 of file rgbcurve.c.
References _add_node(), _add_node_from_picker(), ch, d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_control_queue_redraw_widget(), dt_dev_add_history_item, dt_iop_gui_data(), DT_IOP_RGBCURVE_MAXNODES, dt_ioppr_get_pipe_work_profile_info(), dt_key_modifier_state(), dt_modifier_is(), DT_PRIMARY_MASK, g, dt_iop_module_t::gui, k, 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, state, TRUE, void(), and dt_iop_module_gui_t::widget.
| 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 | ||
| ) |
Definition at line 1536 of file rgbcurve.c.
References ch, d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_COLORSPACE_NONE, dt_dev_pixelpipe_has_preview_output(), DT_IOP_RGBCURVE_MAX_CHANNELS, DT_REQUEST_ON, p, and dt_dev_pixelpipe_iop_t::request_histogram.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 167 of file rgbcurve.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 157 of file rgbcurve.c.
References IOP_GROUP_COLOR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 172 of file rgbcurve.c.
References dt_iop_set_description().
| int flags | ( | ) |
Definition at line 162 of file rgbcurve.c.
References IOP_FLAGS_ALLOW_TILING, and IOP_FLAGS_SUPPORTS_BLENDING.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 368 of file rgbcurve.c.
References _is_identity(), _rgbcurve_show_hide_controls(), ch, dt_iop_module_t::dev, dt_iop_gui_data(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_MAXNODES, DT_IOP_RGBCURVE_R, dt_ioppr_get_iop_work_profile_info(), DT_S_SCALE_MANUAL_RGB, g, dt_iop_module_t::histogram_middle_grey, dt_develop_t::iop, IS_NULL_PTR, k, p, and dt_iop_module_t::params.
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1402 of file rgbcurve.c.
References dt_draw_curve_destroy(), dt_iop_gui_data(), DT_IOP_RGBCURVE_MAX_CHANNELS, g, IOP_GUI_FREE, and k.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1287 of file rgbcurve.c.
References _area_button_press_callback(), _area_draw_callback(), _area_enter_notify_callback(), _area_key_press_callback(), _area_leave_notify_callback(), _area_motion_notify_callback(), _area_resized_callback(), _area_scrolled_callback(), ch, change_image(), CPF_ALTER, dt_iop_module_t::default_params, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), dt_bauhaus_get_global(), dt_bauhaus_toggle_from_params(), dt_bauhaus_widget_set_label(), DT_COLOR_PICKER_AREA, dt_color_picker_new(), DT_COLOR_PICKER_POINT_AREA, dt_draw_curve_add_point(), dt_draw_curve_new(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_R, DT_PIXEL_APPLY_DPI, dt_ui_notebook_page(), dt_ui_notebook_set_picker_owner(), dt_ui_resizable_drawing_area(), dt_widget_scroll_mask(), dtgtk_cairo_paint_colorpicker(), DTGTK_TOGGLEBUTTON, dtgtk_togglebutton_set_paint(), FALSE, g, dt_iop_module_t::gui, interpolator_callback(), IOP_GUI_ALLOC, k, p, tab_switch_callback(), dt_iop_module_gui_t::timeout_handle, TRUE, and dt_iop_module_gui_t::widget.
| void gui_reset | ( | struct dt_iop_module_t * | self | ) |
Definition at line 1258 of file rgbcurve.c.
References dt_bauhaus_combobox_set(), dt_iop_gui_data(), DT_IOP_RGBCURVE_R, g, dt_iop_module_t::gui, p, dt_iop_module_t::params, and dt_iop_module_gui_t::widget.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 1385 of file rgbcurve.c.
References _rgbcurve_show_hide_controls(), dt_bauhaus_combobox_set(), dt_iop_gui_data(), DT_IOP_RGBCURVE_R, g, dt_iop_module_t::gui, p, dt_iop_module_t::params, and dt_iop_module_gui_t::widget.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 1453 of file rgbcurve.c.
References dt_iop_rgbcurve_params_t::curve_nodes, d, dt_iop_default_init(), and dt_iop_rgbcurve_node_t::x.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1412 of file rgbcurve.c.
References ch, dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_num_nodes, dt_iop_rgbcurve_params_t::curve_type, d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_iop_module_t::default_params, dt_calloc_align(), dt_draw_curve_add_point(), dt_draw_curve_new(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_R, IS_NULL_PTR, k, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
for pure power-like functions, we need more nodes close to the bounds
Definition at line 181 of file rgbcurve.c.
References CUBIC_SPLINE, dt_gui_presets_add_generic(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_R, DT_S_SCALE_AUTOMATIC_RGB, k, MONOTONE_HERMITE, dt_iop_module_so_t::op, and p.
|
static |
Definition at line 424 of file rgbcurve.c.
References CATMULL_ROM, CUBIC_SPLINE, dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_gui_data(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_R, g, MONOTONE_HERMITE, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
| const char * name | ( | ) |
Definition at line 152 of file rgbcurve.c.
|
static |
Definition at line 312 of file rgbcurve.c.
References dt_camera_rgb_luminance(), DT_S_SCALE_AUTOMATIC_RGB, DT_S_SCALE_MANUAL_RGB, IS_NULL_PTR, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, dt_iop_order_iccprofile_info_t::nonlinearlut, out, and p.
Referenced by _area_draw_callback().
| __DT_CLONE_TARGETS__ 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 | ||
| ) |
Definition at line 1560 of file rgbcurve.c.
References __OMP_PARALLEL_FOR__, _generate_curve_lut(), d, dt_dev_pixelpipe_iop_t::data, dt_iop_eval_exp(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_R, dt_ioppr_get_pipe_work_profile_info(), dt_rgb_norm(), DT_RGB_NORM_NONE, DT_S_SCALE_AUTOMATIC_RGB, DT_S_SCALE_MANUAL_RGB, height, dt_iop_roi_t::height, out, ovoid, dt_dev_pixelpipe_iop_t::roi_out, unbounded_coeffs, width, and dt_iop_roi_t::width.
|
static |
Definition at line 446 of file rgbcurve.c.
References dt_gui_widgets_suppressed(), dt_iop_gui_data(), g, dt_iop_module_t::gui, and dt_iop_module_gui_t::widget.
Referenced by gui_init().