![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks_gui.h"#include <assert.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 "database/database.h"#include <math.h>#include <stdlib.h>#include <string.h>#include "widgets/bauhaus.h"#include "widgets/accelerators.h"#include "colorprofiles/colorspaces.h"#include "common/opencl.h"#include "control/redraw.h"#include "develop/develop.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/imageop_gui.h"#include "develop/masks.h"#include "gui/color_picker_proxy.h"#include "widgets/draw.h"#include "gui/presets.h"#include "iop/iop_api.h"
Include dependency graph for graduatednd.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_graduatednd_params_t |
| struct | dt_iop_graduatednd_global_data_t |
| struct | grad_point_t |
| struct | dt_iop_graduatednd_gui_data_t |
| struct | dt_iop_graduatednd_data_t |
| struct | dt_iop_vector_2d_t |
Typedefs | |
| typedef struct dt_iop_graduatednd_params_t | dt_iop_graduatednd_params_t |
| typedef struct dt_iop_graduatednd_global_data_t | dt_iop_graduatednd_global_data_t |
| typedef struct grad_point_t | grad_point_t |
| typedef struct dt_iop_graduatednd_gui_data_t | dt_iop_graduatednd_gui_data_t |
| typedef struct dt_iop_graduatednd_data_t | dt_iop_graduatednd_data_t |
| typedef struct dt_iop_vector_2d_t | dt_iop_vector_2d_t |
Functions | |
| void | init_presets (dt_iop_module_so_t *self) |
| const char * | name () |
| const char ** | description (struct dt_iop_module_t *self) |
| int | flags () |
| int | default_group () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| static float | f (const float t, const float c, const float x) |
| static float | _dist_seg (grad_point_t a, grad_point_t b, grad_point_t c) |
| static void | _draw_end_marker (cairo_t *cr, const grad_point_t endpoint, const grad_point_t opposite, const float zoom_scale, const float normal_sign, const gboolean active) |
| Draw one triangular endpoint marker on the graduated line. | |
| static int | set_grad_from_points (struct dt_iop_module_t *self, const grad_point_t *a, const grad_point_t *b, float *rotation, float *offset) |
| static int | set_points_from_grad (struct dt_iop_module_t *self, grad_point_t *a, grad_point_t *b, const float rotation, const float offset) |
| static void | update_saturation_slider_end_color (GtkWidget *slider, float hue) |
| void | color_picker_apply (dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | gui_reset (struct dt_iop_module_t *self) |
| void | gui_post_expose (struct dt_iop_module_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| int | mouse_moved (struct dt_iop_module_t *self, double x, double y, double pressure, int which) |
| int | button_pressed (struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state) |
| int | button_released (struct dt_iop_module_t *self, double x, double y, int which, uint32_t state) |
| int | scrolled (dt_iop_module_t *self, double x, double y, int up, uint32_t state) |
| static float | density_times_length (const float dens, const float length) |
| static float | compute_density (const float dens, const float length) |
| __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) |
| int | process_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | gui_changed (dt_iop_module_t *self, GtkWidget *w, void *previous) |
| 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 | 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 | gui_update (struct dt_iop_module_t *self) |
| Refresh GUI controls from current params and configuration. | |
| void | gui_init (struct dt_iop_module_t *self) |
| typedef struct dt_iop_graduatednd_data_t dt_iop_graduatednd_data_t |
| typedef struct dt_iop_graduatednd_global_data_t dt_iop_graduatednd_global_data_t |
| typedef struct dt_iop_graduatednd_gui_data_t dt_iop_graduatednd_gui_data_t |
| typedef struct dt_iop_graduatednd_params_t dt_iop_graduatednd_params_t |
| typedef struct dt_iop_vector_2d_t dt_iop_vector_2d_t |
| typedef struct grad_point_t grad_point_t |
|
static |
Definition at line 232 of file graduatednd.c.
References t, grad_point_t::x, and grad_point_t::y.
Referenced by mouse_moved().
|
static |
Draw one triangular endpoint marker on the graduated line.
The marker geometry is built from the active endpoint and the opposite endpoint, then mirrored with normal_sign so the two markers keep opposite winding while sharing the same drawing path.
Definition at line 251 of file graduatednd.c.
References dt_draw_node(), dt_draw_set_color_overlay(), DT_PIXEL_APPLY_DPI, DT_PIXEL_APPLY_DPI_DPP, FALSE, TRUE, x, grad_point_t::x, and grad_point_t::y.
Referenced by gui_post_expose().
| int button_pressed | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 560 of file graduatednd.c.
References dt_iop_module_t::dev, dt_dev_coordinates_widget_to_image_norm(), dt_iop_gui_data(), g, and x.
| int button_released | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 592 of file graduatednd.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, p, dt_iop_module_t::params, set_grad_from_points(), set_points_from_grad(), and TRUE.
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 852 of file graduatednd.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), dt_iop_graduatednd_global_data_t::kernel_graduatedndm, and dt_iop_graduatednd_global_data_t::kernel_graduatedndp.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 901 of file graduatednd.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 411 of file graduatednd.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, H, L, p, dt_iop_module_t::params, dt_iop_module_t::picked_color, rgb2hsl(), S, TRUE, and update_saturation_slider_end_color().
| 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 875 of file graduatednd.c.
References d, dt_dev_pixelpipe_iop_t::data, hsl2rgb(), and p.
|
inlinestatic |
Definition at line 671 of file graduatednd.c.
References CLIP, d, density_times_length(), DT_M_LN2f, and t.
Referenced by process().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 215 of file graduatednd.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 210 of file graduatednd.c.
References IOP_GROUP_EFFECTS.
|
inlinestatic |
Definition at line 664 of file graduatednd.c.
Referenced by compute_density().
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 195 of file graduatednd.c.
References dt_iop_set_description().
|
inlinestatic |
Definition at line 220 of file graduatednd.c.
| int flags | ( | ) |
Definition at line 204 of file graduatednd.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_INCLUDE_IN_STYLES, IOP_FLAGS_SUPPORTS_BLENDING, and IOP_FLAGS_TILING_FULL_ROI.
| void gui_changed | ( | dt_iop_module_t * | self, |
| GtkWidget * | w, | ||
| void * | previous | ||
| ) |
Definition at line 860 of file graduatednd.c.
References dt_iop_gui_data(), g, p, dt_iop_module_t::params, set_points_from_grad(), and update_saturation_slider_end_color().
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 918 of file graduatednd.c.
References dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_factor(), dt_bauhaus_slider_set_feedback(), dt_bauhaus_slider_set_format(), dt_bauhaus_slider_set_stop(), dt_color_picker_new(), DT_COLOR_PICKER_POINT, g, and IOP_GUI_ALLOC.
| void gui_post_expose | ( | struct dt_iop_module_t * | self, |
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 443 of file graduatednd.c.
References _draw_end_marker(), dt_iop_module_t::dev, dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_rescale_roi(), dt_dev_viewport_scaling(), dt_draw_set_color_overlay(), dt_iop_gui_data(), DT_PIXEL_APPLY_DPI, FALSE, g, height, IS_NULL_PTR, p, dt_iop_module_t::params, set_points_from_grad(), TRUE, and width.
| void gui_reset | ( | struct dt_iop_module_t * | self | ) |
Definition at line 438 of file graduatednd.c.
References dt_iop_color_picker_reset(), and TRUE.
| void gui_update | ( | struct dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 907 of file graduatednd.c.
References dt_iop_color_picker_reset(), dt_iop_gui_data(), g, p, dt_iop_module_t::params, TRUE, and update_saturation_slider_end_color().
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 842 of file graduatednd.c.
References dt_opencl_create_kernel(), dt_iop_graduatednd_global_data_t::kernel_graduatedndm, and dt_iop_graduatednd_global_data_t::kernel_graduatedndp.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 895 of file graduatednd.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 107 of file graduatednd.c.
References dt_database_release_transaction, dt_database_start_transaction, dt_gui_presets_add_generic(), and dt_iop_module_so_t::op.
| int mouse_moved | ( | struct dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 493 of file graduatednd.c.
References _dist_seg(), dt_iop_module_t::dev, dt_control_queue_redraw_center(), dt_dev_coordinates_image_abs_to_image_norm(), dt_dev_coordinates_widget_to_image_norm(), DT_GUI_MOUSE_EFFECT_RADIUS, dt_iop_gui_data(), g, x, grad_point_t::x, and grad_point_t::y.
| const char * name | ( | ) |
Definition at line 190 of file graduatednd.c.
| __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 695 of file graduatednd.c.
References __OMP_PARALLEL_FOR__, __OMP_SIMD__, dt_dev_pixelpipe_iop_t::buf_in, ch, dt_iop_buffer_dsc_t::channels, dt_iop_graduatednd_data_t::color, dt_iop_graduatednd_data_t::color1, compute_density(), dt_dev_pixelpipe_iop_t::data, dt_iop_graduatednd_data_t::density, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEV_PIXELPIPE_DISPLAY_MASK, dt_iop_graduatednd_data_t::hardness, height, dt_iop_roi_t::height, k, M_PI, dt_dev_pixelpipe_t::mask_display, MAX, dt_iop_graduatednd_data_t::offset, out, ovoid, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_graduatednd_data_t::rotation, dt_iop_roi_t::scale, v, width, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| int process_cl | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
Definition at line 778 of file graduatednd.c.
References dt_dev_pixelpipe_iop_t::buf_in, dt_iop_graduatednd_data_t::color, dt_dev_pixelpipe_iop_t::data, dt_iop_graduatednd_data_t::density, 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, dt_iop_graduatednd_data_t::hardness, height, dt_iop_roi_t::height, kernel(), dt_iop_graduatednd_global_data_t::kernel_graduatedndm, dt_iop_graduatednd_global_data_t::kernel_graduatedndp, M_PI, dt_iop_graduatednd_data_t::offset, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_graduatednd_data_t::rotation, ROUNDUPDHT, ROUNDUPDWD, dt_iop_roi_t::scale, t, TRUE, v, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| int scrolled | ( | dt_iop_module_t * | self, |
| double | x, | ||
| double | y, | ||
| int | up, | ||
| uint32_t | state | ||
| ) |
Definition at line 624 of file graduatednd.c.
References dt_iop_module_t::dev, dt_bauhaus_slider_set(), dt_iop_gui_data(), dt_masks_get_visible_form(), dt_modifier_is(), DT_PRIMARY_MASK, dt_develop_t::form_gui, g, p, dt_iop_module_t::params, and state.
|
static |
Definition at line 289 of file graduatednd.c.
References dt_iop_module_t::dev, dt_dev_coordinates_image_norm_to_image_abs(), dt_dev_distort_backtransform_gui(), dt_dev_module_geometry_gui(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, eps, dt_iop_roi_t::height, dt_iop_module_t::iop_order, M_PI, v, and dt_iop_roi_t::width.
Referenced by button_released().
|
static |
Definition at line 321 of file graduatednd.c.
References dt_iop_module_t::dev, dt_dev_coordinates_image_abs_to_image_norm(), dt_dev_distort_transform_gui(), dt_dev_module_geometry_gui(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, eps, dt_iop_roi_t::height, dt_iop_module_t::iop_order, M_PI, v, and dt_iop_roi_t::width.
Referenced by button_released(), gui_changed(), and gui_post_expose().
Definition at line 404 of file graduatednd.c.
References dt_bauhaus_slider_set_stop(), hsl2rgb(), and rgb.
Referenced by color_picker_apply(), gui_changed(), and gui_update().