![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Collaboration diagram for rect_iter:Data Fields | |
| double | vx [4] |
| double | vy [4] |
| double | ys |
| double | ye |
| int | x |
| int | y |
Rectangle points iterator.
The integer coordinates of pixels inside a rectangle are iteratively explored. This structure keep track of the process and functions ri_ini(), ri_inc(), ri_end(), and ri_del() are used in the process. An example of how to use the iterator is as follows:
The pixels are explored 'column' by 'column', where we call 'column' a set of pixels with the same x value that are inside the rectangle. The following is an schematic representation of a rectangle, the 'column' being explored is marked by colons, and the current pixel being explored is 'x,y'.
vx[1],vy[1]
* *
* *
* *
* ye
* : *
vx[0],vy[0] : *
* : *
* x,y *
* : *
* : vx[2],vy[2]
* : *
y ys *
^ * *
| * *
| * *
+---> x vx[3],vy[3]The first 'column' to be explored is the one with the smaller x value. Each 'column' is explored starting from the pixel of the 'column' (inside the rectangle) with the smallest y value.
The four corners of the rectangle are stored in order that rotates around the corners at the arrays 'vx[]' and 'vy[]'. The first point is always the one with smaller x value.
'x' and 'y' are the coordinates of the pixel being explored. 'ys' and 'ye' are the start and end values of the current column being explored. So, 'ys' < 'ye'.
| int rect_iter::x |
Referenced by rect_nfa(), ri_end(), ri_inc(), and ri_ini().
| int rect_iter::y |
Referenced by rect_nfa(), ri_inc(), and ri_ini().