![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "bauhaus/bauhaus.h"#include "common/interpolation.h"#include "common/opencl.h"#include "common/math.h"#include "common/collection.h"#include "control/conf.h"#include "control/control.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "develop/develop.h"#include "gui/gtk.h"#include "iop/iop_api.h"#include <assert.h>#include <cairo.h>#include <complex.h>#include <stdlib.h>
Include dependency graph for liquify.c:Go to the source code of this file.
Data Structures | |
| struct | dt_liquify_rgba_t |
| struct | dt_liquify_layer_t |
| struct | dt_liquify_path_header_t |
| struct | dt_liquify_warp_t |
| struct | dt_liquify_node_t |
| struct | dt_liquify_path_data_t |
| struct | dt_liquify_hit_t |
| struct | dt_iop_liquify_params_t |
| struct | dt_iop_liquify_global_data_t |
| struct | dt_iop_liquify_gui_data_t |
| struct | distort_params_t |
| struct | restart_cookie_t |
| struct | dt_liquify_kernel_descriptor_t |
Macros | |
| #define | MAX_NODES 100 |
| #define | CONF_RADIUS "plugins/darkroom/liquify/radius" |
| #define | CONF_ANGLE "plugins/darkroom/liquify/angle" |
| #define | CONF_STRENGTH "plugins/darkroom/liquify/strength" |
| #define | COLOR_NULL { 0.0, 0.0, 0.0, 0.8 } |
| #define | GREY { 0.3, 0.3, 0.3, 0.8 } |
| #define | LGREY { 0.8, 0.8, 0.8, 1.0 } |
| #define | COLOR_DEBUG { 0.9, 0.9, 0.0, 1.0 } |
| #define | GET_UI_WIDTH(a) (get_ui_width(scale, DT_LIQUIFY_UI_WIDTH_##a)) |
| #define | FG_COLOR set_source_rgba(cr, fg_color) |
| #define | BG_COLOR set_source_rgba(cr, bg_color) |
| #define | VERYTHINLINE set_line_width (cr, scale / 2.0f, DT_LIQUIFY_UI_WIDTH_THINLINE) |
| #define | THINLINE set_line_width (cr, scale, DT_LIQUIFY_UI_WIDTH_THINLINE) |
| #define | THICKLINE set_line_width (cr, scale, DT_LIQUIFY_UI_WIDTH_THICKLINE) |
| #define | CHECK_HIT_PT(point) |
| #define | ABCD(A, B, C, D) { { a[i] = A; b[i] = B; c[i] = C; d[i] = D; continue; } } |
Typedefs | |
| typedef cl_mem | cl_mem_t |
| typedef cl_int | cl_int_t |
Functions | |
| const char * | name () |
| const char ** | description (struct dt_iop_module_t *self) |
| int | default_group () |
| int | flags () |
| int | operation_tags () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| void | input_format (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc) |
| static float | get_rot (const dt_liquify_warp_type_enum_t warp_type) |
| static dt_liquify_path_data_t * | node_alloc (dt_iop_liquify_params_t *p, int *node_index) |
| static dt_liquify_path_data_t * | node_prev (dt_iop_liquify_params_t *p, const dt_liquify_path_data_t *n) |
| static dt_liquify_path_data_t * | node_get (dt_iop_liquify_params_t *p, const int index) |
| static dt_liquify_path_data_t * | node_next (dt_iop_liquify_params_t *p, const dt_liquify_path_data_t *n) |
| static void | node_insert_before (dt_iop_liquify_params_t *p, dt_liquify_path_data_t *this, dt_liquify_path_data_t *new) |
| static void | node_gc (dt_iop_liquify_params_t *p) |
| static void | node_delete (dt_iop_liquify_params_t *p, dt_liquify_path_data_t *this) |
| static void | path_delete (dt_iop_liquify_params_t *p, dt_liquify_path_data_t *this) |
| static void | _distort_paths (const struct dt_iop_module_t *module, const distort_params_t *params, const dt_iop_liquify_params_t *p) |
| static void | distort_paths_raw_to_piece (const struct dt_iop_module_t *module, const dt_dev_pixelpipe_t *pipe, const float roi_in_scale, dt_iop_liquify_params_t *p, const gboolean from_distort_transform) |
| static float complex | normalize (const float complex v) |
| static float | mix (const float a, const float b, const float t) |
| static float complex | cmix (const float complex p0, const float complex p1, const float t) |
| static void | mix_warps (dt_liquify_warp_t *result, const dt_liquify_warp_t *warp1, const dt_liquify_warp_t *warp2, const complex float pt, const float t) |
| static void | interpolate_cubic_bezier (const float complex p0, const float complex p1, const float complex p2, const float complex p3, float complex buffer[], const int n) |
| static GList * | interpolate_paths (dt_iop_liquify_params_t *p) |
| static float | get_arc_length (const float complex points[], const int n_points) |
| static float complex | point_at_arc_length (const float complex points[], const int n_points, const float arc_length, restart_cookie_t *restart) |
| static float * | build_lookup_table (const int distance, const float control1, const float control2) |
| static void | compute_round_stamp_extent (cairo_rectangle_int_t *const restrict stamp_extent, const dt_liquify_warp_t *const restrict warp) |
| static int | build_round_stamp (float complex **pstamp, cairo_rectangle_int_t *const restrict stamp_extent, const dt_liquify_warp_t *const restrict warp) |
| static void | add_to_global_distortion_map (float complex *global_map, const cairo_rectangle_int_t *const restrict global_map_extent, const dt_liquify_warp_t *const restrict warp, const float complex *const restrict stamp, const cairo_rectangle_int_t *stamp_extent) |
| static __DT_CLONE_TARGETS__ void | apply_global_distortion_map (struct dt_iop_module_t *module, const dt_dev_pixelpipe_iop_t *piece, const float *const restrict in, float *const restrict out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const int ch, const float complex *const map, const cairo_rectangle_int_t *extent) |
| static GSList * | _get_map_extent (const dt_iop_roi_t *roi_out, const GList *interpolated, cairo_rectangle_int_t *map_extent) |
| static float complex * | create_global_distortion_map (const cairo_rectangle_int_t *map_extent, const GSList *interpolated, gboolean inverted) |
| static float complex * | build_global_distortion_map (struct dt_iop_module_t *module, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, cairo_rectangle_int_t *map_extent) |
| void | modify_roi_out (struct dt_iop_module_t *module, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, dt_iop_roi_t *roi_out, const dt_iop_roi_t *roi_in) |
| void | modify_roi_in (struct dt_iop_module_t *module, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_out, dt_iop_roi_t *roi_in) |
| static int | _distort_xtransform (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, float *const restrict points, const size_t points_count, const gboolean inverted) |
| static void | start_drag (dt_iop_liquify_gui_data_t *g, dt_liquify_layer_enum_t layer, dt_liquify_path_data_t *elem) |
| static void | end_drag (dt_iop_liquify_gui_data_t *g) |
| static gboolean | is_dragging (const dt_iop_liquify_gui_data_t *g) |
| int | distort_transform (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, float *const restrict points, size_t points_count) |
| int | distort_backtransform (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, float *const restrict points, size_t points_count) |
| void | distort_mask (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece, const float *const in, float *const out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) |
| __DT_CLONE_TARGETS__ int | process (struct dt_iop_module_t *module, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const in, void *const out) |
| static float | bicubic (const float a, const float x) |
| static float | mitchell (const float x) |
| static cl_int_t | apply_global_distortion_map_cl (struct dt_iop_module_t *module, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const cl_mem_t dev_in, const cl_mem_t dev_out, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, const float complex *map, const cairo_rectangle_int_t *map_extent) |
| int | process_cl (struct dt_iop_module_t *module, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const cl_mem_t dev_in, const cl_mem_t dev_out) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | init (dt_iop_module_t *module) |
| void | init_pipe (struct dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | cleanup_pipe (struct dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | commit_params (struct dt_iop_module_t *module, dt_iop_params_t *params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| static float | cdot (const float complex p0, const float complex p1) |
| static void | draw_rectangle (cairo_t *cr, const float complex pt, const double theta, const double size) |
| static void | draw_triangle (cairo_t *cr, const float complex pt, const double theta, const double size) |
| static void | draw_circle (cairo_t *cr, const float complex pt, const double diameter) |
| static void | set_source_rgba (cairo_t *cr, dt_liquify_rgba_t rgba) |
| static float | get_ui_width (const float scale, const dt_liquify_ui_width_enum_t w) |
| static void | set_line_width (cairo_t *cr, double scale, dt_liquify_ui_width_enum_t w) |
| static gboolean | detect_drag (const dt_iop_liquify_gui_data_t *g, const double scale, const float complex pt) |
| static void | update_warp_count (const dt_iop_liquify_gui_data_t *g) |
| static void | _draw_paths (dt_iop_module_t *module, cairo_t *cr, const float scale, dt_iop_liquify_params_t *p, GList *layers) |
| static float | find_nearest_on_curve_t (const float complex p0, const float complex p1, const float complex p2, const float complex p3, const float complex x, const int n) |
| static float | find_nearest_on_line_t (const float complex p0, const float complex p1, const float complex x) |
| static void | casteljau (const float complex *p0, float complex *p1, float complex *p2, float complex *p3, const float t) |
| static dt_liquify_hit_t | _hit_paths (dt_iop_module_t *module, dt_iop_liquify_params_t *p, GList *layers, const float complex *pt) |
| static void | draw_paths (struct dt_iop_module_t *module, cairo_t *cr, const float scale, dt_iop_liquify_params_t *params) |
| static dt_liquify_hit_t | _hit_test_paths (struct dt_iop_module_t *module, dt_iop_liquify_params_t *params, float complex pt) |
| static void | smooth_path_linsys (size_t n, const float complex *k, float complex *c1, float complex *c2, const int *equation) |
| static int | path_length (dt_iop_liquify_params_t *p, dt_liquify_path_data_t *n) |
| static void | smooth_paths_linsys (dt_iop_liquify_params_t *params) |
| static dt_liquify_path_data_t * | find_hovered (dt_iop_liquify_params_t *p) |
| static void | init_warp (dt_liquify_warp_t *warp, float complex point) |
| static dt_liquify_path_data_t * | alloc_move_to (dt_iop_module_t *module, float complex start_point) |
| static dt_liquify_path_data_t * | alloc_line_to (dt_iop_module_t *module, float complex end_point) |
| static dt_liquify_path_data_t * | alloc_curve_to (dt_iop_module_t *module, float complex end_point) |
| static void | unselect_all (dt_iop_liquify_params_t *p) |
| static float | get_zoom_scale (const dt_develop_t *develop) |
| void | gui_post_expose (struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery) |
| static gboolean | btn_make_radio_callback (GtkToggleButton *btn, GdkEventButton *event, dt_iop_module_t *module) |
| void | gui_focus (struct dt_iop_module_t *module, gboolean in) |
| static void | sync_pipe (struct dt_iop_module_t *module, gboolean history) |
| static void | get_point_scale (struct dt_iop_module_t *module, float x, float y, float complex *pt, float *scale) |
| static gboolean | _is_movable_layer (const dt_liquify_layer_enum_t layer) |
| int | mouse_moved (struct dt_iop_module_t *module, double x, double y, double pressure, int which) |
| static float | dt_conf_get_sanitize_float (const char *name, float min, float max, float default_value) |
| static void | get_stamp_params (dt_iop_module_t *module, float *radius, float *r_strength, float *phi) |
| int | scrolled (struct dt_iop_module_t *module, double x, double y, int up, uint32_t state) |
| int | button_pressed (struct dt_iop_module_t *module, double x, double y, double pressure, int which, int type, uint32_t state) |
| static void | _start_new_shape (dt_iop_module_t *module) |
| int | button_released (struct dt_iop_module_t *module, double x, double y, int which, uint32_t state) |
| int | key_pressed (struct dt_iop_module_t *self, GdkEventKey *event) |
| void | gui_update (dt_iop_module_t *module) |
| Refresh GUI controls from current params and configuration. | |
| void | gui_init (dt_iop_module_t *self) |
| void | gui_reset (dt_iop_module_t *self) |
| void | gui_cleanup (dt_iop_module_t *self) |
Variables | |
| const int | LOOKUP_OVERSAMPLE = 10 |
| const int | INTERPOLATION_POINTS = 100 |
| const float | STAMP_RELOCATION = 0.1 |
| static const dt_liquify_rgba_t | DT_LIQUIFY_COLOR_SELECTED = { 1.0, 1.0, 1.0, 1.0 } |
| static const dt_liquify_rgba_t | DT_LIQUIFY_COLOR_HOVER = { 1.0, 1.0, 1.0, 0.8 } |
| dt_liquify_layer_t | dt_liquify_layers [] |
| float | dt_liquify_ui_widths [] |
| static const dt_liquify_hit_t | NOWHERE = { DT_LIQUIFY_LAYER_BACKGROUND, NULL } |
| #define BG_COLOR set_source_rgba(cr, bg_color) |
| #define CHECK_HIT_PT | ( | point | ) |
| #define FG_COLOR set_source_rgba(cr, fg_color) |
| #define GET_UI_WIDTH | ( | a | ) | (get_ui_width(scale, DT_LIQUIFY_UI_WIDTH_##a)) |
| #define THICKLINE set_line_width (cr, scale, DT_LIQUIFY_UI_WIDTH_THICKLINE) |
| #define THINLINE set_line_width (cr, scale, DT_LIQUIFY_UI_WIDTH_THINLINE) |
| #define VERYTHINLINE set_line_width (cr, scale / 2.0f, DT_LIQUIFY_UI_WIDTH_THINLINE) |
|
static |
Definition at line 566 of file liquify.c.
References dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, dt_dev_distort_transform_locked(), dt_dev_distort_transform_plus(), DT_DEV_TRANSFORM_DIR_ALL, DT_DEV_TRANSFORM_DIR_BACK_EXCL, DT_DEV_TRANSFORM_DIR_FORW_EXCL, dt_free, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_PATH_MOVE_TO_V1, dt_liquify_path_data_t::header, dt_iop_module_t::iop_order, k, MAX_NODES, dt_liquify_path_data_t::node, p, dt_liquify_warp_t::point, dt_liquify_warp_t::radius, dt_liquify_warp_t::strength, dt_liquify_path_header_t::type, and dt_liquify_path_data_t::warp.
Referenced by distort_paths_raw_to_piece(), and gui_post_expose().
|
static |
Definition at line 1362 of file liquify.c.
References __OMP_PARALLEL_FOR__, _get_map_extent(), create_global_distortion_map(), dt_dev_pixelpipe_iop_t::data, dist(), distort_paths_raw_to_piece(), dt_free_gpointer(), dt_pixelpipe_cache_free_align, i, interpolate_paths(), IS_NULL_PTR, max, min, TRUE, x, and dt_iop_roi_t::x.
Referenced by distort_backtransform(), and distort_transform().
|
static |
Definition at line 1938 of file liquify.c.
References dt_liquify_layer_t::bg, BG_COLOR, cmix(), dt_liquify_warp_t::control1, dt_liquify_warp_t::control2, dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, draw_circle(), draw_rectangle(), draw_triangle(), dt_free_gpointer(), DT_LIQUIFY_COLOR_HOVER, DT_LIQUIFY_COLOR_SELECTED, DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_CTRLPOINT1_HANDLE, DT_LIQUIFY_LAYER_CTRLPOINT2, DT_LIQUIFY_LAYER_CTRLPOINT2_HANDLE, DT_LIQUIFY_LAYER_FLAG_NODE_SELECTED, DT_LIQUIFY_LAYER_FLAG_PREV_SELECTED, DT_LIQUIFY_LAYER_HARDNESS1, DT_LIQUIFY_LAYER_HARDNESS2, DT_LIQUIFY_LAYER_HARDNESSPOINT1, DT_LIQUIFY_LAYER_HARDNESSPOINT1_HANDLE, DT_LIQUIFY_LAYER_HARDNESSPOINT2, DT_LIQUIFY_LAYER_HARDNESSPOINT2_HANDLE, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_LAYER_RADIUS, DT_LIQUIFY_LAYER_RADIUSPOINT, DT_LIQUIFY_LAYER_RADIUSPOINT_HANDLE, DT_LIQUIFY_LAYER_STRENGTHPOINT, DT_LIQUIFY_LAYER_STRENGTHPOINT_HANDLE, DT_LIQUIFY_LAYER_WARPS, dt_liquify_layers, DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_NODE_TYPE_CUSP, DT_LIQUIFY_NODE_TYPE_SMOOTH, DT_LIQUIFY_NODE_TYPE_SYMMETRICAL, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_PATH_MOVE_TO_V1, DT_LIQUIFY_WARP_TYPE_LINEAR, DT_M_PI, dt_liquify_layer_t::fg, FG_COLOR, flags(), g, get_rot(), GET_UI_WIDTH, dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, dt_liquify_layer_t::hover_master, dt_liquify_path_header_t::hovered, i, interpolate_paths(), is_dragging(), IS_NULL_PTR, k, MAX_NODES, dt_liquify_path_data_t::node, node_prev(), dt_liquify_path_header_t::node_type, p, dt_liquify_warp_t::point, dt_liquify_warp_t::radius, dt_liquify_path_header_t::selected, dt_liquify_warp_t::strength, THICKLINE, THINLINE, dt_liquify_path_header_t::type, dt_liquify_warp_t::type, VERYTHINLINE, and dt_liquify_path_data_t::warp.
Referenced by draw_paths().
|
static |
Definition at line 1139 of file liquify.c.
References compute_round_stamp_extent(), dt_iop_roi_t::height, i, r, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _distort_xtransform(), build_global_distortion_map(), and modify_roi_in().
|
static |
Definition at line 2331 of file liquify.c.
References casteljau(), CHECK_HIT_PT, cmix(), dt_liquify_warp_t::control1, dt_liquify_warp_t::control2, dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, d, DT_GUI_MOUSE_EFFECT_RADIUS, DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_CTRLPOINT2, DT_LIQUIFY_LAYER_FLAG_HIT_TEST, DT_LIQUIFY_LAYER_FLAG_NODE_SELECTED, DT_LIQUIFY_LAYER_FLAG_PREV_SELECTED, DT_LIQUIFY_LAYER_HARDNESSPOINT1, DT_LIQUIFY_LAYER_HARDNESSPOINT2, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_LAYER_RADIUSPOINT, DT_LIQUIFY_LAYER_STRENGTHPOINT, dt_liquify_layers, DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_PATH_MOVE_TO_V1, DT_PIXEL_APPLY_DPI, dt_liquify_hit_t::elem, find_nearest_on_curve_t(), find_nearest_on_line_t(), flags(), dt_liquify_path_data_t::header, INTERPOLATION_POINTS, IS_NULL_PTR, k, dt_liquify_hit_t::layer, MAX_NODES, dt_liquify_path_data_t::node, node_prev(), dt_liquify_path_header_t::node_type, NOWHERE, p, dt_liquify_warp_t::point, dt_liquify_warp_t::radius, dt_liquify_path_header_t::selected, dt_liquify_warp_t::strength, t, dt_liquify_path_header_t::type, and dt_liquify_path_data_t::warp.
Referenced by _hit_test_paths().
|
static |
Definition at line 2494 of file liquify.c.
References _hit_paths(), DT_LIQUIFY_LAYER_FLAG_HIT_TEST, DT_LIQUIFY_LAYER_LAST, dt_liquify_layers, flags(), and NOWHERE.
Referenced by button_pressed(), and mouse_moved().
|
static |
Definition at line 2924 of file liquify.c.
References DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_CTRLPOINT2, DT_LIQUIFY_LAYER_HARDNESSPOINT1, DT_LIQUIFY_LAYER_HARDNESSPOINT2, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_LAYER_RADIUSPOINT, DT_LIQUIFY_LAYER_STRENGTHPOINT, FALSE, and TRUE.
Referenced by mouse_moved().
|
static |
Definition at line 3372 of file liquify.c.
References alloc_move_to(), dt_iop_module_t::dev, DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_STATUS_NEW, DT_LIQUIFY_STATUS_PREVIEW, g, get_point_scale(), get_stamp_params(), dt_iop_module_t::gui_data, dt_develop_t::height, NOWHERE, r, dt_develop_t::roi, start_drag(), TRUE, and dt_develop_t::width.
Referenced by btn_make_radio_callback(), and key_pressed().
|
static |
Definition at line 1036 of file liquify.c.
Referenced by create_global_distortion_map().
|
static |
Definition at line 2798 of file liquify.c.
References DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_CURVE_TO_V1, g, dt_iop_module_t::gui_data, init_warp(), IS_NULL_PTR, and node_alloc().
Referenced by button_released().
|
static |
Definition at line 2785 of file liquify.c.
References DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_LINE_TO_V1, g, dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, init_warp(), IS_NULL_PTR, node_alloc(), dt_liquify_path_header_t::node_type, dt_liquify_path_header_t::type, and dt_liquify_path_data_t::warp.
Referenced by button_released().
|
static |
Definition at line 2772 of file liquify.c.
References DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_MOVE_TO_V1, g, dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, init_warp(), m, node_alloc(), and dt_liquify_path_header_t::type.
Referenced by _start_new_shape().
|
static |
Definition at line 1075 of file liquify.c.
References ch, dt_interpolation_compute_pixel4c(), dt_interpolation_compute_sample(), dt_interpolation_new(), DT_INTERPOLATION_USERPREF_WARP, dt_iop_roi_t::height, out, row, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by distort_mask(), and process().
|
static |
Definition at line 1578 of file liquify.c.
References bicubic(), dt_dev_pixelpipe_t::devid, dt_free, DT_INTERPOLATION_BICUBIC, DT_INTERPOLATION_BILINEAR, DT_INTERPOLATION_MITCHELL, dt_interpolation_new(), DT_INTERPOLATION_USERPREF_WARP, dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), error(), FALSE, dt_iop_module_t::global_data, i, dt_interpolation::id, IS_NULL_PTR, k, mitchell(), dt_liquify_kernel_descriptor_t::resolution, ROUNDUPDHT, ROUNDUPDWD, dt_liquify_kernel_descriptor_t::size, and dt_iop_liquify_global_data_t::warp_kernel.
Referenced by process_cl().
|
inlinestatic |
Definition at line 1548 of file liquify.c.
References x.
Referenced by apply_global_distortion_map_cl().
|
static |
Definition at line 3825 of file liquify.c.
References _start_new_shape(), darktable_t::control, darktable, dt_control_hinter_message(), dt_iop_request_focus(), DT_LIQUIFY_STATUS_PREVIEW, FALSE, g, dt_iop_module_t::gui_data, is_dragging(), IS_NULL_PTR, node_delete(), node_prev(), sync_pipe(), and TRUE.
Referenced by button_released(), gui_focus(), gui_init(), and gui_reset().
|
static |
Definition at line 1266 of file liquify.c.
References _get_map_extent(), create_global_distortion_map(), dt_dev_pixelpipe_iop_t::data, distort_paths_raw_to_piece(), dt_free_gpointer(), FALSE, interpolate_paths(), and dt_iop_roi_t::scale.
Referenced by distort_mask(), process(), and process_cl().
|
static |
Definition at line 871 of file liquify.c.
References dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, i, interpolate_cubic_bezier(), IS_NULL_PTR, lookup(), and x.
Referenced by build_round_stamp().
|
static |
Definition at line 940 of file liquify.c.
References __OMP_PARALLEL_FOR__, build_lookup_table(), dist(), dt_free, DT_LIQUIFY_STATUS_INTERPOLATED, DT_LIQUIFY_WARP_TYPE_RADIAL_GROW, DT_LIQUIFY_WARP_TYPE_RADIAL_SHRINK, dt_pixelpipe_cache_free_align, IS_NULL_PTR, LOOKUP_OVERSAMPLE, STAMP_RELOCATION, strength(), and x.
Referenced by create_global_distortion_map().
| int button_pressed | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 3255 of file liquify.c.
References _hit_test_paths(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_STRENGTHPOINT, DT_LIQUIFY_NODE_TYPE_LAST, DT_LIQUIFY_PATH_MOVE_TO_V1, DT_LIQUIFY_STATUS_NEW, DT_LIQUIFY_WARP_TYPE_LAST, dt_modifier_is(), end_drag(), g, get_point_scale(), dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, is_dragging(), IS_NULL_PTR, dt_liquify_path_header_t::node_type, NOWHERE, dt_iop_module_t::params, start_drag(), state, dt_liquify_warp_t::type, and x.
| int button_released | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 3396 of file liquify.c.
References alloc_curve_to(), alloc_line_to(), btn_make_radio_callback(), casteljau(), cmix(), darktable_t::control, dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, darktable, detect_drag(), dt_control_hinter_message(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_LIQUIFY_LAYER_BACKGROUND, DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_STATUS_NEW, dt_modifier_is(), dt_liquify_hit_t::elem, end_drag(), FALSE, find_nearest_on_curve_t(), find_nearest_on_line_t(), g, get_point_scale(), dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, dt_liquify_path_header_t::hovered, INTERPOLATION_POINTS, is_dragging(), IS_NULL_PTR, mix_warps(), dt_liquify_path_header_t::next, dt_liquify_path_data_t::node, node_delete(), node_get(), node_insert_before(), node_prev(), dt_liquify_path_header_t::node_type, NOWHERE, path_delete(), dt_liquify_warp_t::point, dt_liquify_path_header_t::selected, start_drag(), strength(), sync_pipe(), t, dt_liquify_path_header_t::type, unselect_all(), update_warp_count(), dt_liquify_path_data_t::warp, and x.
|
static |
Definition at line 2306 of file liquify.c.
References t.
Referenced by _hit_paths(), and button_released().
|
static |
Definition at line 1773 of file liquify.c.
Referenced by find_nearest_on_line_t().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 1729 of file liquify.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), and dt_iop_liquify_global_data_t::warp_kernel.
| void cleanup_pipe | ( | struct dt_iop_module_t * | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1755 of file liquify.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
|
inlinestatic |
Definition at line 713 of file liquify.c.
References t.
Referenced by _draw_paths(), _hit_paths(), button_released(), interpolate_paths(), and point_at_arc_length().
| void commit_params | ( | struct dt_iop_module_t * | module, |
| dt_iop_params_t * | params, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1763 of file liquify.c.
References dt_dev_pixelpipe_iop_t::data, and dt_iop_module_t::params_size.
|
static |
Definition at line 907 of file liquify.c.
Referenced by _get_map_extent().
|
static |
Definition at line 1169 of file liquify.c.
References add_to_global_distortion_map(), build_round_stamp(), d, dt_free, dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, height, i, IS_NULL_PTR, r, row, width, and x.
Referenced by _distort_xtransform(), and build_global_distortion_map().
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 347 of file liquify.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 332 of file liquify.c.
References IOP_GROUP_EFFECTS.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 322 of file liquify.c.
References dt_iop_set_description().
|
static |
Definition at line 1833 of file liquify.c.
References g, and GET_UI_WIDTH.
Referenced by button_released(), and mouse_moved().
| int distort_backtransform | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| float *const restrict | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 1462 of file liquify.c.
References _distort_xtransform(), and FALSE.
| void distort_mask | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const float *const | in, | ||
| float *const | out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const dt_iop_roi_t *const | roi_out | ||
| ) |
Definition at line 1468 of file liquify.c.
References __OMP_PARALLEL_FOR__, apply_global_distortion_map(), build_global_distortion_map(), dt_pixelpipe_cache_free_align, dt_iop_roi_t::height, i, IS_NULL_PTR, out, void(), dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
Definition at line 684 of file liquify.c.
References _distort_paths(), and p.
Referenced by _distort_xtransform(), build_global_distortion_map(), and modify_roi_in().
| int distort_transform | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| float *const restrict | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 1454 of file liquify.c.
References _distort_xtransform(), and TRUE.
|
static |
Definition at line 2466 of file liquify.c.
References _draw_paths(), DT_LIQUIFY_LAYER_FLAG_CURVE_TOOL, DT_LIQUIFY_LAYER_FLAG_LINE_TOOL, DT_LIQUIFY_LAYER_FLAG_NODE_TOOL, DT_LIQUIFY_LAYER_FLAG_POINT_TOOL, DT_LIQUIFY_LAYER_LAST, dt_liquify_layers, dt_liquify_layer_t::flags, g, and dt_iop_module_t::gui_data.
Referenced by gui_post_expose().
|
static |
Definition at line 3154 of file liquify.c.
References dt_conf_get_float(), dt_conf_set_float(), max, min, name(), and value.
Referenced by get_stamp_params().
|
static |
Definition at line 1444 of file liquify.c.
Referenced by button_pressed(), button_released(), and key_pressed().
|
static |
Definition at line 2751 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, k, MAX_NODES, and p.
Referenced by mouse_moved().
|
static |
Definition at line 2260 of file liquify.c.
References dist(), i, n, t, and x.
Referenced by _hit_paths(), and button_released().
|
static |
Definition at line 2296 of file liquify.c.
Referenced by _hit_paths(), and button_released().
| int flags | ( | ) |
Definition at line 337 of file liquify.c.
References IOP_FLAGS_SUPPORTS_BLENDING.
Referenced by _draw_paths(), _hit_paths(), and _hit_test_paths().
|
static |
|
static |
Definition at line 2910 of file liquify.c.
References darktable, dt_iop_module_t::dev, darktable_t::develop, dt_dev_coordinates_image_norm_to_image_abs(), dt_dev_coordinates_widget_to_image_norm(), dt_dev_distort_backtransform_plus(), DT_DEV_TRANSFORM_DIR_BACK_EXCL, DT_DEV_TRANSFORM_DIR_FORW_EXCL, get_zoom_scale(), dt_iop_module_t::iop_order, dt_develop_t::virtual_pipe, and x.
Referenced by _start_new_shape(), button_pressed(), button_released(), and mouse_moved().
|
inlinestatic |
Definition at line 364 of file liquify.c.
References DT_LIQUIFY_WARP_TYPE_RADIAL_SHRINK, and DT_M_PI_F.
Referenced by _draw_paths().
|
static |
Definition at line 3165 of file liquify.c.
References CONF_ANGLE, CONF_RADIUS, CONF_STRENGTH, darktable, dt_conf_get_sanitize_float(), dt_ui_main_window(), get_zoom_scale(), darktable_t::gui, M_PI, MIN, dt_develop_t::processed_height, dt_develop_t::processed_width, dt_develop_t::raw_height, dt_develop_t::raw_width, dt_develop_t::roi, and dt_gui_gtk_t::ui.
Referenced by _start_new_shape(), and scrolled().
|
static |
Definition at line 1819 of file liquify.c.
References DT_LIQUIFY_UI_WIDTH_LAST, dt_liquify_ui_widths, and DT_PIXEL_APPLY_DPI.
Referenced by set_line_width().
|
static |
Definition at line 2821 of file liquify.c.
References dt_dev_get_zoom_scale().
Referenced by get_point_scale(), get_stamp_params(), and gui_post_expose().
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
Definition at line 3977 of file liquify.c.
References IOP_GUI_FREE.
| void gui_focus | ( | struct dt_iop_module_t * | module, |
| gboolean | in | ||
| ) |
Definition at line 2872 of file liquify.c.
References btn_make_radio_callback(), darktable_t::collection, darktable, and dt_collection_hint_message().
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 3895 of file liquify.c.
References btn_make_radio_callback(), DT_GUI_BOX_SPACING, dt_iop_togglebutton_new(), DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_CTRLPOINT2, DT_LIQUIFY_LAYER_HARDNESSPOINT1, DT_LIQUIFY_LAYER_HARDNESSPOINT2, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_LAYER_RADIUSPOINT, DT_LIQUIFY_LAYER_STRENGTHPOINT, dt_liquify_layers, dt_ui_label_new(), dtgtk_cairo_paint_masks_edit(), dtgtk_liquify_cairo_paint_curve_tool(), dtgtk_liquify_cairo_paint_line_tool(), dtgtk_liquify_cairo_paint_node_tool(), FALSE, g, dt_liquify_layer_t::hint, IOP_GUI_ALLOC, NOWHERE, TRUE, and dt_iop_module_t::widget.
| void gui_post_expose | ( | struct dt_iop_module_t * | module, |
| cairo_t * | cr, | ||
| int32_t | width, | ||
| int32_t | height, | ||
| int32_t | pointerx, | ||
| int32_t | pointery | ||
| ) |
Definition at line 2826 of file liquify.c.
References _distort_paths(), draw_paths(), dt_dev_get_history_hash(), DT_DEV_PIPE_TOP_CHANGED, dt_dev_pixelpipe_get_history_hash(), dt_dev_pixelpipe_sync_virtual(), dt_dev_rescale_roi_to_input(), DT_DEV_TRANSFORM_DIR_ALL, dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), FALSE, g, get_zoom_scale(), dt_iop_module_t::gui_data, height, IS_NULL_PTR, dt_develop_t::processed_height, dt_develop_t::processed_width, dt_develop_t::roi, dt_develop_t::scaling, smooth_paths_linsys(), update_warp_count(), dt_develop_t::virtual_pipe, and width.
| void gui_reset | ( | dt_iop_module_t * | self | ) |
Definition at line 3968 of file liquify.c.
References btn_make_radio_callback(), g, dt_iop_module_t::gui_data, and NOWHERE.
| void gui_update | ( | dt_iop_module_t * | module | ) |
Refresh GUI controls from current params and configuration.
Definition at line 3888 of file liquify.c.
References g, dt_iop_module_t::gui_data, dt_iop_module_t::params, and update_warp_count().
| void init | ( | dt_iop_module_t * | module | ) |
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 1720 of file liquify.c.
References dt_opencl_create_kernel(), and dt_iop_liquify_global_data_t::warp_kernel.
| void init_pipe | ( | struct dt_iop_module_t * | module, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1749 of file liquify.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
|
static |
Definition at line 2761 of file liquify.c.
References dt_liquify_warp_t::control1, dt_liquify_warp_t::control2, DT_LIQUIFY_STATUS_NONE, DT_LIQUIFY_WARP_TYPE_LINEAR, dt_liquify_warp_t::point, dt_liquify_warp_t::radius, dt_liquify_warp_t::status, dt_liquify_warp_t::strength, and dt_liquify_warp_t::type.
Referenced by alloc_curve_to(), alloc_line_to(), and alloc_move_to().
| void input_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 352 of file liquify.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, default_input_format(), and TYPE_FLOAT.
|
static |
Definition at line 759 of file liquify.c.
References A, B, C, i, n, and t.
Referenced by build_lookup_table(), and interpolate_paths().
|
static |
Definition at line 1859 of file liquify.c.
References cmix(), dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, dt_free, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_PATH_MOVE_TO_V1, DT_LIQUIFY_STATUS_INTERPOLATED, get_arc_length(), dt_liquify_path_data_t::header, interpolate_cubic_bezier(), INTERPOLATION_POINTS, k, MAX_NODES, mix_warps(), dt_liquify_path_header_t::next, dt_liquify_path_data_t::node, node_prev(), p, dt_liquify_warp_t::point, point_at_arc_length(), dt_liquify_warp_t::radius, STAMP_RELOCATION, dt_liquify_warp_t::status, t, dt_liquify_path_header_t::type, and dt_liquify_path_data_t::warp.
Referenced by _distort_xtransform(), _draw_paths(), build_global_distortion_map(), and modify_roi_in().
|
static |
Definition at line 1449 of file liquify.c.
References g, and IS_NULL_PTR.
Referenced by _draw_paths(), btn_make_radio_callback(), button_pressed(), button_released(), and mouse_moved().
| int key_pressed | ( | struct dt_iop_module_t * | self, |
| GdkEventKey * | event | ||
| ) |
Definition at line 3652 of file liquify.c.
References _start_new_shape(), darktable_t::control, darktable, dt_control_hinter_message(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), dt_iop_request_focus(), dt_keys_mainpad_alternatives(), DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_STATUS_NEW, DT_LIQUIFY_STATUS_PREVIEW, end_drag(), FALSE, g, dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, dt_liquify_path_header_t::idx, IS_NULL_PTR, k, key, MAX_NODES, dt_liquify_path_header_t::next, node_delete(), node_get(), NOWHERE, dt_liquify_path_header_t::prev, dt_liquify_path_header_t::selected, start_drag(), sync_pipe(), TRUE, dt_liquify_path_header_t::type, unselect_all(), and update_warp_count().
|
inlinestatic |
Definition at line 1559 of file liquify.c.
References x.
Referenced by apply_global_distortion_map_cl().
|
inlinestatic |
Definition at line 705 of file liquify.c.
References t.
Referenced by __OMP_DECLARE_SIMD__(), _apply_mix(), _mix_rgb_anchors(), _sample_ring_anchor(), _sample_ring_hue(), _shared_paint_probe_matrix(), area_draw(), color_picker_apply(), mix_warps(), and process().
|
static |
Definition at line 718 of file liquify.c.
References dt_liquify_warp_t::control1, dt_liquify_warp_t::control2, FALSE, M_PI_F, mix(), dt_liquify_warp_t::point, r, dt_liquify_warp_t::radius, dt_liquify_warp_t::strength, t, TRUE, and dt_liquify_warp_t::type.
Referenced by button_released(), and interpolate_paths().
| void modify_roi_in | ( | struct dt_iop_module_t * | module, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const dt_iop_roi_t * | roi_out, | ||
| dt_iop_roi_t * | roi_in | ||
| ) |
Definition at line 1302 of file liquify.c.
References _get_map_extent(), dt_dev_pixelpipe_iop_t::buf_in, dt_dev_pixelpipe_iop_t::data, distort_paths_raw_to_piece(), dt_free_gpointer(), FALSE, dt_iop_roi_t::height, interpolate_paths(), dt_iop_roi_t::scale, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| void modify_roi_out | ( | struct dt_iop_module_t * | module, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_roi_t * | roi_out, | ||
| const dt_iop_roi_t * | roi_in | ||
| ) |
| int mouse_moved | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 2942 of file liquify.c.
References _hit_test_paths(), _is_movable_layer(), CONF_ANGLE, CONF_RADIUS, CONF_STRENGTH, darktable_t::control, dt_liquify_node_t::ctrl1, dt_liquify_node_t::ctrl2, d, darktable, delta, detect_drag(), dt_conf_set_float(), dt_control_hinter_message(), dt_control_queue_cursor_by_name(), dt_iop_gui_enter_critical_section(), dt_iop_gui_leave_critical_section(), DT_LIQUIFY_LAYER_CENTERPOINT, DT_LIQUIFY_LAYER_CTRLPOINT1, DT_LIQUIFY_LAYER_CTRLPOINT2, DT_LIQUIFY_LAYER_HARDNESSPOINT1, DT_LIQUIFY_LAYER_HARDNESSPOINT2, DT_LIQUIFY_LAYER_PATH, DT_LIQUIFY_LAYER_RADIUSPOINT, DT_LIQUIFY_LAYER_STRENGTHPOINT, dt_liquify_layers, DT_LIQUIFY_NODE_TYPE_SMOOTH, DT_LIQUIFY_NODE_TYPE_SYMMETRICAL, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_LINE_TO_V1, DT_LIQUIFY_PATH_MOVE_TO_V1, dt_liquify_hit_t::elem, FALSE, find_hovered(), g, get_point_scale(), dt_iop_module_t::gui_data, dt_liquify_path_data_t::header, dt_liquify_layer_t::hint, dt_liquify_path_header_t::hovered, i, is_dragging(), IS_NULL_PTR, dt_liquify_hit_t::layer, MIN, n, dt_liquify_path_data_t::node, node_next(), node_prev(), p, dt_iop_module_t::params, dt_liquify_warp_t::point, dt_liquify_warp_t::radius, start_drag(), dt_liquify_warp_t::strength, sync_pipe(), TRUE, dt_liquify_path_header_t::type, dt_liquify_path_data_t::warp, and x.
| const char * name | ( | ) |
Definition at line 317 of file liquify.c.
Referenced by dt_conf_get_sanitize_float().
|
static |
Definition at line 372 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, dt_liquify_path_data_t::header, dt_liquify_path_header_t::idx, k, MAX_NODES, and p.
Referenced by alloc_curve_to(), alloc_line_to(), and alloc_move_to().
|
static |
Definition at line 450 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_MOVE_TO_V1, dt_liquify_path_data_t::header, dt_liquify_path_header_t::idx, IS_NULL_PTR, dt_liquify_path_header_t::next, node_gc(), node_next(), node_prev(), p, dt_liquify_path_header_t::prev, and dt_liquify_path_header_t::type.
Referenced by btn_make_radio_callback(), button_released(), and key_pressed().
|
static |
Definition at line 419 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, k, MAX_NODES, and p.
Referenced by node_delete(), and path_delete().
|
static |
Definition at line 394 of file liquify.c.
Referenced by button_released(), and key_pressed().
|
static |
Definition at line 410 of file liquify.c.
References dt_liquify_path_data_t::header, dt_liquify_path_header_t::next, and p.
Referenced by button_released().
|
static |
Definition at line 402 of file liquify.c.
Referenced by mouse_moved(), node_delete(), path_delete(), and smooth_paths_linsys().
|
static |
Definition at line 386 of file liquify.c.
Referenced by _draw_paths(), _hit_paths(), btn_make_radio_callback(), button_released(), interpolate_paths(), mouse_moved(), node_delete(), path_delete(), and smooth_paths_linsys().
|
inlinestatic |
| int operation_tags | ( | ) |
Definition at line 342 of file liquify.c.
References IOP_TAG_DISTORT.
|
static |
Definition at line 473 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, dt_liquify_path_data_t::header, n, node_gc(), node_next(), node_prev(), p, and dt_liquify_path_header_t::type.
Referenced by button_released().
|
static |
Definition at line 2641 of file liquify.c.
Referenced by smooth_paths_linsys().
|
static |
Definition at line 815 of file liquify.c.
References cmix(), i, restart_cookie_t::i, IS_NULL_PTR, restart_cookie_t::length, and t.
Referenced by interpolate_paths().
| __DT_CLONE_TARGETS__ int process | ( | struct dt_iop_module_t * | module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | in, | ||
| void *const | out | ||
| ) |
Definition at line 1503 of file liquify.c.
References __OMP_PARALLEL_FOR__, apply_global_distortion_map(), build_global_distortion_map(), ch, dt_pixelpipe_cache_free_align, height, dt_iop_roi_t::height, i, IS_NULL_PTR, MIN, out, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| int process_cl | ( | struct dt_iop_module_t * | module, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const cl_mem_t | dev_in, | ||
| const cl_mem_t | dev_out | ||
| ) |
Definition at line 1675 of file liquify.c.
References apply_global_distortion_map_cl(), build_global_distortion_map(), dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_opencl_enqueue_copy_image(), dt_pixelpipe_cache_free_align, dt_print(), error(), FALSE, height, dt_iop_roi_t::height, IS_NULL_PTR, MIN, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, TRUE, width, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| int scrolled | ( | struct dt_iop_module_t * | module, |
| double | x, | ||
| double | y, | ||
| int | up, | ||
| uint32_t | state | ||
| ) |
Definition at line 3185 of file liquify.c.
References CONF_ANGLE, CONF_RADIUS, CONF_STRENGTH, dt_conf_set_float(), DT_M_PI_F, dt_mask_scroll_increases(), dt_modifier_is(), factor, g, get_stamp_params(), dt_iop_module_t::gui_data, dt_liquify_warp_t::point, r, dt_liquify_warp_t::radius, state, and dt_liquify_warp_t::strength.
|
static |
Definition at line 1827 of file liquify.c.
References get_ui_width(), and width.
|
static |
Definition at line 1814 of file liquify.c.
References dt_liquify_rgba_t::alpha, dt_liquify_rgba_t::blue, dt_liquify_rgba_t::green, and dt_liquify_rgba_t::red.
|
static |
Smooth a bezier spline through prescribed points.
Smooth a bezier spline through prescribed points by solving a linear system. First we build a tridiagonal matrix and then we solve it using the Thomas algorithm. (FIXME: A tridiagonal matrix is easy to solve in O(n) but you cannot write a closed path as a tridiagonal. To solve closed paths we will have to use a different solver. Use the GSL?)
Here is an article that explains the math: http://www.particleincell.com/blog/2012/bezier-splines/
Basically we find all the ctrl1 points when we solve the linear system, then we calculate each ctrl2 from the ctrl1.
We build the linear system choosing for each segment of the path an equation among following 9 equations. "Straight" is a path that goes straight in to the knot (2nd derivative == 0 at the knot). "Smooth" means a path that goes smoothly through the knot, makes no corner and curves the same amount just before and just after the knot (1st and 2nd derivatives are constant around the knot.) "Keep" means to keep the control point as the user set it.
| start | end of path | |
|---|---|---|
| 1 | straight | smooth |
| 2 | smooth | smooth |
| 3 | smooth | straight |
| 4 | keep | smooth |
| 5 | keep | keep |
| 6 | smooth | keep |
| 7 | keep | straight |
| 8 | straight | straight (yields a line) |
| 9 | straight | keep |
The equations are (close your eyes):
Some of these are the same and differ only in the way we calculate c2. (You may open your eyes again.)
Definition at line 2568 of file liquify.c.
References ABCD, c1, c2, d, dt_free, i, k, m, and n.
Referenced by smooth_paths_linsys().
|
static |
Definition at line 2652 of file liquify.c.
References c1, c2, dt_liquify_node_t::ctrl1, d, dt_free, DT_LIQUIFY_NODE_TYPE_AUTOSMOOTH, DT_LIQUIFY_PATH_CURVE_TO_V1, DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_LINE_TO_V1, dt_liquify_path_data_t::header, k, MAX_NODES, n, dt_liquify_path_data_t::node, node_next(), node_prev(), p, path_length(), dt_liquify_warp_t::point, smooth_path_linsys(), dt_liquify_path_header_t::type, and dt_liquify_path_data_t::warp.
Referenced by gui_post_expose().
|
static |
Definition at line 1438 of file liquify.c.
References g.
Referenced by _start_new_shape(), button_pressed(), button_released(), key_pressed(), and mouse_moved().
|
static |
Definition at line 2881 of file liquify.c.
References darktable, darktable_t::develop, dt_control_queue_redraw_center(), dt_dev_add_history_item, g, dt_iop_module_t::gui_data, dt_iop_module_t::params, and TRUE.
Referenced by btn_make_radio_callback(), button_released(), key_pressed(), and mouse_moved().
|
static |
Definition at line 2812 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, k, MAX_NODES, and p.
Referenced by button_released(), and key_pressed().
|
static |
Definition at line 1840 of file liquify.c.
References DT_LIQUIFY_PATH_INVALIDATED, DT_LIQUIFY_PATH_MOVE_TO_V1, g, k, and MAX_NODES.
Referenced by button_released(), gui_post_expose(), gui_update(), and key_pressed().
|
static |
Definition at line 137 of file liquify.c.
Referenced by _draw_paths().
|
static |
Definition at line 136 of file liquify.c.
Referenced by _draw_paths().
| dt_liquify_layer_t dt_liquify_layers[] |
Definition at line 151 of file liquify.c.
Referenced by _draw_paths(), _hit_paths(), _hit_test_paths(), draw_paths(), gui_init(), and mouse_moved().
| float dt_liquify_ui_widths[] |
Definition at line 187 of file liquify.c.
Referenced by get_ui_width().
| const int INTERPOLATION_POINTS = 100 |
Definition at line 82 of file liquify.c.
Referenced by _hit_paths(), button_released(), and interpolate_paths().
| const int LOOKUP_OVERSAMPLE = 10 |
Definition at line 81 of file liquify.c.
Referenced by build_round_stamp().
|
static |
Definition at line 282 of file liquify.c.
Referenced by _hit_paths(), _hit_test_paths(), _start_new_shape(), button_pressed(), button_released(), end_drag(), gui_init(), gui_reset(), and key_pressed().
| const float STAMP_RELOCATION = 0.1 |
Definition at line 83 of file liquify.c.
Referenced by build_round_stamp(), and interpolate_paths().