![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"
#include "common/iop_profile.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/rgb_norms.h"
#include "develop/imageop.h"
#include "develop/imageop_math.h"
#include "develop/imageop_gui.h"
#include "dtgtk/drawingarea.h"
#include "gui/color_picker_proxy.h"
#include "gui/presets.h"
#include "gui/draw.h"
#include "control/control.h"
#include "libs/colorpicker.h"
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 |
struct | dt_iop_rgbcurve_global_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] |
typedef struct dt_iop_rgbcurve_global_data_t | dt_iop_rgbcurve_global_data_t |
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 } |
Functions | |
const char * | name () |
int | default_group () |
int | flags () |
int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
const char ** | description (struct dt_iop_module_t *self) |
void | init_presets (dt_iop_module_so_t *self) |
static float | _curve_to_mouse (const float x, const float zoom_factor, const float offset) |
static float | _mouse_to_curve (const float x, const float zoom_factor, const float offset) |
static void | picker_scale (const float *const in, float *out, dt_iop_rgbcurve_params_t *p, const dt_iop_order_iccprofile_info_t *const work_profile) |
static void | _rgbcurve_show_hide_controls (dt_iop_rgbcurve_params_t *p, dt_iop_rgbcurve_gui_data_t *g) |
static gboolean | _is_identity (dt_iop_rgbcurve_params_t *p, rgbcurve_channel_t channel) |
void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
static void | interpolator_callback (GtkWidget *widget, dt_iop_module_t *self) |
static void | tab_switch_callback (GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data) |
static gboolean | _area_resized_callback (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
static int | _add_node (dt_iop_rgbcurve_node_t *curve_nodes, int *nodes, float x, float y) |
static int | _add_node_from_picker (dt_iop_rgbcurve_params_t *p, const float *const in, const float increment, const int ch, const dt_iop_order_iccprofile_info_t *const work_profile) |
void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_iop_t *piece) |
static gboolean | _sanity_check (const float x, const int selected, const int nodes, const dt_iop_rgbcurve_node_t *curve) |
static gboolean | _move_point_internal (dt_iop_module_t *self, GtkWidget *widget, float dx, float dy, guint state) |
static gboolean | _area_scrolled_callback (GtkWidget *widget, GdkEventScroll *event, dt_iop_module_t *self) |
static gboolean | _area_key_press_callback (GtkWidget *widget, GdkEventKey *event, dt_iop_module_t *self) |
static gboolean | _area_enter_notify_callback (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
static gboolean | _area_leave_notify_callback (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
static gboolean | _area_draw_callback (GtkWidget *widget, cairo_t *crf, dt_iop_module_t *self) |
static gboolean | _area_motion_notify_callback (GtkWidget *widget, GdkEventMotion *event, dt_iop_module_t *self) |
static gboolean | _area_button_press_callback (GtkWidget *widget, GdkEventButton *event, dt_iop_module_t *self) |
void | gui_reset (struct dt_iop_module_t *self) |
void | change_image (struct dt_iop_module_t *self) |
void | gui_init (struct dt_iop_module_t *self) |
void | gui_update (struct dt_iop_module_t *self) |
void | gui_cleanup (struct dt_iop_module_t *self) |
void | init_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
void | cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
void | init (dt_iop_module_t *module) |
void | init_global (dt_iop_module_so_t *module) |
void | cleanup_global (dt_iop_module_so_t *module) |
static void | _generate_curve_lut (dt_dev_pixelpipe_t *pipe, dt_iop_rgbcurve_data_t *d) |
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) |
void | process (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) |
#define DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(1) |
#define DT_IOP_COLOR_ICC_LEN 512 |
#define DT_IOP_RGBCURVE_MAXNODES 20 |
#define DT_IOP_RGBCURVE_MIN_X_DISTANCE 0.0025f |
#define DT_IOP_RGBCURVE_RES 256 |
#define RGBCURVE_DEFAULT_STEP (0.001f) |
typedef float(* _coeffs_table_ptr)[3] |
typedef float(* _curve_table_ptr)[0x10000] |
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_global_data_t dt_iop_rgbcurve_global_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 |
enum rgbcurve_channel_t |
|
inlinestatic |
References 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 |
References _add_node(), dt_camera_rgb_luminance(), dt_ioppr_compensate_middle_grey(), dt_ioppr_get_rgb_matrix_luminance(), DT_S_SCALE_AUTOMATIC_RGB, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, and dt_iop_order_iccprofile_info_t::nonlinearlut.
Referenced by color_picker_apply().
|
static |
References _add_node(), _curve_to_mouse(), _mouse_to_curve(), dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_num_nodes, dt_iop_rgbcurve_params_t::curve_type, dt_develop_t::darkroom_skip_mouse_events, darktable, dt_iop_module_t::default_params, darktable_t::develop, 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_RGBCURVE_R, dt_modifier_is(), DT_S_SCALE_MANUAL_RGB, FALSE, dt_iop_module_t::gui_data, height, dt_iop_module_t::params, TRUE, dt_iop_module_t::widget, width, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
References _curve_to_mouse(), darktable_t::bauhaus, dt_lib_t::colorpicker, dt_develop_t::darkroom_skip_mouse_events, darktable, dt_iop_module_t::dev, darktable_t::develop, 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_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, dt_bauhaus_t::graph_colors, dt_iop_module_t::gui_data, height, dt_iop_module_t::histogram, dt_iop_module_t::histogram_max, dt_develop_t::iop, darktable_t::lib, dt_lib_t::live_samples, M_PI, dt_bauhaus_t::pango_font_desc, 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_lib_t::proxy, dt_iop_module_t::request_color_pick, dt_colorpicker_sample_t::scope, set_color(), TRUE, width, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
References TRUE.
Referenced by gui_init().
|
static |
|
static |
References TRUE.
Referenced by gui_init().
|
static |
References _add_node(), _curve_to_mouse(), _mouse_to_curve(), _move_point_internal(), dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dist(), dt_dev_add_history_item, DT_GUI_CURVE_EDITOR_INSET, dt_iop_color_picker_reset(), DT_IOP_RGBCURVE_R, DT_S_SCALE_MANUAL_RGB, dt_iop_module_t::gui_data, height, dt_iop_module_t::params, TRUE, dt_iop_module_t::widget, width, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by gui_init().
|
static |
References TRUE.
Referenced by gui_init().
|
static |
References _mouse_to_curve(), _move_point_internal(), dt_develop_t::darkroom_skip_mouse_events, darktable, darktable_t::develop, dt_gui_get_scroll_delta(), dt_gui_get_scroll_deltas(), dt_iop_color_picker_reset(), DT_IOP_RGBCURVE_R, DT_S_SCALE_MANUAL_RGB, dt_iop_module_t::gui_data, dt_iop_module_t::params, RGBCURVE_DEFAULT_STEP, TRUE, and dt_iop_module_t::widget.
Referenced by gui_init().
|
static |
Referenced by _area_button_press_callback(), _area_draw_callback(), and _area_motion_notify_callback().
|
static |
References dt_iop_rgbcurve_params_t::compensate_middle_grey, dt_iop_rgbcurve_data_t::curve, dt_iop_rgbcurve_data_t::curve_changed, dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_num_nodes, dt_iop_rgbcurve_params_t::curve_type, 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_ioppr_uncompensate_middle_grey(), dt_iop_order_iccprofile_info_t::filename, dt_iop_rgbcurve_data_t::filename_work, dt_iop_rgbcurve_data_t::params, dt_iop_rgbcurve_data_t::table, dt_iop_order_iccprofile_info_t::type, dt_iop_rgbcurve_data_t::type_work, dt_iop_rgbcurve_data_t::unbounded_coeffs, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
Referenced by process().
|
static |
Referenced by gui_changed().
|
static |
Referenced by _area_button_press_callback(), _area_motion_notify_callback(), and _area_scrolled_callback().
|
static |
|
static |
References DT_S_SCALE_AUTOMATIC_RGB, and DT_S_SCALE_MANUAL_RGB.
Referenced by gui_changed(), and gui_update().
|
static |
References DT_IOP_RGBCURVE_MIN_X_DISTANCE, FALSE, and TRUE.
Referenced by _move_point_internal().
void change_image | ( | struct dt_iop_module_t * | self | ) |
References DT_IOP_RGBCURVE_R, and dt_iop_module_t::gui_data.
Referenced by gui_init().
void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
void color_picker_apply | ( | dt_iop_module_t * | self, |
GtkWidget * | picker, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References _add_node(), _add_node_from_picker(), dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_num_nodes, dt_iop_rgbcurve_params_t::curve_type, darktable, dt_iop_module_t::default_params, darktable_t::develop, dt_control_queue_redraw_widget(), dt_dev_add_history_item, DT_IOP_RGBCURVE_MAXNODES, dt_ioppr_get_pipe_work_profile_info(), dt_key_modifier_state(), dt_modifier_is(), dt_iop_module_t::gui_data, 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_dev_pixelpipe_iop_t::pipe, TRUE, dt_iop_module_t::widget, dt_iop_rgbcurve_node_t::x, and dt_iop_rgbcurve_node_t::y.
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 | ||
) |
References dt_iop_rgbcurve_data_t::curve_changed, dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_type, dt_dev_pixelpipe_iop_t::data, DT_COLORSPACE_NONE, DT_DEV_PIXELPIPE_PREVIEW, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_REQUEST_ON, dt_iop_rgbcurve_data_t::filename_work, dt_iop_rgbcurve_data_t::params, dt_dev_pixelpipe_iop_t::request_histogram, dt_dev_pixelpipe_t::type, and dt_iop_rgbcurve_data_t::type_work.
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_RGB.
int default_group | ( | ) |
References IOP_GROUP_COLOR.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
int flags | ( | ) |
References IOP_FLAGS_ALLOW_TILING, and IOP_FLAGS_SUPPORTS_BLENDING.
void gui_changed | ( | dt_iop_module_t * | self, |
GtkWidget * | w, | ||
void * | previous | ||
) |
References _is_identity(), _rgbcurve_show_hide_controls(), dt_iop_module_t::dev, DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_MAXNODES, DT_IOP_RGBCURVE_R, dt_ioppr_compensate_middle_grey(), dt_ioppr_get_iop_work_profile_info(), dt_ioppr_uncompensate_middle_grey(), DT_S_SCALE_MANUAL_RGB, dt_iop_module_t::gui_data, dt_iop_module_t::histogram_middle_grey, dt_develop_t::iop, and dt_iop_module_t::params.
void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
void gui_init | ( | struct dt_iop_module_t * | self | ) |
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(), darktable_t::bauhaus, change_image(), darktable, dt_iop_module_t::default_params, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), 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_add_class(), DT_GUI_MODULE, DT_IOP_RGBCURVE_MAX_CHANNELS, DT_IOP_RGBCURVE_R, DT_PIXEL_APPLY_DPI, dt_ui_notebook_page(), dtgtk_cairo_paint_colorpicker_set_values(), dtgtk_drawing_area_new_with_aspect_ratio(), DTGTK_TOGGLEBUTTON, dtgtk_togglebutton_set_paint(), FALSE, darktable_t::gui, interpolator_callback(), IOP_GUI_ALLOC, dt_gui_gtk_t::scroll_mask, tab_switch_callback(), dt_iop_module_t::timeout_handle, TRUE, and dt_iop_module_t::widget.
void gui_reset | ( | struct dt_iop_module_t * | self | ) |
void gui_update | ( | struct dt_iop_module_t * | self | ) |
void init | ( | dt_iop_module_t * | module | ) |
void init_global | ( | dt_iop_module_so_t * | module | ) |
References dt_opencl_create_kernel(), and dt_iop_rgbcurve_global_data_t::kernel_rgbcurve.
void init_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References dt_iop_rgbcurve_data_t::curve, dt_iop_rgbcurve_params_t::curve_nodes, dt_iop_rgbcurve_params_t::curve_num_nodes, dt_iop_rgbcurve_params_t::curve_type, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, dt_iop_module_t::default_params, 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, dt_iop_rgbcurve_data_t::params, dt_iop_rgbcurve_data_t::table, 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
References CUBIC_SPLINE, DEVELOP_BLEND_CS_RGB_DISPLAY, dt_gui_presets_add_generic(), DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_R, DT_S_SCALE_AUTOMATIC_RGB, MONOTONE_HERMITE, and dt_iop_module_so_t::op.
|
static |
References CATMULL_ROM, CUBIC_SPLINE, darktable, darktable_t::develop, dt_bauhaus_combobox_get(), dt_dev_add_history_item, DT_IOP_RGBCURVE_B, DT_IOP_RGBCURVE_G, DT_IOP_RGBCURVE_R, darktable_t::gui, dt_iop_module_t::gui_data, MONOTONE_HERMITE, dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
const char * name | ( | ) |
|
static |
References dt_camera_rgb_luminance(), dt_ioppr_compensate_middle_grey(), dt_ioppr_get_rgb_matrix_luminance(), DT_S_SCALE_AUTOMATIC_RGB, DT_S_SCALE_MANUAL_RGB, dt_iop_order_iccprofile_info_t::lut_in, dt_iop_order_iccprofile_info_t::lutsize, dt_iop_order_iccprofile_info_t::matrix_in, and dt_iop_order_iccprofile_info_t::nonlinearlut.
Referenced by _area_draw_callback().
void process | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_iop_t * | piece, | ||
const void *const | ivoid, | ||
void *const | ovoid, | ||
const dt_iop_roi_t *const | roi_in, | ||
const dt_iop_roi_t *const | roi_out | ||
) |
References _generate_curve_lut(), dt_dev_pixelpipe_iop_t::colors, dt_dev_pixelpipe_iop_t::data, dt_iop_eval_exp(), dt_iop_have_required_input_format(), 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, dt_dev_pixelpipe_iop_t::pipe, width, and dt_iop_roi_t::width.
|
static |
References darktable, darktable_t::gui, dt_iop_module_t::gui_data, dt_gui_gtk_t::reset, and dt_iop_module_t::widget.
Referenced by gui_init().