Blender  V3.3
COM_ScreenLensDistortionOperation.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
5 
7 
8 #include "BLI_rand.h"
9 
10 #include "PIL_time.h"
11 
12 namespace blender::compositor {
13 
15 {
20  flags_.complex = true;
21  input_program_ = nullptr;
22  distortion_ = 0.0f;
23  dispersion_ = 0.0f;
24  distortion_const_ = false;
25  dispersion_const_ = false;
26  variables_ready_ = false;
27 }
28 
30 {
31  distortion_ = distortion;
32  distortion_const_ = true;
33 }
34 
36 {
37  dispersion_ = dispersion;
38  dispersion_const_ = true;
39 }
40 
42 {
43  cx_ = 0.5f * (float)get_width();
44  cy_ = 0.5f * (float)get_height();
45 
46  switch (execution_model_) {
48  NodeOperation *distortion_op = get_input_operation(1);
49  NodeOperation *dispersion_op = get_input_operation(2);
50  if (!distortion_const_ && distortion_op->get_flags().is_constant_operation) {
51  distortion_ = static_cast<ConstantOperation *>(distortion_op)->get_constant_elem()[0];
52  }
53  if (!dispersion_const_ && distortion_op->get_flags().is_constant_operation) {
54  dispersion_ = static_cast<ConstantOperation *>(dispersion_op)->get_constant_elem()[0];
55  }
56  update_variables(distortion_, dispersion_);
57  break;
58  }
60  /* If both are constant, init variables once. */
61  if (distortion_const_ && dispersion_const_) {
62  update_variables(distortion_, dispersion_);
63  variables_ready_ = true;
64  }
65  break;
66  }
67  }
68 }
69 
71 {
72  input_program_ = this->get_input_socket_reader(0);
73  this->init_mutex();
74 
75  uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
76  rng_seed ^= (uint)POINTER_AS_INT(input_program_);
77  rng_ = BLI_rng_new(rng_seed);
78 }
79 
81 {
82  void *buffer = input_program_->initialize_tile_data(nullptr);
83 
84  /* get distortion/dispersion values once, by reading inputs at (0,0)
85  * XXX this assumes invariable values (no image inputs),
86  * we don't have a nice generic system for that yet
87  */
88  if (!variables_ready_) {
89  this->lock_mutex();
90 
91  if (!distortion_const_) {
92  float result[4];
94  distortion_ = result[0];
95  }
96  if (!dispersion_const_) {
97  float result[4];
99  dispersion_ = result[0];
100  }
101 
102  update_variables(distortion_, dispersion_);
103  variables_ready_ = true;
104 
105  this->unlock_mutex();
106  }
107 
108  return buffer;
109 }
110 
111 void ScreenLensDistortionOperation::get_uv(const float xy[2], float uv[2]) const
112 {
113  uv[0] = sc_ * ((xy[0] + 0.5f) - cx_) / cx_;
114  uv[1] = sc_ * ((xy[1] + 0.5f) - cy_) / cy_;
115 }
116 
117 void ScreenLensDistortionOperation::distort_uv(const float uv[2], float t, float xy[2]) const
118 {
119  float d = 1.0f / (1.0f + sqrtf(t));
120  xy[0] = (uv[0] * d + 0.5f) * get_width() - 0.5f;
121  xy[1] = (uv[1] * d + 0.5f) * get_height() - 0.5f;
122 }
123 
124 bool ScreenLensDistortionOperation::get_delta(float r_sq,
125  float k4,
126  const float uv[2],
127  float delta[2]) const
128 {
129  float t = 1.0f - k4 * r_sq;
130  if (t >= 0.0f) {
131  distort_uv(uv, t, delta);
132  return true;
133  }
134 
135  return false;
136 }
137 
138 void ScreenLensDistortionOperation::accumulate(const MemoryBuffer *buffer,
139  int a,
140  int b,
141  float r_sq,
142  const float uv[2],
143  const float delta[3][2],
144  float sum[4],
145  int count[3]) const
146 {
147  float color[4];
148 
149  float dsf = len_v2v2(delta[a], delta[b]) + 1.0f;
150  int ds = jitter_ ? (dsf < 4.0f ? 2 : (int)sqrtf(dsf)) : (int)dsf;
151  float sd = 1.0f / (float)ds;
152 
153  float k4 = k4_[a];
154  float dk4 = dk4_[a];
155 
156  for (float z = 0; z < ds; z++) {
157  float tz = (z + (jitter_ ? BLI_rng_get_float(rng_) : 0.5f)) * sd;
158  float t = 1.0f - (k4 + tz * dk4) * r_sq;
159 
160  float xy[2];
161  distort_uv(uv, t, xy);
162  switch (execution_model_) {
164  buffer->read_bilinear(color, xy[0], xy[1]);
165  break;
167  buffer->read_elem_bilinear(xy[0], xy[1], color);
168  break;
169  }
170 
171  sum[a] += (1.0f - tz) * color[a];
172  sum[b] += (tz)*color[b];
173  count[a]++;
174  count[b]++;
175  }
176 }
177 
179 {
181  float xy[2] = {(float)x, (float)y};
182  float uv[2];
183  get_uv(xy, uv);
184  float uv_dot = len_squared_v2(uv);
185 
186  int count[3] = {0, 0, 0};
187  float delta[3][2];
188  float sum[4] = {0, 0, 0, 0};
189 
190  bool valid_r = get_delta(uv_dot, k4_[0], uv, delta[0]);
191  bool valid_g = get_delta(uv_dot, k4_[1], uv, delta[1]);
192  bool valid_b = get_delta(uv_dot, k4_[2], uv, delta[2]);
193 
194  if (valid_r && valid_g && valid_b) {
195  accumulate(buffer, 0, 1, uv_dot, uv, delta, sum, count);
196  accumulate(buffer, 1, 2, uv_dot, uv, delta, sum, count);
197 
198  if (count[0]) {
199  output[0] = 2.0f * sum[0] / (float)count[0];
200  }
201  if (count[1]) {
202  output[1] = 2.0f * sum[1] / (float)count[1];
203  }
204  if (count[2]) {
205  output[2] = 2.0f * sum[2] / (float)count[2];
206  }
207 
208  /* set alpha */
209  output[3] = 1.0f;
210  }
211  else {
212  zero_v4(output);
213  }
214 }
215 
217 {
218  this->deinit_mutex();
219  input_program_ = nullptr;
220  BLI_rng_free(rng_);
221 }
222 
223 void ScreenLensDistortionOperation::determineUV(float result[6], float x, float y) const
224 {
225  const float xy[2] = {x, y};
226  float uv[2];
227  get_uv(xy, uv);
228  float uv_dot = len_squared_v2(uv);
229 
230  copy_v2_v2(result + 0, xy);
231  copy_v2_v2(result + 2, xy);
232  copy_v2_v2(result + 4, xy);
233  get_delta(uv_dot, k4_[0], uv, result + 0);
234  get_delta(uv_dot, k4_[1], uv, result + 2);
235  get_delta(uv_dot, k4_[2], uv, result + 4);
236 }
237 
239  rcti * /*input*/, ReadBufferOperation *read_operation, rcti *output)
240 {
241  rcti new_input_value;
242  new_input_value.xmin = 0;
243  new_input_value.ymin = 0;
244  new_input_value.xmax = 2;
245  new_input_value.ymax = 2;
246 
247  NodeOperation *operation = get_input_operation(1);
248  if (operation->determine_depending_area_of_interest(&new_input_value, read_operation, output)) {
249  return true;
250  }
251 
252  operation = get_input_operation(2);
253  if (operation->determine_depending_area_of_interest(&new_input_value, read_operation, output)) {
254  return true;
255  }
256 
257  /* XXX the original method of estimating the area-of-interest does not work
258  * it assumes a linear increase/decrease of mapped coordinates, which does not
259  * yield correct results for the area and leaves uninitialized buffer areas.
260  * So now just use the full image area, which may not be as efficient but works at least ...
261  */
262 #if 1
263  rcti image_input;
264 
265  operation = get_input_operation(0);
266  image_input.xmax = operation->get_width();
267  image_input.xmin = 0;
268  image_input.ymax = operation->get_height();
269  image_input.ymin = 0;
270 
271  if (operation->determine_depending_area_of_interest(&image_input, read_operation, output)) {
272  return true;
273  }
274  return false;
275 #else
276  rcti new_input;
277  const float margin = 2;
278 
279  BLI_rcti_init_minmax(&new_input);
280 
281  if (dispersion_const_ && distortion_const_) {
282  /* update from fixed distortion/dispersion */
283 # define UPDATE_INPUT(x, y) \
284  { \
285  float coords[6]; \
286  determineUV(coords, x, y); \
287  new_input.xmin = min_ffff(new_input.xmin, coords[0], coords[2], coords[4]); \
288  new_input.ymin = min_ffff(new_input.ymin, coords[1], coords[3], coords[5]); \
289  new_input.xmax = max_ffff(new_input.xmax, coords[0], coords[2], coords[4]); \
290  new_input.ymax = max_ffff(new_input.ymax, coords[1], coords[3], coords[5]); \
291  } \
292  (void)0
293 
294  UPDATE_INPUT(input->xmin, input->xmax);
295  UPDATE_INPUT(input->xmin, input->ymax);
296  UPDATE_INPUT(input->xmax, input->ymax);
297  UPDATE_INPUT(input->xmax, input->ymin);
298 
299 # undef UPDATE_INPUT
300  }
301  else {
302  /* use maximum dispersion 1.0 if not const */
303  float dispersion = dispersion_const_ ? dispersion_ : 1.0f;
304 
305 # define UPDATE_INPUT(x, y, distortion) \
306  { \
307  float coords[6]; \
308  update_variables(distortion, dispersion); \
309  determineUV(coords, x, y); \
310  new_input.xmin = min_ffff(new_input.xmin, coords[0], coords[2], coords[4]); \
311  new_input.ymin = min_ffff(new_input.ymin, coords[1], coords[3], coords[5]); \
312  new_input.xmax = max_ffff(new_input.xmax, coords[0], coords[2], coords[4]); \
313  new_input.ymax = max_ffff(new_input.ymax, coords[1], coords[3], coords[5]); \
314  } \
315  (void)0
316 
317  if (distortion_const_) {
318  /* update from fixed distortion */
319  UPDATE_INPUT(input->xmin, input->xmax, distortion_);
320  UPDATE_INPUT(input->xmin, input->ymax, distortion_);
321  UPDATE_INPUT(input->xmax, input->ymax, distortion_);
322  UPDATE_INPUT(input->xmax, input->ymin, distortion_);
323  }
324  else {
325  /* update from min/max distortion (-1..1) */
326  UPDATE_INPUT(input->xmin, input->xmax, -1.0f);
327  UPDATE_INPUT(input->xmin, input->ymax, -1.0f);
328  UPDATE_INPUT(input->xmax, input->ymax, -1.0f);
329  UPDATE_INPUT(input->xmax, input->ymin, -1.0f);
330 
331  UPDATE_INPUT(input->xmin, input->xmax, 1.0f);
332  UPDATE_INPUT(input->xmin, input->ymax, 1.0f);
333  UPDATE_INPUT(input->xmax, input->ymax, 1.0f);
334  UPDATE_INPUT(input->xmax, input->ymin, 1.0f);
335 
336 # undef UPDATE_INPUT
337  }
338  }
339 
340  new_input.xmin -= margin;
341  new_input.ymin -= margin;
342  new_input.xmax += margin;
343  new_input.ymax += margin;
344 
345  operation = get_input_operation(0);
346  if (operation->determine_depending_area_of_interest(&new_input, read_operation, output)) {
347  return true;
348  }
349  return false;
350 #endif
351 }
352 
353 void ScreenLensDistortionOperation::update_variables(float distortion, float dispersion)
354 {
355  k_[1] = max_ff(min_ff(distortion, 1.0f), -0.999f);
356  /* Smaller dispersion range for somewhat more control. */
357  float d = 0.25f * max_ff(min_ff(dispersion, 1.0f), 0.0f);
358  k_[0] = max_ff(min_ff((k_[1] + d), 1.0f), -0.999f);
359  k_[2] = max_ff(min_ff((k_[1] - d), 1.0f), -0.999f);
360  maxk_ = max_fff(k_[0], k_[1], k_[2]);
361  sc_ = (fit_ && (maxk_ > 0.0f)) ? (1.0f / (1.0f + 2.0f * maxk_)) : (1.0f / (1.0f + maxk_));
362  dk4_[0] = 4.0f * (k_[1] - k_[0]);
363  dk4_[1] = 4.0f * (k_[2] - k_[1]);
364  dk4_[2] = 0.0f; /* unused */
365 
366  mul_v3_v3fl(k4_, k_, 4.0f);
367 }
368 
369 void ScreenLensDistortionOperation::determine_canvas(const rcti &preferred_area, rcti &r_area)
370 {
371  switch (execution_model_) {
373  set_determined_canvas_modifier([=](rcti &canvas) {
374  /* Ensure screen space. */
375  BLI_rcti_translate(&canvas, -canvas.xmin, -canvas.ymin);
376  });
377  break;
378  }
379  default:
380  break;
381  }
382 
383  NodeOperation::determine_canvas(preferred_area, r_area);
384 }
385 
387  const rcti &UNUSED(output_area),
388  rcti &r_input_area)
389 {
390  if (input_idx != 0) {
391  /* Dispersion and distortion inputs are used as constants only. */
393  }
394 
395  /* XXX the original method of estimating the area-of-interest does not work
396  * it assumes a linear increase/decrease of mapped coordinates, which does not
397  * yield correct results for the area and leaves uninitialized buffer areas.
398  * So now just use the full image area, which may not be as efficient but works at least ...
399  */
400 #if 1
402  r_input_area = image->get_canvas();
403 
404 #else /* Original method in tiled implementation. */
405  rcti new_input;
406  const float margin = 2;
407 
408  BLI_rcti_init_minmax(&new_input);
409 
410  if (dispersion_const_ && distortion_const_) {
411  /* update from fixed distortion/dispersion */
412 # define UPDATE_INPUT(x, y) \
413  { \
414  float coords[6]; \
415  determineUV(coords, x, y); \
416  new_input.xmin = min_ffff(new_input.xmin, coords[0], coords[2], coords[4]); \
417  new_input.ymin = min_ffff(new_input.ymin, coords[1], coords[3], coords[5]); \
418  new_input.xmax = max_ffff(new_input.xmax, coords[0], coords[2], coords[4]); \
419  new_input.ymax = max_ffff(new_input.ymax, coords[1], coords[3], coords[5]); \
420  } \
421  (void)0
422 
423  UPDATE_INPUT(input->xmin, input->xmax);
424  UPDATE_INPUT(input->xmin, input->ymax);
425  UPDATE_INPUT(input->xmax, input->ymax);
426  UPDATE_INPUT(input->xmax, input->ymin);
427 
428 # undef UPDATE_INPUT
429  }
430  else {
431  /* use maximum dispersion 1.0 if not const */
432  float dispersion = dispersion_const_ ? dispersion_ : 1.0f;
433 
434 # define UPDATE_INPUT(x, y, distortion) \
435  { \
436  float coords[6]; \
437  update_variables(distortion, dispersion); \
438  determineUV(coords, x, y); \
439  new_input.xmin = min_ffff(new_input.xmin, coords[0], coords[2], coords[4]); \
440  new_input.ymin = min_ffff(new_input.ymin, coords[1], coords[3], coords[5]); \
441  new_input.xmax = max_ffff(new_input.xmax, coords[0], coords[2], coords[4]); \
442  new_input.ymax = max_ffff(new_input.ymax, coords[1], coords[3], coords[5]); \
443  } \
444  (void)0
445 
446  if (distortion_const_) {
447  /* update from fixed distortion */
448  UPDATE_INPUT(input->xmin, input->xmax, distortion_);
449  UPDATE_INPUT(input->xmin, input->ymax, distortion_);
450  UPDATE_INPUT(input->xmax, input->ymax, distortion_);
451  UPDATE_INPUT(input->xmax, input->ymin, distortion_);
452  }
453  else {
454  /* update from min/max distortion (-1..1) */
455  UPDATE_INPUT(input->xmin, input->xmax, -1.0f);
456  UPDATE_INPUT(input->xmin, input->ymax, -1.0f);
457  UPDATE_INPUT(input->xmax, input->ymax, -1.0f);
458  UPDATE_INPUT(input->xmax, input->ymin, -1.0f);
459 
460  UPDATE_INPUT(input->xmin, input->xmax, 1.0f);
461  UPDATE_INPUT(input->xmin, input->ymax, 1.0f);
462  UPDATE_INPUT(input->xmax, input->ymax, 1.0f);
463  UPDATE_INPUT(input->xmax, input->ymin, 1.0f);
464 
465 # undef UPDATE_INPUT
466  }
467  }
468 
469  new_input.xmin -= margin;
470  new_input.ymin -= margin;
471  new_input.xmax += margin;
472  new_input.ymax += margin;
473 
474  operation = get_input_operation(0);
475  if (operation->determine_depending_area_of_interest(&new_input, read_operation, output)) {
476  return true;
477  }
478  return false;
479 #endif
480 }
481 
483  const rcti &area,
485 {
486  const MemoryBuffer *input_image = inputs[0];
487  for (BuffersIterator<float> it = output->iterate_with({}, area); !it.is_end(); ++it) {
488  float xy[2] = {(float)it.x, (float)it.y};
489  float uv[2];
490  get_uv(xy, uv);
491  const float uv_dot = len_squared_v2(uv);
492 
493  float delta[3][2];
494  const bool valid_r = get_delta(uv_dot, k4_[0], uv, delta[0]);
495  const bool valid_g = get_delta(uv_dot, k4_[1], uv, delta[1]);
496  const bool valid_b = get_delta(uv_dot, k4_[2], uv, delta[2]);
497  if (!(valid_r && valid_g && valid_b)) {
498  zero_v4(it.out);
499  continue;
500  }
501 
502  int count[3] = {0, 0, 0};
503  float sum[4] = {0, 0, 0, 0};
504  accumulate(input_image, 0, 1, uv_dot, uv, delta, sum, count);
505  accumulate(input_image, 1, 2, uv_dot, uv, delta, sum, count);
506 
507  if (count[0]) {
508  it.out[0] = 2.0f * sum[0] / (float)count[0];
509  }
510  if (count[1]) {
511  it.out[1] = 2.0f * sum[1] / (float)count[1];
512  }
513  if (count[2]) {
514  it.out[2] = 2.0f * sum[2] / (float)count[2];
515  }
516 
517  /* Set alpha. */
518  it.out[3] = 1.0f;
519  }
520 }
521 
522 } // namespace blender::compositor
typedef float(TangentPoint)[2]
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void zero_v4(float r[4])
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
Random number functions.
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
Definition: rand.cc:58
struct RNG * BLI_rng_new(unsigned int seed)
Definition: rand.cc:39
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition: rand.cc:93
void BLI_rcti_init_minmax(struct rcti *rect)
Definition: rct.c:477
void BLI_rcti_translate(struct rcti *rect, int x, int y)
Definition: rct.c:559
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED(x)
#define POINTER_AS_INT(i)
_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 z
_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
_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 t
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
Platform independent time functions.
static T sum(const btAlignedObjectArray< T > &items)
a MemoryBuffer contains access to the data of a chunk
NodeOperation contains calculation logic.
void add_output_socket(DataType datatype)
const NodeOperationFlags get_flags() const
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperation * get_input_operation(int index)
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void set_determined_canvas_modifier(std::function< void(rcti &canvas)> fn)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
virtual void * initialize_tile_data(rcti *)
virtual void determine_canvas(const rcti &preferred_area, rcti &r_area)
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void execute_pixel(float output[4], int x, int y, void *data) override
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
#define UINT_MAX
Definition: hash_md5.c:43
int count
ccl_global float * buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned a[3]
Definition: RandGen.cpp:78
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
constexpr rcti COM_CONSTANT_INPUT_AREA_OF_INTEREST
Definition: COM_defines.h:113
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static bNodeSocketTemplate inputs[]
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
long int PIL_check_seconds_timer_i(void)
Definition: time.c:74
int xy[2]
Definition: wm_draw.c:135