Blender  V3.3
COM_MathBaseOperation.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 
9 {
10  /* TODO(manzanilla): after removing tiled implementation, template this class to only add needed
11  * number of inputs. */
16  input_value1_operation_ = nullptr;
17  input_value2_operation_ = nullptr;
18  input_value3_operation_ = nullptr;
19  use_clamp_ = false;
20  flags_.can_be_constant = true;
21 }
22 
24 {
28 }
29 
31 {
32  input_value1_operation_ = nullptr;
33  input_value2_operation_ = nullptr;
34  input_value3_operation_ = nullptr;
35 }
36 
37 void MathBaseOperation::determine_canvas(const rcti &preferred_area, rcti &r_area)
38 {
39  NodeOperationInput *socket;
40  rcti temp_area = COM_AREA_NONE;
41  socket = this->get_input_socket(0);
42  const bool determined = socket->determine_canvas(COM_AREA_NONE, temp_area);
43  if (determined) {
44  this->set_canvas_input_index(0);
45  }
46  else {
47  this->set_canvas_input_index(1);
48  }
49  NodeOperation::determine_canvas(preferred_area, r_area);
50 }
51 
53 {
54  if (use_clamp_) {
55  CLAMP(color[0], 0.0f, 1.0f);
56  }
57 }
58 
60  const rcti &area,
62 {
63  BuffersIterator<float> it = output->iterate_with(inputs, area);
65 }
66 
68  float x,
69  float y,
71 {
72  float input_value1[4];
73  float input_value2[4];
74 
77 
78  output[0] = input_value1[0] + input_value2[0];
79 
81 }
82 
84  float x,
85  float y,
87 {
88  float input_value1[4];
89  float input_value2[4];
90 
93 
94  output[0] = input_value1[0] - input_value2[0];
95 
97 }
98 
100  float x,
101  float y,
103 {
104  float input_value1[4];
105  float input_value2[4];
106 
107  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
108  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
109 
110  output[0] = input_value1[0] * input_value2[0];
111 
113 }
114 
116  float x,
117  float y,
119 {
120  float input_value1[4];
121  float input_value2[4];
122 
123  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
124  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
125 
126  if (input_value2[0] == 0) { /* We don't want to divide by zero. */
127  output[0] = 0.0;
128  }
129  else {
130  output[0] = input_value1[0] / input_value2[0];
131  }
132 
134 }
135 
137 {
138  for (; !it.is_end(); ++it) {
139  const float divisor = *it.in(1);
140  *it.out = clamp_when_enabled((divisor == 0) ? 0 : *it.in(0) / divisor);
141  }
142 }
143 
145  float x,
146  float y,
148 {
149  float input_value1[4];
150  float input_value2[4];
151 
152  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
153  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
154 
155  output[0] = sin(input_value1[0]);
156 
158 }
159 
161 {
162  for (; !it.is_end(); ++it) {
163  *it.out = sin(*it.in(0));
164  clamp_when_enabled(it.out);
165  }
166 }
167 
169  float x,
170  float y,
172 {
173  float input_value1[4];
174  float input_value2[4];
175 
176  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
177  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
178 
179  output[0] = cos(input_value1[0]);
180 
182 }
183 
185 {
186  for (; !it.is_end(); ++it) {
187  *it.out = cos(*it.in(0));
188  clamp_when_enabled(it.out);
189  }
190 }
191 
193  float x,
194  float y,
196 {
197  float input_value1[4];
198  float input_value2[4];
199 
200  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
201  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
202 
203  output[0] = tan(input_value1[0]);
204 
206 }
207 
209 {
210  for (; !it.is_end(); ++it) {
211  *it.out = tan(*it.in(0));
212  clamp_when_enabled(it.out);
213  }
214 }
215 
217  float x,
218  float y,
220 {
221  float input_value1[4];
222  float input_value2[4];
223 
224  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
225  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
226 
227  output[0] = sinh(input_value1[0]);
228 
230 }
231 
233 {
234  for (; !it.is_end(); ++it) {
235  *it.out = sinh(*it.in(0));
236  clamp_when_enabled(it.out);
237  }
238 }
239 
241  float x,
242  float y,
244 {
245  float input_value1[4];
246  float input_value2[4];
247 
248  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
249  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
250 
251  output[0] = cosh(input_value1[0]);
252 
254 }
255 
257 {
258  for (; !it.is_end(); ++it) {
259  *it.out = cosh(*it.in(0));
260  clamp_when_enabled(it.out);
261  }
262 }
263 
265  float x,
266  float y,
268 {
269  float input_value1[4];
270  float input_value2[4];
271 
272  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
273  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
274 
275  output[0] = tanh(input_value1[0]);
276 
278 }
279 
281 {
282  for (; !it.is_end(); ++it) {
283  *it.out = tanh(*it.in(0));
284  clamp_when_enabled(it.out);
285  }
286 }
287 
289  float x,
290  float y,
292 {
293  float input_value1[4];
294  float input_value2[4];
295 
296  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
297  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
298 
299  if (input_value1[0] <= 1 && input_value1[0] >= -1) {
300  output[0] = asin(input_value1[0]);
301  }
302  else {
303  output[0] = 0.0;
304  }
305 
307 }
308 
310 {
311  for (; !it.is_end(); ++it) {
312  float value1 = *it.in(0);
313  *it.out = clamp_when_enabled((value1 <= 1 && value1 >= -1) ? asin(value1) : 0.0f);
314  }
315 }
316 
318  float x,
319  float y,
321 {
322  float input_value1[4];
323  float input_value2[4];
324 
325  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
326  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
327 
328  if (input_value1[0] <= 1 && input_value1[0] >= -1) {
329  output[0] = acos(input_value1[0]);
330  }
331  else {
332  output[0] = 0.0;
333  }
334 
336 }
337 
339 {
340  for (; !it.is_end(); ++it) {
341  float value1 = *it.in(0);
342  *it.out = clamp_when_enabled((value1 <= 1 && value1 >= -1) ? acos(value1) : 0.0f);
343  }
344 }
345 
347  float x,
348  float y,
350 {
351  float input_value1[4];
352  float input_value2[4];
353 
354  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
355  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
356 
357  output[0] = atan(input_value1[0]);
358 
360 }
361 
363 {
364  for (; !it.is_end(); ++it) {
365  *it.out = atan(*it.in(0));
366  clamp_when_enabled(it.out);
367  }
368 }
369 
371  float x,
372  float y,
374 {
375  float input_value1[4];
376  float input_value2[4];
377 
378  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
379  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
380 
381  if (input_value1[0] >= 0) {
382  output[0] = pow(input_value1[0], input_value2[0]);
383  }
384  else {
385  float y_mod_1 = fmod(input_value2[0], 1);
386  /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
387  if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
388  output[0] = pow(input_value1[0], floorf(input_value2[0] + 0.5f));
389  }
390  else {
391  output[0] = 0.0;
392  }
393  }
394 
396 }
397 
399 {
400  for (; !it.is_end(); ++it) {
401  const float value1 = *it.in(0);
402  const float value2 = *it.in(1);
403  if (value1 >= 0) {
404  *it.out = pow(value1, value2);
405  }
406  else {
407  const float y_mod_1 = fmod(value2, 1);
408  /* If input value is not nearly an integer, fall back to zero, nicer than straight rounding.
409  */
410  if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
411  *it.out = pow(value1, floorf(value2 + 0.5f));
412  }
413  else {
414  *it.out = 0.0f;
415  }
416  }
417  clamp_when_enabled(it.out);
418  }
419 }
420 
422  float x,
423  float y,
425 {
426  float input_value1[4];
427  float input_value2[4];
428 
429  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
430  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
431 
432  if (input_value1[0] > 0 && input_value2[0] > 0) {
433  output[0] = log(input_value1[0]) / log(input_value2[0]);
434  }
435  else {
436  output[0] = 0.0;
437  }
438 
440 }
441 
443 {
444  for (; !it.is_end(); ++it) {
445  const float value1 = *it.in(0);
446  const float value2 = *it.in(1);
447  if (value1 > 0 && value2 > 0) {
448  *it.out = log(value1) / log(value2);
449  }
450  else {
451  *it.out = 0.0;
452  }
453  clamp_when_enabled(it.out);
454  }
455 }
456 
458  float x,
459  float y,
461 {
462  float input_value1[4];
463  float input_value2[4];
464 
465  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
466  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
467 
468  output[0] = MIN2(input_value1[0], input_value2[0]);
469 
471 }
472 
474 {
475  for (; !it.is_end(); ++it) {
476  *it.out = MIN2(*it.in(0), *it.in(1));
477  clamp_when_enabled(it.out);
478  }
479 }
480 
482  float x,
483  float y,
485 {
486  float input_value1[4];
487  float input_value2[4];
488 
489  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
490  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
491 
492  output[0] = MAX2(input_value1[0], input_value2[0]);
493 
495 }
496 
498 {
499  for (; !it.is_end(); ++it) {
500  *it.out = MAX2(*it.in(0), *it.in(1));
501  clamp_when_enabled(it.out);
502  }
503 }
504 
506  float x,
507  float y,
509 {
510  float input_value1[4];
511  float input_value2[4];
512 
513  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
514  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
515 
516  output[0] = round(input_value1[0]);
517 
519 }
520 
522 {
523  for (; !it.is_end(); ++it) {
524  *it.out = round(*it.in(0));
525  clamp_when_enabled(it.out);
526  }
527 }
528 
530  float x,
531  float y,
533 {
534  float input_value1[4];
535  float input_value2[4];
536 
537  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
538  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
539 
540  output[0] = input_value1[0] < input_value2[0] ? 1.0f : 0.0f;
541 
543 }
544 
546  float x,
547  float y,
549 {
550  float input_value1[4];
551  float input_value2[4];
552 
553  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
554  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
555 
556  output[0] = input_value1[0] > input_value2[0] ? 1.0f : 0.0f;
557 
559 }
560 
562  float x,
563  float y,
565 {
566  float input_value1[4];
567  float input_value2[4];
568 
569  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
570  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
571 
572  if (input_value2[0] == 0) {
573  output[0] = 0.0;
574  }
575  else {
576  output[0] = fmod(input_value1[0], input_value2[0]);
577  }
578 
580 }
581 
583 {
584  for (; !it.is_end(); ++it) {
585  const float value2 = *it.in(1);
586  *it.out = (value2 == 0) ? 0 : fmod(*it.in(0), value2);
587  clamp_when_enabled(it.out);
588  }
589 }
590 
592  float x,
593  float y,
595 {
596  float input_value1[4];
597 
598  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
599 
600  output[0] = fabs(input_value1[0]);
601 
603 }
604 
606 {
607  for (; !it.is_end(); ++it) {
608  *it.out = fabs(*it.in(0));
609  clamp_when_enabled(it.out);
610  }
611 }
612 
614  float x,
615  float y,
617 {
618  float input_value1[4];
619 
620  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
621 
622  output[0] = DEG2RADF(input_value1[0]);
623 
625 }
626 
628 {
629  for (; !it.is_end(); ++it) {
630  *it.out = DEG2RADF(*it.in(0));
631  clamp_when_enabled(it.out);
632  }
633 }
634 
636  float x,
637  float y,
639 {
640  float input_value1[4];
641 
642  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
643 
644  output[0] = RAD2DEGF(input_value1[0]);
645 
647 }
648 
650 {
651  for (; !it.is_end(); ++it) {
652  *it.out = RAD2DEGF(*it.in(0));
653  clamp_when_enabled(it.out);
654  }
655 }
656 
658  float x,
659  float y,
661 {
662  float input_value1[4];
663  float input_value2[4];
664 
665  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
666  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
667 
668  output[0] = atan2(input_value1[0], input_value2[0]);
669 
671 }
672 
674 {
675  for (; !it.is_end(); ++it) {
676  *it.out = atan2(*it.in(0), *it.in(1));
677  clamp_when_enabled(it.out);
678  }
679 }
680 
682  float x,
683  float y,
685 {
686  float input_value1[4];
687 
688  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
689 
690  output[0] = floor(input_value1[0]);
691 
693 }
694 
696 {
697  for (; !it.is_end(); ++it) {
698  *it.out = floor(*it.in(0));
699  clamp_when_enabled(it.out);
700  }
701 }
702 
704  float x,
705  float y,
707 {
708  float input_value1[4];
709 
710  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
711 
712  output[0] = ceil(input_value1[0]);
713 
715 }
716 
718 {
719  for (; !it.is_end(); ++it) {
720  *it.out = ceil(*it.in(0));
721  clamp_when_enabled(it.out);
722  }
723 }
724 
726  float x,
727  float y,
729 {
730  float input_value1[4];
731 
732  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
733 
734  output[0] = input_value1[0] - floor(input_value1[0]);
735 
737 }
738 
740 {
741  for (; !it.is_end(); ++it) {
742  const float value = *it.in(0);
743  *it.out = clamp_when_enabled(value - floor(value));
744  }
745 }
746 
748  float x,
749  float y,
751 {
752  float input_value1[4];
753 
754  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
755 
756  if (input_value1[0] > 0) {
757  output[0] = sqrt(input_value1[0]);
758  }
759  else {
760  output[0] = 0.0f;
761  }
762 
764 }
765 
767 {
768  for (; !it.is_end(); ++it) {
769  const float value = *it.in(0);
770  *it.out = clamp_when_enabled(value > 0 ? sqrt(value) : 0.0f);
771  }
772 }
773 
775  float x,
776  float y,
778 {
779  float input_value1[4];
780 
781  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
782 
783  if (input_value1[0] > 0) {
784  output[0] = 1.0f / sqrt(input_value1[0]);
785  }
786  else {
787  output[0] = 0.0f;
788  }
789 
791 }
792 
794 {
795  for (; !it.is_end(); ++it) {
796  const float value = *it.in(0);
797  *it.out = clamp_when_enabled(value > 0 ? 1.0f / sqrt(value) : 0.0f);
798  }
799 }
800 
802  float x,
803  float y,
805 {
806  float input_value1[4];
807 
808  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
809 
810  output[0] = compatible_signf(input_value1[0]);
811 
813 }
814 
816 {
817  for (; !it.is_end(); ++it) {
818  *it.out = compatible_signf(*it.in(0));
819  clamp_when_enabled(it.out);
820  }
821 }
822 
824  float x,
825  float y,
827 {
828  float input_value1[4];
829 
830  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
831 
832  output[0] = expf(input_value1[0]);
833 
835 }
836 
838 {
839  for (; !it.is_end(); ++it) {
840  *it.out = expf(*it.in(0));
841  clamp_when_enabled(it.out);
842  }
843 }
844 
846  float x,
847  float y,
849 {
850  float input_value1[4];
851 
852  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
853 
854  output[0] = (input_value1[0] >= 0.0f) ? floor(input_value1[0]) : ceil(input_value1[0]);
855 
857 }
858 
860 {
861  for (; !it.is_end(); ++it) {
862  const float value = *it.in(0);
863  *it.out = (value >= 0.0f) ? floor(value) : ceil(value);
864  clamp_when_enabled(it.out);
865  }
866 }
867 
869  float x,
870  float y,
872 {
873  float input_value1[4];
874  float input_value2[4];
875 
876  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
877  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
878 
879  if (input_value1[0] == 0 || input_value2[0] == 0) { /* We don't want to divide by zero. */
880  output[0] = 0.0f;
881  }
882  else {
883  output[0] = floorf(input_value1[0] / input_value2[0]) * input_value2[0];
884  }
885 
887 }
888 
890 {
891  for (; !it.is_end(); ++it) {
892  const float value1 = *it.in(0);
893  const float value2 = *it.in(1);
894  if (value1 == 0 || value2 == 0) { /* Avoid dividing by zero. */
895  *it.out = 0.0f;
896  }
897  else {
898  *it.out = floorf(value1 / value2) * value2;
899  }
900  clamp_when_enabled(it.out);
901  }
902 }
903 
905  float x,
906  float y,
908 {
909  float input_value1[4];
910  float input_value2[4];
911  float input_value3[4];
912 
913  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
914  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
915  input_value3_operation_->read_sampled(input_value3, x, y, sampler);
916 
917  output[0] = wrapf(input_value1[0], input_value2[0], input_value3[0]);
918 
920 }
921 
923 {
924  for (; !it.is_end(); ++it) {
925  *it.out = wrapf(*it.in(0), *it.in(1), *it.in(2));
926  clamp_when_enabled(it.out);
927  }
928 }
929 
931  float x,
932  float y,
934 {
935  float input_value1[4];
936  float input_value2[4];
937 
938  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
939  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
940 
941  output[0] = pingpongf(input_value1[0], input_value2[0]);
942 
944 }
945 
947 {
948  for (; !it.is_end(); ++it) {
949  *it.out = pingpongf(*it.in(0), *it.in(1));
950  clamp_when_enabled(it.out);
951  }
952 }
953 
955  float x,
956  float y,
958 {
959  float input_value1[4];
960  float input_value2[4];
961  float input_value3[4];
962 
963  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
964  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
965  input_value3_operation_->read_sampled(input_value3, x, y, sampler);
966 
967  output[0] = (fabsf(input_value1[0] - input_value2[0]) <= MAX2(input_value3[0], 1e-5f)) ? 1.0f :
968  0.0f;
969 
971 }
972 
974 {
975  for (; !it.is_end(); ++it) {
976  *it.out = (fabsf(*it.in(0) - *it.in(1)) <= MAX2(*it.in(2), 1e-5f)) ? 1.0f : 0.0f;
977  clamp_when_enabled(it.out);
978  }
979 }
980 
982  float x,
983  float y,
985 {
986  float input_value1[4];
987  float input_value2[4];
988  float input_value3[4];
989 
990  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
991  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
992  input_value3_operation_->read_sampled(input_value3, x, y, sampler);
993 
994  output[0] = input_value1[0] * input_value2[0] + input_value3[0];
995 
997 }
998 
1000 {
1001  for (; !it.is_end(); ++it) {
1002  *it.out = it.in(0)[0] * it.in(1)[0] + it.in(2)[0];
1003  clamp_when_enabled(it.out);
1004  }
1005 }
1006 
1008  float x,
1009  float y,
1011 {
1012  float input_value1[4];
1013  float input_value2[4];
1014  float input_value3[4];
1015 
1016  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
1017  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
1018  input_value3_operation_->read_sampled(input_value3, x, y, sampler);
1019 
1020  output[0] = smoothminf(input_value1[0], input_value2[0], input_value3[0]);
1021 
1023 }
1024 
1026 {
1027  for (; !it.is_end(); ++it) {
1028  *it.out = smoothminf(*it.in(0), *it.in(1), *it.in(2));
1029  clamp_when_enabled(it.out);
1030  }
1031 }
1032 
1034  float x,
1035  float y,
1037 {
1038  float input_value1[4];
1039  float input_value2[4];
1040  float input_value3[4];
1041 
1042  input_value1_operation_->read_sampled(input_value1, x, y, sampler);
1043  input_value2_operation_->read_sampled(input_value2, x, y, sampler);
1044  input_value3_operation_->read_sampled(input_value3, x, y, sampler);
1045 
1046  output[0] = -smoothminf(-input_value1[0], -input_value2[0], input_value3[0]);
1047 
1049 }
1050 
1052 {
1053  for (; !it.is_end(); ++it) {
1054  *it.out = -smoothminf(-it.in(0)[0], -it.in(1)[0], it.in(2)[0]);
1055  clamp_when_enabled(it.out);
1056  }
1057 }
1058 
1059 } // 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 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
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
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) final
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(BuffersIterator< float > &it) override
a MemoryBuffer contains access to the data of a chunk
bool determine_canvas(const rcti &preferred_area, rcti &r_area)
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperationInput * get_input_socket(unsigned int index)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void set_canvas_input_index(unsigned int index)
set the index of the input socket that will determine the canvas of this operation
virtual void determine_canvas(const rcti &preferred_area, rcti &r_area)
#define expf(x)
Definition: cuda/compat.h:106
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
ccl_global KernelShaderEvalInput ccl_global float * output
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)
ccl_device_inline float2 fabs(const float2 &a)
Definition: math_float2.h:222
ccl_device_inline float3 ceil(const float3 &a)
Definition: math_float3.h:363
ccl_device_inline float3 pow(float3 v, float e)
Definition: math_float3.h:533
ccl_device_inline float3 log(float3 v)
Definition: math_float3.h:397
#define floorf(x)
Definition: metal/compat.h:224
#define fabsf(x)
Definition: metal/compat.h:219
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 > 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
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
constexpr rcti COM_AREA_NONE
Definition: COM_defines.h:112
T floor(const T &a)
static bNodeSocketTemplate inputs[]