Blender  V2.93
COM_MathBaseOperation.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2011, Blender Foundation.
17  */
18 
19 #include "COM_MathBaseOperation.h"
20 
21 #include "BLI_math.h"
22 
23 namespace blender::compositor {
24 
26 {
31  this->m_inputValue1Operation = nullptr;
32  this->m_inputValue2Operation = nullptr;
33  this->m_inputValue3Operation = nullptr;
34  this->m_useClamp = false;
35 }
36 
38 {
42 }
43 
45 {
46  this->m_inputValue1Operation = nullptr;
47  this->m_inputValue2Operation = nullptr;
48  this->m_inputValue3Operation = nullptr;
49 }
50 
51 void MathBaseOperation::determineResolution(unsigned int resolution[2],
52  unsigned int preferredResolution[2])
53 {
54  NodeOperationInput *socket;
55  unsigned int tempPreferredResolution[2] = {0, 0};
56  unsigned int tempResolution[2];
57 
58  socket = this->getInputSocket(0);
59  socket->determineResolution(tempResolution, tempPreferredResolution);
60  if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
62  }
63  else {
65  }
66  NodeOperation::determineResolution(resolution, preferredResolution);
67 }
68 
70 {
71  if (this->m_useClamp) {
72  CLAMP(color[0], 0.0f, 1.0f);
73  }
74 }
75 
76 void MathAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
77 {
78  float inputValue1[4];
79  float inputValue2[4];
80 
81  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
82  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
83 
84  output[0] = inputValue1[0] + inputValue2[0];
85 
87 }
88 
90  float x,
91  float y,
92  PixelSampler sampler)
93 {
94  float inputValue1[4];
95  float inputValue2[4];
96 
97  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
98  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
99 
100  output[0] = inputValue1[0] - inputValue2[0];
101 
103 }
104 
106  float x,
107  float y,
108  PixelSampler sampler)
109 {
110  float inputValue1[4];
111  float inputValue2[4];
112 
113  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
114  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
115 
116  output[0] = inputValue1[0] * inputValue2[0];
117 
119 }
120 
122  float x,
123  float y,
124  PixelSampler sampler)
125 {
126  float inputValue1[4];
127  float inputValue2[4];
128 
129  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
130  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
131 
132  if (inputValue2[0] == 0) { /* We don't want to divide by zero. */
133  output[0] = 0.0;
134  }
135  else {
136  output[0] = inputValue1[0] / inputValue2[0];
137  }
138 
140 }
141 
143  float x,
144  float y,
145  PixelSampler sampler)
146 {
147  float inputValue1[4];
148  float inputValue2[4];
149 
150  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
151  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
152 
153  output[0] = sin(inputValue1[0]);
154 
156 }
157 
159  float x,
160  float y,
161  PixelSampler sampler)
162 {
163  float inputValue1[4];
164  float inputValue2[4];
165 
166  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
167  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
168 
169  output[0] = cos(inputValue1[0]);
170 
172 }
173 
175  float x,
176  float y,
177  PixelSampler sampler)
178 {
179  float inputValue1[4];
180  float inputValue2[4];
181 
182  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
183  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
184 
185  output[0] = tan(inputValue1[0]);
186 
188 }
189 
191  float x,
192  float y,
193  PixelSampler sampler)
194 {
195  float inputValue1[4];
196  float inputValue2[4];
197 
198  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
199  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
200 
201  output[0] = sinh(inputValue1[0]);
202 
204 }
205 
207  float x,
208  float y,
209  PixelSampler sampler)
210 {
211  float inputValue1[4];
212  float inputValue2[4];
213 
214  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
215  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
216 
217  output[0] = cosh(inputValue1[0]);
218 
220 }
221 
223  float x,
224  float y,
225  PixelSampler sampler)
226 {
227  float inputValue1[4];
228  float inputValue2[4];
229 
230  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
231  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
232 
233  output[0] = tanh(inputValue1[0]);
234 
236 }
237 
239  float x,
240  float y,
241  PixelSampler sampler)
242 {
243  float inputValue1[4];
244  float inputValue2[4];
245 
246  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
247  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
248 
249  if (inputValue1[0] <= 1 && inputValue1[0] >= -1) {
250  output[0] = asin(inputValue1[0]);
251  }
252  else {
253  output[0] = 0.0;
254  }
255 
257 }
258 
260  float x,
261  float y,
262  PixelSampler sampler)
263 {
264  float inputValue1[4];
265  float inputValue2[4];
266 
267  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
268  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
269 
270  if (inputValue1[0] <= 1 && inputValue1[0] >= -1) {
271  output[0] = acos(inputValue1[0]);
272  }
273  else {
274  output[0] = 0.0;
275  }
276 
278 }
279 
281  float x,
282  float y,
283  PixelSampler sampler)
284 {
285  float inputValue1[4];
286  float inputValue2[4];
287 
288  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
289  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
290 
291  output[0] = atan(inputValue1[0]);
292 
294 }
295 
297  float x,
298  float y,
299  PixelSampler sampler)
300 {
301  float inputValue1[4];
302  float inputValue2[4];
303 
304  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
305  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
306 
307  if (inputValue1[0] >= 0) {
308  output[0] = pow(inputValue1[0], inputValue2[0]);
309  }
310  else {
311  float y_mod_1 = fmod(inputValue2[0], 1);
312  /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
313  if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
314  output[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f));
315  }
316  else {
317  output[0] = 0.0;
318  }
319  }
320 
322 }
323 
325  float x,
326  float y,
327  PixelSampler sampler)
328 {
329  float inputValue1[4];
330  float inputValue2[4];
331 
332  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
333  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
334 
335  if (inputValue1[0] > 0 && inputValue2[0] > 0) {
336  output[0] = log(inputValue1[0]) / log(inputValue2[0]);
337  }
338  else {
339  output[0] = 0.0;
340  }
341 
343 }
344 
346  float x,
347  float y,
348  PixelSampler sampler)
349 {
350  float inputValue1[4];
351  float inputValue2[4];
352 
353  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
354  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
355 
356  output[0] = MIN2(inputValue1[0], inputValue2[0]);
357 
359 }
360 
362  float x,
363  float y,
364  PixelSampler sampler)
365 {
366  float inputValue1[4];
367  float inputValue2[4];
368 
369  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
370  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
371 
372  output[0] = MAX2(inputValue1[0], inputValue2[0]);
373 
375 }
376 
378  float x,
379  float y,
380  PixelSampler sampler)
381 {
382  float inputValue1[4];
383  float inputValue2[4];
384 
385  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
386  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
387 
388  output[0] = round(inputValue1[0]);
389 
391 }
392 
394  float x,
395  float y,
396  PixelSampler sampler)
397 {
398  float inputValue1[4];
399  float inputValue2[4];
400 
401  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
402  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
403 
404  output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
405 
407 }
408 
410  float x,
411  float y,
412  PixelSampler sampler)
413 {
414  float inputValue1[4];
415  float inputValue2[4];
416 
417  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
418  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
419 
420  output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
421 
423 }
424 
426  float x,
427  float y,
428  PixelSampler sampler)
429 {
430  float inputValue1[4];
431  float inputValue2[4];
432 
433  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
434  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
435 
436  if (inputValue2[0] == 0) {
437  output[0] = 0.0;
438  }
439  else {
440  output[0] = fmod(inputValue1[0], inputValue2[0]);
441  }
442 
444 }
445 
447  float x,
448  float y,
449  PixelSampler sampler)
450 {
451  float inputValue1[4];
452 
453  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
454 
455  output[0] = fabs(inputValue1[0]);
456 
458 }
459 
461  float x,
462  float y,
463  PixelSampler sampler)
464 {
465  float inputValue1[4];
466 
467  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
468 
469  output[0] = DEG2RADF(inputValue1[0]);
470 
472 }
473 
475  float x,
476  float y,
477  PixelSampler sampler)
478 {
479  float inputValue1[4];
480 
481  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
482 
483  output[0] = RAD2DEGF(inputValue1[0]);
484 
486 }
487 
489  float x,
490  float y,
491  PixelSampler sampler)
492 {
493  float inputValue1[4];
494  float inputValue2[4];
495 
496  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
497  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
498 
499  output[0] = atan2(inputValue1[0], inputValue2[0]);
500 
502 }
503 
505  float x,
506  float y,
507  PixelSampler sampler)
508 {
509  float inputValue1[4];
510 
511  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
512 
513  output[0] = floor(inputValue1[0]);
514 
516 }
517 
519  float x,
520  float y,
521  PixelSampler sampler)
522 {
523  float inputValue1[4];
524 
525  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
526 
527  output[0] = ceil(inputValue1[0]);
528 
530 }
531 
533  float x,
534  float y,
535  PixelSampler sampler)
536 {
537  float inputValue1[4];
538 
539  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
540 
541  output[0] = inputValue1[0] - floor(inputValue1[0]);
542 
544 }
545 
547  float x,
548  float y,
549  PixelSampler sampler)
550 {
551  float inputValue1[4];
552 
553  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
554 
555  if (inputValue1[0] > 0) {
556  output[0] = sqrt(inputValue1[0]);
557  }
558  else {
559  output[0] = 0.0f;
560  }
561 
563 }
564 
566  float x,
567  float y,
568  PixelSampler sampler)
569 {
570  float inputValue1[4];
571 
572  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
573 
574  if (inputValue1[0] > 0) {
575  output[0] = 1.0f / sqrt(inputValue1[0]);
576  }
577  else {
578  output[0] = 0.0f;
579  }
580 
582 }
583 
585  float x,
586  float y,
587  PixelSampler sampler)
588 {
589  float inputValue1[4];
590 
591  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
592 
593  output[0] = compatible_signf(inputValue1[0]);
594 
596 }
597 
599  float x,
600  float y,
601  PixelSampler sampler)
602 {
603  float inputValue1[4];
604 
605  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
606 
607  output[0] = expf(inputValue1[0]);
608 
610 }
611 
613  float x,
614  float y,
615  PixelSampler sampler)
616 {
617  float inputValue1[4];
618 
619  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
620 
621  output[0] = (inputValue1[0] >= 0.0f) ? floor(inputValue1[0]) : ceil(inputValue1[0]);
622 
624 }
625 
627  float x,
628  float y,
629  PixelSampler sampler)
630 {
631  float inputValue1[4];
632  float inputValue2[4];
633 
634  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
635  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
636 
637  if (inputValue1[0] == 0 || inputValue2[0] == 0) { /* We don't want to divide by zero. */
638  output[0] = 0.0f;
639  }
640  else {
641  output[0] = floorf(inputValue1[0] / inputValue2[0]) * inputValue2[0];
642  }
643 
645 }
646 
648  float x,
649  float y,
650  PixelSampler sampler)
651 {
652  float inputValue1[4];
653  float inputValue2[4];
654  float inputValue3[4];
655 
656  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
657  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
658  this->m_inputValue3Operation->readSampled(inputValue3, x, y, sampler);
659 
660  output[0] = wrapf(inputValue1[0], inputValue2[0], inputValue3[0]);
661 
663 }
664 
666  float x,
667  float y,
668  PixelSampler sampler)
669 {
670  float inputValue1[4];
671  float inputValue2[4];
672 
673  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
674  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
675 
676  output[0] = pingpongf(inputValue1[0], inputValue2[0]);
677 
679 }
680 
682  float x,
683  float y,
684  PixelSampler sampler)
685 {
686  float inputValue1[4];
687  float inputValue2[4];
688  float inputValue3[4];
689 
690  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
691  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
692  this->m_inputValue3Operation->readSampled(inputValue3, x, y, sampler);
693 
694  output[0] = (fabsf(inputValue1[0] - inputValue2[0]) <= MAX2(inputValue3[0], 1e-5f)) ? 1.0f :
695  0.0f;
696 
698 }
699 
701  float x,
702  float y,
703  PixelSampler sampler)
704 {
705  float inputValue1[4];
706  float inputValue2[4];
707  float inputValue3[4];
708 
709  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
710  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
711  this->m_inputValue3Operation->readSampled(inputValue3, x, y, sampler);
712 
713  output[0] = inputValue1[0] * inputValue2[0] + inputValue3[0];
714 
716 }
717 
719  float x,
720  float y,
721  PixelSampler sampler)
722 {
723  float inputValue1[4];
724  float inputValue2[4];
725  float inputValue3[4];
726 
727  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
728  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
729  this->m_inputValue3Operation->readSampled(inputValue3, x, y, sampler);
730 
731  output[0] = smoothminf(inputValue1[0], inputValue2[0], inputValue3[0]);
732 
734 }
735 
737  float x,
738  float y,
739  PixelSampler sampler)
740 {
741  float inputValue1[4];
742  float inputValue2[4];
743  float inputValue3[4];
744 
745  this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
746  this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
747  this->m_inputValue3Operation->readSampled(inputValue3, x, y, sampler);
748 
749  output[0] = -smoothminf(-inputValue1[0], -inputValue2[0], inputValue3[0]);
750 
752 }
753 
754 } // namespace blender::compositor
sqrt(x)+1/max(0
#define DEG2RADF(_deg)
#define RAD2DEGF(_rad)
#define MAX2(a, b)
#define MIN2(a, b)
_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
Group RGB to Bright Vector Camera CLAMP
#define output
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
void readSampled(float result[4], float x, float y, PixelSampler sampler)
NodeOperationInput * getInputSocket(unsigned int index)
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void addOutputSocket(DataType datatype)
void setResolutionInputSocketIndex(unsigned int index)
set the index of the input socket that will determine the resolution of this operation
virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
determine the resolution of this node
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
#define expf(x)
#define floorf(x)
#define fabsf(x)
MINLINE float smoothminf(float a, float b, float c)
MINLINE float pingpongf(float value, float scale)
MINLINE float compatible_signf(float f)
MINLINE float wrapf(float value, float max, float min)
INLINE Rall1d< T, V, S > sinh(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:335
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:319
INLINE Rall1d< T, V, S > cosh(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:343
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
Definition: rall1d.h:359
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:303
INLINE Rall1d< T, V, S > tanh(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:422
INLINE Rall1d< T, V, S > asin(const Rall1d< T, V, S > &x)
Definition: rall1d.h:391
INLINE Rall1d< T, V, S > atan(const Rall1d< T, V, S > &x)
Definition: rall1d.h:375
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
Definition: rall1d.h:399
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:311
INLINE Rall1d< T, V, S > tan(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:327
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
Definition: rall1d.h:429
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float2 fabs(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)