Blender  V3.3
COM_GlareFogGlowOperation.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
5 
6 namespace blender::compositor {
7 
8 /*
9  * 2D Fast Hartley Transform, used for convolution
10  */
11 
12 using fREAL = float;
13 
14 /* Returns next highest power of 2 of x, as well its log2 in L2. */
15 static unsigned int next_pow2(unsigned int x, unsigned int *L2)
16 {
17  unsigned int pw, x_notpow2 = x & (x - 1);
18  *L2 = 0;
19  while (x >>= 1) {
20  ++(*L2);
21  }
22  pw = 1 << (*L2);
23  if (x_notpow2) {
24  (*L2)++;
25  pw <<= 1;
26  }
27  return pw;
28 }
29 
30 //------------------------------------------------------------------------------
31 
32 /* From FXT library by Joerg Arndt, faster in order bit-reversal
33  * use: `r = revbin_upd(r, h)` where `h = N>>1`. */
34 static unsigned int revbin_upd(unsigned int r, unsigned int h)
35 {
36  while (!((r ^= h) & h)) {
37  h >>= 1;
38  }
39  return r;
40 }
41 //------------------------------------------------------------------------------
42 static void FHT(fREAL *data, unsigned int M, unsigned int inverse)
43 {
44  double tt, fc, dc, fs, ds, a = M_PI;
45  fREAL t1, t2;
46  int n2, bd, bl, istep, k, len = 1 << M, n = 1;
47 
48  int i, j = 0;
49  unsigned int Nh = len >> 1;
50  for (i = 1; i < (len - 1); i++) {
51  j = revbin_upd(j, Nh);
52  if (j > i) {
53  t1 = data[i];
54  data[i] = data[j];
55  data[j] = t1;
56  }
57  }
58 
59  do {
60  fREAL *data_n = &data[n];
61 
62  istep = n << 1;
63  for (k = 0; k < len; k += istep) {
64  t1 = data_n[k];
65  data_n[k] = data[k] - t1;
66  data[k] += t1;
67  }
68 
69  n2 = n >> 1;
70  if (n > 2) {
71  fc = dc = cos(a);
72  fs = ds = sqrt(1.0 - fc * fc); // sin(a);
73  bd = n - 2;
74  for (bl = 1; bl < n2; bl++) {
75  fREAL *data_nbd = &data_n[bd];
76  fREAL *data_bd = &data[bd];
77  for (k = bl; k < len; k += istep) {
78  t1 = fc * (double)data_n[k] + fs * (double)data_nbd[k];
79  t2 = fs * (double)data_n[k] - fc * (double)data_nbd[k];
80  data_n[k] = data[k] - t1;
81  data_nbd[k] = data_bd[k] - t2;
82  data[k] += t1;
83  data_bd[k] += t2;
84  }
85  tt = fc * dc - fs * ds;
86  fs = fs * dc + fc * ds;
87  fc = tt;
88  bd -= 2;
89  }
90  }
91 
92  if (n > 1) {
93  for (k = n2; k < len; k += istep) {
94  t1 = data_n[k];
95  data_n[k] = data[k] - t1;
96  data[k] += t1;
97  }
98  }
99 
100  n = istep;
101  a *= 0.5;
102  } while (n < len);
103 
104  if (inverse) {
105  fREAL sc = (fREAL)1 / (fREAL)len;
106  for (k = 0; k < len; k++) {
107  data[k] *= sc;
108  }
109  }
110 }
111 //------------------------------------------------------------------------------
112 /* 2D Fast Hartley Transform, Mx/My -> log2 of width/height,
113  * nzp -> the row where zero pad data starts,
114  * inverse -> see above. */
115 static void FHT2D(
116  fREAL *data, unsigned int Mx, unsigned int My, unsigned int nzp, unsigned int inverse)
117 {
118  unsigned int i, j, Nx, Ny, maxy;
119 
120  Nx = 1 << Mx;
121  Ny = 1 << My;
122 
123  /* Rows (forward transform skips 0 pad data). */
124  maxy = inverse ? Ny : nzp;
125  for (j = 0; j < maxy; j++) {
126  FHT(&data[Nx * j], Mx, inverse);
127  }
128 
129  /* Transpose data. */
130  if (Nx == Ny) { /* Square. */
131  for (j = 0; j < Ny; j++) {
132  for (i = j + 1; i < Nx; i++) {
133  unsigned int op = i + (j << Mx), np = j + (i << My);
134  SWAP(fREAL, data[op], data[np]);
135  }
136  }
137  }
138  else { /* Rectangular. */
139  unsigned int k, Nym = Ny - 1, stm = 1 << (Mx + My);
140  for (i = 0; stm > 0; i++) {
141 #define PRED(k) (((k & Nym) << Mx) + (k >> My))
142  for (j = PRED(i); j > i; j = PRED(j)) {
143  /* Pass. */
144  }
145  if (j < i) {
146  continue;
147  }
148  for (k = i, j = PRED(i); j != i; k = j, j = PRED(j), stm--) {
149  SWAP(fREAL, data[j], data[k]);
150  }
151 #undef PRED
152  stm--;
153  }
154  }
155 
156  SWAP(unsigned int, Nx, Ny);
157  SWAP(unsigned int, Mx, My);
158 
159  /* Now columns == transposed rows. */
160  for (j = 0; j < Ny; j++) {
161  FHT(&data[Nx * j], Mx, inverse);
162  }
163 
164  /* Finalize. */
165  for (j = 0; j <= (Ny >> 1); j++) {
166  unsigned int jm = (Ny - j) & (Ny - 1);
167  unsigned int ji = j << Mx;
168  unsigned int jmi = jm << Mx;
169  for (i = 0; i <= (Nx >> 1); i++) {
170  unsigned int im = (Nx - i) & (Nx - 1);
171  fREAL A = data[ji + i];
172  fREAL B = data[jmi + i];
173  fREAL C = data[ji + im];
174  fREAL D = data[jmi + im];
175  fREAL E = (fREAL)0.5 * ((A + D) - (B + C));
176  data[ji + i] = A - E;
177  data[jmi + i] = B + E;
178  data[ji + im] = C + E;
179  data[jmi + im] = D - E;
180  }
181  }
182 }
183 
184 //------------------------------------------------------------------------------
185 
186 /* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height. */
187 static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned int N)
188 {
189  fREAL a, b;
190  unsigned int i, j, k, L, mj, mL;
191  unsigned int m = 1 << M, n = 1 << N;
192  unsigned int m2 = 1 << (M - 1), n2 = 1 << (N - 1);
193  unsigned int mn2 = m << (N - 1);
194 
195  d1[0] *= d2[0];
196  d1[mn2] *= d2[mn2];
197  d1[m2] *= d2[m2];
198  d1[m2 + mn2] *= d2[m2 + mn2];
199  for (i = 1; i < m2; i++) {
200  k = m - i;
201  a = d1[i] * d2[i] - d1[k] * d2[k];
202  b = d1[k] * d2[i] + d1[i] * d2[k];
203  d1[i] = (b + a) * (fREAL)0.5;
204  d1[k] = (b - a) * (fREAL)0.5;
205  a = d1[i + mn2] * d2[i + mn2] - d1[k + mn2] * d2[k + mn2];
206  b = d1[k + mn2] * d2[i + mn2] + d1[i + mn2] * d2[k + mn2];
207  d1[i + mn2] = (b + a) * (fREAL)0.5;
208  d1[k + mn2] = (b - a) * (fREAL)0.5;
209  }
210  for (j = 1; j < n2; j++) {
211  L = n - j;
212  mj = j << M;
213  mL = L << M;
214  a = d1[mj] * d2[mj] - d1[mL] * d2[mL];
215  b = d1[mL] * d2[mj] + d1[mj] * d2[mL];
216  d1[mj] = (b + a) * (fREAL)0.5;
217  d1[mL] = (b - a) * (fREAL)0.5;
218  a = d1[m2 + mj] * d2[m2 + mj] - d1[m2 + mL] * d2[m2 + mL];
219  b = d1[m2 + mL] * d2[m2 + mj] + d1[m2 + mj] * d2[m2 + mL];
220  d1[m2 + mj] = (b + a) * (fREAL)0.5;
221  d1[m2 + mL] = (b - a) * (fREAL)0.5;
222  }
223  for (i = 1; i < m2; i++) {
224  k = m - i;
225  for (j = 1; j < n2; j++) {
226  L = n - j;
227  mj = j << M;
228  mL = L << M;
229  a = d1[i + mj] * d2[i + mj] - d1[k + mL] * d2[k + mL];
230  b = d1[k + mL] * d2[i + mj] + d1[i + mj] * d2[k + mL];
231  d1[i + mj] = (b + a) * (fREAL)0.5;
232  d1[k + mL] = (b - a) * (fREAL)0.5;
233  a = d1[i + mL] * d2[i + mL] - d1[k + mj] * d2[k + mj];
234  b = d1[k + mj] * d2[i + mL] + d1[i + mL] * d2[k + mj];
235  d1[i + mL] = (b + a) * (fREAL)0.5;
236  d1[k + mj] = (b - a) * (fREAL)0.5;
237  }
238  }
239 }
240 //------------------------------------------------------------------------------
241 
242 static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
243 {
244  fREAL *data1, *data2, *fp;
245  unsigned int w2, h2, hw, hh, log2_w, log2_h;
246  fRGB wt, *colp;
247  int x, y, ch;
248  int xbl, ybl, nxb, nyb, xbsz, ybsz;
249  bool in2done = false;
250  const unsigned int kernel_width = in2->get_width();
251  const unsigned int kernel_height = in2->get_height();
252  const unsigned int image_width = in1->get_width();
253  const unsigned int image_height = in1->get_height();
254  float *kernel_buffer = in2->get_buffer();
255  float *image_buffer = in1->get_buffer();
256 
257  MemoryBuffer *rdst = new MemoryBuffer(DataType::Color, in1->get_rect());
258  memset(rdst->get_buffer(),
259  0,
260  rdst->get_width() * rdst->get_height() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
261 
262  /* Convolution result width & height. */
263  w2 = 2 * kernel_width - 1;
264  h2 = 2 * kernel_height - 1;
265  /* FFT pow2 required size & log2. */
266  w2 = next_pow2(w2, &log2_w);
267  h2 = next_pow2(h2, &log2_h);
268 
269  /* Allocate space. */
270  data1 = (fREAL *)MEM_callocN(3 * w2 * h2 * sizeof(fREAL), "convolve_fast FHT data1");
271  data2 = (fREAL *)MEM_callocN(w2 * h2 * sizeof(fREAL), "convolve_fast FHT data2");
272 
273  /* Normalize convolutor. */
274  wt[0] = wt[1] = wt[2] = 0.0f;
275  for (y = 0; y < kernel_height; y++) {
276  colp = (fRGB *)&kernel_buffer[y * kernel_width * COM_DATA_TYPE_COLOR_CHANNELS];
277  for (x = 0; x < kernel_width; x++) {
278  add_v3_v3(wt, colp[x]);
279  }
280  }
281  if (wt[0] != 0.0f) {
282  wt[0] = 1.0f / wt[0];
283  }
284  if (wt[1] != 0.0f) {
285  wt[1] = 1.0f / wt[1];
286  }
287  if (wt[2] != 0.0f) {
288  wt[2] = 1.0f / wt[2];
289  }
290  for (y = 0; y < kernel_height; y++) {
291  colp = (fRGB *)&kernel_buffer[y * kernel_width * COM_DATA_TYPE_COLOR_CHANNELS];
292  for (x = 0; x < kernel_width; x++) {
293  mul_v3_v3(colp[x], wt);
294  }
295  }
296 
297  /* Copy image data, unpacking interleaved RGBA into separate channels
298  * only need to calc data1 once. */
299 
300  /* Block add-overlap. */
301  hw = kernel_width >> 1;
302  hh = kernel_height >> 1;
303  xbsz = (w2 + 1) - kernel_width;
304  ybsz = (h2 + 1) - kernel_height;
305  nxb = image_width / xbsz;
306  if (image_width % xbsz) {
307  nxb++;
308  }
309  nyb = image_height / ybsz;
310  if (image_height % ybsz) {
311  nyb++;
312  }
313  for (ybl = 0; ybl < nyb; ybl++) {
314  for (xbl = 0; xbl < nxb; xbl++) {
315 
316  /* Each channel one by one. */
317  for (ch = 0; ch < 3; ch++) {
318  fREAL *data1ch = &data1[ch * w2 * h2];
319 
320  /* Only need to calc fht data from in2 once, can re-use for every block. */
321  if (!in2done) {
322  /* in2, channel ch -> data1 */
323  for (y = 0; y < kernel_height; y++) {
324  fp = &data1ch[y * w2];
325  colp = (fRGB *)&kernel_buffer[y * kernel_width * COM_DATA_TYPE_COLOR_CHANNELS];
326  for (x = 0; x < kernel_width; x++) {
327  fp[x] = colp[x][ch];
328  }
329  }
330  }
331 
332  /* in1, channel ch -> data2 */
333  memset(data2, 0, w2 * h2 * sizeof(fREAL));
334  for (y = 0; y < ybsz; y++) {
335  int yy = ybl * ybsz + y;
336  if (yy >= image_height) {
337  continue;
338  }
339  fp = &data2[y * w2];
340  colp = (fRGB *)&image_buffer[yy * image_width * COM_DATA_TYPE_COLOR_CHANNELS];
341  for (x = 0; x < xbsz; x++) {
342  int xx = xbl * xbsz + x;
343  if (xx >= image_width) {
344  continue;
345  }
346  fp[x] = colp[xx][ch];
347  }
348  }
349 
350  /* Forward FHT
351  * zero pad data start is different for each == height+1. */
352  if (!in2done) {
353  FHT2D(data1ch, log2_w, log2_h, kernel_height + 1, 0);
354  }
355  FHT2D(data2, log2_w, log2_h, kernel_height + 1, 0);
356 
357  /* FHT2D transposed data, row/col now swapped
358  * convolve & inverse FHT. */
359  fht_convolve(data2, data1ch, log2_h, log2_w);
360  FHT2D(data2, log2_h, log2_w, 0, 1);
361  /* Data again transposed, so in order again. */
362 
363  /* Overlap-add result. */
364  for (y = 0; y < (int)h2; y++) {
365  const int yy = ybl * ybsz + y - hh;
366  if ((yy < 0) || (yy >= image_height)) {
367  continue;
368  }
369  fp = &data2[y * w2];
370  colp = (fRGB *)&rdst->get_buffer()[yy * image_width * COM_DATA_TYPE_COLOR_CHANNELS];
371  for (x = 0; x < (int)w2; x++) {
372  const int xx = xbl * xbsz + x - hw;
373  if ((xx < 0) || (xx >= image_width)) {
374  continue;
375  }
376  colp[xx][ch] += fp[x];
377  }
378  }
379  }
380  in2done = true;
381  }
382  }
383 
384  MEM_freeN(data2);
385  MEM_freeN(data1);
386  memcpy(dst,
387  rdst->get_buffer(),
388  sizeof(float) * image_width * image_height * COM_DATA_TYPE_COLOR_CHANNELS);
389  delete (rdst);
390 }
391 
393  MemoryBuffer *input_tile,
394  NodeGlare *settings)
395 {
396  int x, y;
397  float scale, u, v, r, w, d;
398  fRGB fcol;
399  MemoryBuffer *ckrn;
400  unsigned int sz = 1 << settings->size;
401  const float cs_r = 1.0f, cs_g = 1.0f, cs_b = 1.0f;
402 
403  /* Temp. src image
404  * make the convolution kernel. */
405  rcti kernel_rect;
406  BLI_rcti_init(&kernel_rect, 0, sz, 0, sz);
407  ckrn = new MemoryBuffer(DataType::Color, kernel_rect);
408 
409  scale = 0.25f * sqrtf((float)(sz * sz));
410 
411  for (y = 0; y < sz; y++) {
412  v = 2.0f * (y / (float)sz) - 1.0f;
413  for (x = 0; x < sz; x++) {
414  u = 2.0f * (x / (float)sz) - 1.0f;
415  r = (u * u + v * v) * scale;
416  d = -sqrtf(sqrtf(sqrtf(r))) * 9.0f;
417  fcol[0] = expf(d * cs_r);
418  fcol[1] = expf(d * cs_g);
419  fcol[2] = expf(d * cs_b);
420  /* Linear window good enough here, visual result counts, not scientific analysis:
421  * `w = (1.0f-fabs(u))*(1.0f-fabs(v));`
422  * actually, Hanning window is ok, `cos^2` for some reason is slower. */
423  w = (0.5f + 0.5f * cosf(u * (float)M_PI)) * (0.5f + 0.5f * cosf(v * (float)M_PI));
424  mul_v3_fl(fcol, w);
425  ckrn->write_pixel(x, y, fcol);
426  }
427  }
428 
429  convolve(data, input_tile, ckrn);
430  delete ckrn;
431 }
432 
433 } // namespace blender::compositor
typedef float(TangentPoint)[2]
#define D
sqrt(x)+1/max(0
#define M_PI
Definition: BLI_math_base.h:20
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition: rct.c:417
#define SWAP(type, a, b)
typedef double(DMatrix)[4][4]
#define PRED(k)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:25
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define A
btMatrix3x3 inverse() const
Return the inverse of the matrix.
Definition: btTransform.h:182
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) override
a MemoryBuffer contains access to the data of a chunk
const rcti & get_rect() const
get the rect of this MemoryBuffer
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
#define cosf(x)
Definition: cuda/compat.h:101
#define expf(x)
Definition: cuda/compat.h:106
int len
Definition: draw_manager.c:108
static const float data2[18 *GP_PRIM_DATABUF_SIZE]
static const float data1[33 *GP_PRIM_DATABUF_SIZE]
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define M
#define N
#define B
#define L
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned a[3]
Definition: RandGen.cpp:78
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:319
static void FHT2D(fREAL *data, unsigned int Mx, unsigned int My, unsigned int nzp, unsigned int inverse)
static unsigned int next_pow2(unsigned int x, unsigned int *L2)
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
Definition: COM_defines.h:62
static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
static void FHT(fREAL *data, unsigned int M, unsigned int inverse)
static unsigned int revbin_upd(unsigned int r, unsigned int h)
static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned int N)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
char angle size