Blender  V3.3
Static Public Member Functions | List of all members
blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv > Struct Template Reference

Static Public Member Functions

static void buffer_to_sector (const float source[2], float x, float y, float &u, float &v)
 
static void sector_to_buffer (const float source[2], int u, int v, int &x, int &y)
 
static floatinit_buffer_iterator (MemoryBuffer *input, const float source[2], const float co[2], float dist_min, float dist_max, int &x, int &y, int &num, float &v, float &dv, float &falloff_factor)
 
static void eval (MemoryBuffer *input, float output[4], const float co[2], const float source[2], float dist_min, float dist_max)
 

Detailed Description

template<int fxu, int fxv, int fyu, int fyv>
struct blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >

Defines a line accumulator for a specific sector, given by the four matrix entries that rotate from buffer space into the sector

(x,y) is used to designate buffer space coordinates (u,v) is used to designate sector space coordinates

For a target point (x,y) the sector should be chosen such that u >= v >= 0 This removes the need to handle all sorts of special cases.

Template parameters:

Parameters
fxubuffer increment in x for sector u + 1.
fxvbuffer increment in x for sector v + 1.
fyubuffer increment in y for sector u + 1.
fyvbuffer increment in y for sector v + 1.

Definition at line 49 of file COM_SunBeamsOperation.cc.

Member Function Documentation

◆ buffer_to_sector()

template<int fxu, int fxv, int fyu, int fyv>
static void blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::buffer_to_sector ( const float  source[2],
float  x,
float  y,
float u,
float v 
)
inlinestatic

◆ eval()

template<int fxu, int fxv, int fyu, int fyv>
static void blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::eval ( MemoryBuffer input,
float  output[4],
const float  co[2],
const float  source[2],
float  dist_min,
float  dist_max 
)
inlinestatic

Perform the actual accumulation along a ray segment from source to pt. Only pixels within dist_min..dist_max contribute.

The loop runs backwards(!) over the primary sector space axis u, i.e. increasing distance to pt. After each step it decrements v by dv < 1, adding a buffer shift when necessary.

Definition at line 127 of file COM_SunBeamsOperation.cc.

References border, buffer, copy_v4_v4(), float(), floorf, blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::init_buffer_iterator(), input, madd_v4_v4fl(), mul_v4_fl(), output, v, x, rcti::xmin, y, rcti::ymax, rcti::ymin, zero_v3(), and zero_v4().

Referenced by blender::compositor::accumulate_line().

◆ init_buffer_iterator()

template<int fxu, int fxv, int fyu, int fyv>
static float* blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::init_buffer_iterator ( MemoryBuffer input,
const float  source[2],
const float  co[2],
float  dist_min,
float  dist_max,
int &  x,
int &  y,
int &  num,
float v,
float dv,
float falloff_factor 
)
inlinestatic

Set up the initial buffer pointer and calculate necessary variables for looping.

Note that sector space is centered around the "source" point while the loop starts at dist_min from the target pt. This way the loop can be canceled as soon as it runs out of the buffer rect, because no pixels further along the line can contribute.

Parameters
x,yStart location in the buffer
numTotal steps in the loop
v,dvVertical offset in sector space, for line offset perpendicular to the loop axis

Definition at line 82 of file COM_SunBeamsOperation.cc.

References blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::buffer_to_sector(), ceilf, double(), floorf, input, max_ff(), blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::sector_to_buffer(), sqrt(), v, x, and y.

Referenced by blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::eval().

◆ sector_to_buffer()

template<int fxu, int fxv, int fyu, int fyv>
static void blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::sector_to_buffer ( const float  source[2],
int  u,
int  v,
int &  x,
int &  y 
)
inlinestatic

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