15 if ((t = 1.0f -
sqrtf(x * x + y * y)) > 0.0f) {
26 const int qt = 1 << settings->quality;
27 const float s1 = 4.0f /
float(qt), s2 = 2.0f * s1;
30 float sc, isc, u,
v, sm, s, t, ofs, scalef[64];
31 const float cmo = 1.0f - settings->colmod;
70 ofs = (settings->iter & 1) ? 0.5f : 0.0f;
71 for (x = 0; x < (settings->iter * 4); x++) {
73 cm[
x][0] = cm[
x][1] = cm[
x][2] = 1;
83 scalef[
x] = 2.1f * (1.0f - (x + ofs) /
float(settings->iter * 4));
85 scalef[
x] = -0.99f / scalef[
x];
91 for (y = 0; y < gbuf.
get_height() && (!breaked); y++) {
95 s = (u - 0.5f) * sc + 0.5f;
96 t = (
v - 0.5f) * sc + 0.5f;
100 s = (u - 0.5f) * isc + 0.5f;
101 t = (
v - 0.5f) * isc + 0.5f;
116 for (n = 1; n < settings->iter && (!breaked); n++) {
117 for (y = 0; y < gbuf.
get_height() && (!breaked); y++) {
121 tc[0] = tc[1] = tc[2] = 0.0f;
122 for (p = 0; p < 4; p++) {
124 s = (u - 0.5f) * scalef[np] + 0.5f;
125 t = (
v - 0.5f) * scalef[np] + 0.5f;
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void mul_v3_fl(float r[3], float f)
#define fRGB_rgbmult(c, r, g, b)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static void IIR_gauss(MemoryBuffer *src, float sigma, unsigned int channel, unsigned int xy)
void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings) override
a MemoryBuffer contains access to the data
const int get_width() const
get the width of this MemoryBuffer
const int get_height() const
get the height of this MemoryBuffer
void write_pixel(int x, int y, const float color[4])
float * get_buffer()
get the data of this MemoryBuffer
void read_bilinear(float *result, float x, float y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip) const
void add_pixel(int x, int y, const float color[4])
draw_view in_light_buf[] float
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
static float smooth_mask(float x, float y)