Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
distort_params_t Struct Reference
+ Collaboration diagram for distort_params_t:

Data Fields

dt_develop_tdevelop
 
dt_dev_pixelpipe_tpipe
 
float from_scale
 
float to_scale
 
int transf_direction
 
gboolean from_distort_transform
 

Detailed Description

The functions in this group help transform between coordinate systems. (In darktable nomenclature this kind of transform is called 'distort').

The transforms between coordinate systems are not necessarily perspective transforms (eg. lensfun), therefore no transformation matrix can be specified for them, instead all points to be transformed have to be passed through a darktable function.

Note: only points may be sensibly 'distorted'. Vectors and scalars don't have a meaningful 'distort'.

Explanation of the coordinate systems used by this module:

RAW: These are sensor coordinates. They go from x=0, y=0 to x=<sensor width>, y=<sensor height>. In a landscape picture (rotated 0°) x=0, y=0 will be top left. In a portrait picture (rotated 90° counter-clockwise) x=0, y=0 will be bottom left.

The user probably wants liquified regions to be anchored to the motive when more transformations are added, eg. a different cropping of the image. For this to work, all coordinates we store or pass between gui and pipe are RAW sensor coordinates.

PIECE: These are coordinates based on the size of our pipe piece. They go from x=0, y=0 to x=<width of piece>, y=<height of piece>. PIECE coordinates should only be used while processing an image.

Note: Currently (as of darktable 1.7) there are no geometry transforms between RAW and PIECE (our module coming very early in the pipe), but this may change in a later release. By allowing for them now, we are prepared for pipe order re-shuffeling.

CAIRO: These are coordinates based on the cairo view. The extent of the longest side of the cooked picture is normalized to 1.0. x=0, y=0 is the top left of the cooked picture. x=u, y=v is the bottom right of a cooked picture with u<=1, v<=1 and either u==1 or v==1 depending on orientation. Note that depending on pan and zoom cairo view borders and cooked picture borders may intersect in many ways.

The normalized scale helps in choosing default values for vectors and radii.

VIEW: These are coordinates based on the cairo view. x=0, y=0 being top left and x=<view width>, y=<view height> being bottom right. The parameters to the mouse_moved, button_pressed, and button_released functions are in this system.

This system is also used for sizing ui-elements. They cannot be expressed in CAIRO coordinates because they should not change size when zooming the picture.

To get sensible sizes for ui elements and default warps use this relation between the scales: CAIRO * get_zoom_scale () == VIEW.

Field Documentation

◆ develop

dt_develop_t* distort_params_t::develop

◆ from_distort_transform

gboolean distort_params_t::from_distort_transform

◆ from_scale

float distort_params_t::from_scale

◆ pipe

dt_dev_pixelpipe_t* distort_params_t::pipe

◆ to_scale

float distort_params_t::to_scale

◆ transf_direction

int distort_params_t::transf_direction

The documentation for this struct was generated from the following file: