Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
coordinates.c File Reference
#include "iop/drawlayer/coordinates.h"
#include "develop/geometry/geometry.h"
#include <string.h>
+ Include dependency graph for coordinates.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static gboolean _flip_swaps_axes (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe)
 Does the orientation flip.c settled on swap the axes?
 
gboolean dt_drawlayer_layer_canvas_for_pipe (dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, int *width, int *height)
 
gboolean dt_drawlayer_layer_canvas (dt_iop_module_t *self, int *width, int *height)
 dt_drawlayer_layer_canvas_for_pipe for a GUI caller.
 
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)
 
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.
 
static gboolean _virtual_piece_layer_geometry (dt_iop_module_t *self, int *layer_width, int *layer_height)
 
gboolean dt_drawlayer_widget_points_to_layer_coords (dt_iop_module_t *self, float *pts, const int count)
 
gboolean dt_drawlayer_layer_points_to_widget_coords (dt_iop_module_t *self, float *pts, const int count)
 
gboolean dt_drawlayer_widget_to_layer_coords (dt_iop_module_t *self, const double wx, const double wy, float *lx, float *ly)
 
gboolean dt_drawlayer_layer_to_widget_coords (dt_iop_module_t *self, const float x, const float y, float *wx, float *wy)
 
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)
 
float dt_drawlayer_widget_brush_radius (dt_iop_module_t *self, const dt_drawlayer_brush_dab_t *dab, const float fallback)
 
float dt_drawlayer_current_live_padding (dt_iop_module_t *self)
 
gboolean dt_drawlayer_compute_view_patch (dt_iop_module_t *self, const float padding, drawlayer_view_patch_info_t *view)
 

Function Documentation

◆ _flip_swaps_axes()

static gboolean _flip_swaps_axes ( dt_iop_module_t self,
const dt_dev_pixelpipe_t pipe 
)
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 50 of file coordinates.c.

References dt_dev_pixelpipe_iop_t::buf_in, dt_dev_pixelpipe_iop_t::buf_out, dt_dev_pixelpipe_iop_t::data, 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, TRUE, and dt_iop_roi_t::width.

Referenced by dt_drawlayer_layer_canvas_for_pipe().

◆ _virtual_piece_layer_geometry()

static gboolean _virtual_piece_layer_geometry ( dt_iop_module_t self,
int *  layer_width,
int *  layer_height 
)
static

Definition at line 163 of file coordinates.c.

References dt_drawlayer_layer_canvas().

Referenced by dt_drawlayer_compute_view_patch().

◆ dt_drawlayer_compute_view_patch()

◆ dt_drawlayer_current_live_padding()

float dt_drawlayer_current_live_padding ( dt_iop_module_t self)

◆ dt_drawlayer_layer_bounds_to_widget_bounds()

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 247 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().

◆ dt_drawlayer_layer_canvas()

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 106 of file coordinates.c.

References dt_drawlayer_layer_canvas_for_pipe(), height, and width.

Referenced by _virtual_piece_layer_geometry().

◆ dt_drawlayer_layer_canvas_for_pipe()

gboolean dt_drawlayer_layer_canvas_for_pipe ( dt_iop_module_t self,
const dt_dev_pixelpipe_t pipe,
int *  width,
int *  height 
)

◆ dt_drawlayer_layer_points_to_widget_coords()

◆ dt_drawlayer_layer_to_widget_coords()

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 235 of file coordinates.c.

References dt_drawlayer_layer_points_to_widget_coords(), FALSE, IS_NULL_PTR, TRUE, and x.

Referenced by _paint_layer_to_widget_cb().

◆ dt_drawlayer_raw_placement_for_frame()

◆ 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 
)

◆ dt_drawlayer_widget_brush_radius()

float dt_drawlayer_widget_brush_radius ( dt_iop_module_t self,
const dt_drawlayer_brush_dab_t dab,
const float  fallback 
)

◆ dt_drawlayer_widget_points_to_layer_coords()

◆ 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 
)