![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "iop/drawlayer/coordinates.h"#include "iop/drawlayer/conf.h"#include "develop/develop.h"#include "develop/geometry/geometry.h"#include <string.h>
Include dependency graph for coordinates.c:Go to the source code of this file.
|
static |
Does the orientation flip.c settled on swap the axes?
Asked of the SIZE FOLD, not of the EXIF tag: a raw's recorded orientation is not always right, and iop/flip.c exists precisely so the user can override it. Its _flip_resolve() merges the two, and what this reads – the rect flip's own fold maps its input to – is the consequence of that merge. So a corrected orientation is honoured with no access to flip's private data and no second copy of the merge rule.
Read from flip's record on the GUI side and from flip's piece on a pipe, which are the same fold run by the two sides; nothing else in the pipe transposes. The focused-module exception cannot disturb it either: flip is tagged IOP_TAG_DISTORT and no module's operation_tags_filter() suppresses that tag – crop filters DECORATION, ashift DECORATION|CLIPPING.
A disabled flip folds its input to itself, so the answer is FALSE, which is what an orientation of NONE means. A square frame cannot express a swap, and does not need to: the canvas has the same dimensions either way.
Definition at line 54 of file coordinates.c.
References dt_iop_module_t::dev, dt_geometry_chain_find(), FALSE, dt_develop_t::geometry_chain, dt_iop_roi_t::height, dt_geometry_record_t::in, IS_NULL_PTR, dt_dev_pixelpipe_t::nodes, out, dt_geometry_record_t::out, piece, pipe, TRUE, and dt_iop_roi_t::width.
Referenced by dt_drawlayer_layer_canvas_for_pipe().
|
static |
Definition at line 167 of file coordinates.c.
References dt_drawlayer_layer_canvas(), layer_height, and layer_width.
Referenced by dt_drawlayer_compute_view_patch().
| gboolean dt_drawlayer_compute_view_patch | ( | dt_iop_module_t * | self, |
| const float | padding, | ||
| drawlayer_view_patch_info_t * | view | ||
| ) |
Definition at line 313 of file coordinates.c.
References _virtual_piece_layer_geometry(), dt_iop_module_t::dev, dt_dev_get_overlay_scale(), dt_dev_roi_request_preview_height(), dt_dev_roi_request_preview_width(), dt_dev_viewport_border_size(), dt_dev_viewport_widget_height(), dt_dev_viewport_widget_width(), dt_drawlayer_widget_points_to_layer_coords(), FALSE, i, IS_NULL_PTR, layer_height, layer_width, MAX, MIN, and view.
Referenced by _ensure_widget_cache().
| float dt_drawlayer_current_live_padding | ( | dt_iop_module_t * | self | ) |
Definition at line 308 of file coordinates.c.
References dt_drawlayer_conf_size().
Referenced by _fill_runtime_inputs(), and dt_drawlayer_sync_widget_cache().
| gboolean dt_drawlayer_layer_bounds_to_widget_bounds | ( | dt_iop_module_t * | self, |
| const float | x0, | ||
| const float | y0, | ||
| const float | x1, | ||
| const float | y1, | ||
| float * | left, | ||
| float * | top, | ||
| float * | right, | ||
| float * | bottom | ||
| ) |
Definition at line 251 of file coordinates.c.
References dt_drawlayer_layer_points_to_widget_coords(), FALSE, i, IS_NULL_PTR, top, and TRUE.
Referenced by _ensure_widget_cache().
| gboolean dt_drawlayer_layer_canvas | ( | dt_iop_module_t * | self, |
| int * | width, | ||
| int * | height | ||
| ) |
dt_drawlayer_layer_canvas_for_pipe for a GUI caller.
Definition at line 110 of file coordinates.c.
References dt_drawlayer_layer_canvas_for_pipe(), height, and width.
Referenced by _virtual_piece_layer_geometry().
| gboolean dt_drawlayer_layer_canvas_for_pipe | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| int * | width, | ||
| int * | height | ||
| ) |
Definition at line 87 of file coordinates.c.
References _flip_swaps_axes(), dt_iop_module_t::dev, dt_dev_geometry_get_raw_size(), FALSE, height, IS_NULL_PTR, pipe, swap(), TRUE, and width.
Referenced by dt_drawlayer_layer_canvas(), and dt_drawlayer_raw_placement_for_frame().
| gboolean dt_drawlayer_layer_points_to_widget_coords | ( | dt_iop_module_t * | self, |
| float * | pts, | ||
| const int | count | ||
| ) |
Definition at line 199 of file coordinates.c.
References dt_iop_module_t::dev, dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_coordinates_image_norm_to_widget(), dt_dev_coordinates_preview_abs_to_image_norm(), dt_dev_distort_transform_gui(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, dt_drawlayer_raw_placement_gui(), FALSE, i, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_drawlayer_raw_placement_t::offset_x, dt_drawlayer_raw_placement_t::offset_y, and TRUE.
Referenced by dt_drawlayer_layer_bounds_to_widget_bounds(), dt_drawlayer_layer_to_widget_coords(), and dt_drawlayer_widget_brush_radius().
| gboolean dt_drawlayer_layer_to_widget_coords | ( | dt_iop_module_t * | self, |
| const float | x, | ||
| const float | y, | ||
| float * | wx, | ||
| float * | wy | ||
| ) |
Definition at line 239 of file coordinates.c.
References dt_drawlayer_layer_points_to_widget_coords(), FALSE, IS_NULL_PTR, TRUE, and x.
Referenced by gui_post_expose().
| gboolean dt_drawlayer_raw_placement_for_frame | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_iop_roi_t *const | frame, | ||
| dt_drawlayer_raw_placement_t * | placement | ||
| ) |
Definition at line 115 of file coordinates.c.
References dt_drawlayer_layer_canvas_for_pipe(), FALSE, dt_iop_roi_t::height, IS_NULL_PTR, dt_drawlayer_raw_placement_t::offset_x, dt_drawlayer_raw_placement_t::offset_y, pipe, TRUE, dt_drawlayer_raw_placement_t::valid, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by dt_drawlayer_raw_placement_gui().
| gboolean dt_drawlayer_raw_placement_gui | ( | dt_iop_module_t * | self, |
| dt_drawlayer_raw_placement_t * | placement, | ||
| int * | frame_width, | ||
| int * | frame_height | ||
| ) |
The placement against this module's frame, as the GUI sees it.
Definition at line 151 of file coordinates.c.
References dt_iop_module_t::dev, dt_dev_module_geometry_gui(), dt_drawlayer_raw_placement_for_frame(), FALSE, dt_iop_roi_t::height, IS_NULL_PTR, and dt_iop_roi_t::width.
Referenced by dt_drawlayer_layer_points_to_widget_coords(), and dt_drawlayer_widget_points_to_layer_coords().
| float dt_drawlayer_widget_brush_radius | ( | dt_iop_module_t * | self, |
| const dt_drawlayer_brush_dab_t * | dab, | ||
| const float | fallback | ||
| ) |
Definition at line 281 of file coordinates.c.
References dt_iop_module_t::dev, dt_drawlayer_layer_points_to_widget_coords(), IS_NULL_PTR, dt_drawlayer_brush_dab_t::radius, dt_drawlayer_brush_dab_t::x, and dt_drawlayer_brush_dab_t::y.
Referenced by gui_post_expose().
| gboolean dt_drawlayer_widget_points_to_layer_coords | ( | dt_iop_module_t * | self, |
| float * | pts, | ||
| const int | count | ||
| ) |
Definition at line 172 of file coordinates.c.
References dt_iop_module_t::dev, dt_dev_coordinates_image_norm_to_preview_abs(), dt_dev_coordinates_preview_abs_to_image_norm(), dt_dev_coordinates_widget_to_image_norm(), dt_dev_distort_backtransform_gui(), DT_DEV_TRANSFORM_DIR_FORW_EXCL, dt_drawlayer_raw_placement_gui(), FALSE, i, dt_iop_module_t::iop_order, IS_NULL_PTR, dt_drawlayer_raw_placement_t::offset_x, dt_drawlayer_raw_placement_t::offset_y, and TRUE.
Referenced by dt_drawlayer_compute_view_patch(), and dt_drawlayer_widget_to_layer_coords().
| gboolean dt_drawlayer_widget_to_layer_coords | ( | dt_iop_module_t * | self, |
| const double | wx, | ||
| const double | wy, | ||
| float * | lx, | ||
| float * | ly | ||
| ) |
Definition at line 226 of file coordinates.c.
References dt_drawlayer_widget_points_to_layer_coords(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _fill_input_layer_coords(), dt_drawlayer_build_worker_input_dab(), and gui_post_expose().