HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImathColor.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright Contributors to the OpenEXR Project.
4 //
5 
6 //
7 // 3-channel and 4-channel color representations
8 //
9 
10 #ifndef INCLUDED_IMATHCOLOR_H
11 #define INCLUDED_IMATHCOLOR_H
12 
13 #include "ImathExport.h"
14 #include "ImathNamespace.h"
15 
16 #include "ImathVec.h"
17 #include "half.h"
18 
19 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
20 
21 ///
22 /// 3-channel color class that inherits from Vec3.
23 ///
24 /// This class does not impose interpretation on the channels, which
25 /// can represent either rgb or hsv color values.
26 ///
27 /// Note: because Color3 inherits from Vec3, its member fields are
28 /// called `x`, `y`, and `z`.
29 
30 template <class T> class IMATH_EXPORT_TEMPLATE_TYPE Color3 : public Vec3<T>
31 {
32 public:
33  /// @{
34  /// @name Constructors and Assignemt
35 
36  /// No initialization by default
38 
39  /// Initialize to (a a a)
40  IMATH_HOSTDEVICE constexpr explicit Color3 (T a) IMATH_NOEXCEPT;
41 
42  /// Initialize to (a b c)
43  IMATH_HOSTDEVICE constexpr Color3 (T a, T b, T c) IMATH_NOEXCEPT;
44 
45  /// Construct from Color3
46  IMATH_HOSTDEVICE constexpr Color3 (const Color3& c) IMATH_NOEXCEPT;
47 
48  /// Construct from Vec3
49  template <class S>
50  IMATH_HOSTDEVICE constexpr Color3 (const Vec3<S>& v) IMATH_NOEXCEPT;
51 
52  /// Destructor
53  ~Color3() = default;
54 
55  /// Component-wise assignment
56  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
58 
59  /// @}
60 
61  /// @{
62  /// @name Arithmetic
63 
64  /// Component-wise addition
65  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
67 
68  /// Component-wise addition
69  IMATH_HOSTDEVICE constexpr Color3
70  operator+ (const Color3& c) const IMATH_NOEXCEPT;
71 
72  /// Component-wise subtraction
73  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
75 
76  /// Component-wise subtraction
77  IMATH_HOSTDEVICE constexpr Color3
78  operator- (const Color3& c) const IMATH_NOEXCEPT;
79 
80  /// Component-wise multiplication by -1
82 
83  /// Component-wise multiplication by -1
84  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& negate () IMATH_NOEXCEPT;
85 
86  /// Component-wise multiplication
87  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
89 
90  /// Component-wise multiplication
91  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
93 
94  /// Component-wise multiplication
95  IMATH_HOSTDEVICE constexpr Color3
96  operator* (const Color3& c) const IMATH_NOEXCEPT;
97 
98  /// Component-wise multiplication
100 
101  /// Component-wise division
102  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
104 
105  /// Component-wise division
106  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3&
108 
109  /// Component-wise division
110  IMATH_HOSTDEVICE constexpr Color3
111  operator/ (const Color3& c) const IMATH_NOEXCEPT;
112 
113  /// Component-wise division
115 
116  /// @}
117 };
118 
119 ///
120 /// A 4-channel color class: 3 channels plus alpha.
121 ///
122 /// For convenience, the fields are named `r`, `g`, and `b`, although
123 /// this class does not impose interpretation on the channels, which
124 /// can represent either rgb or hsv color values.
125 ///
126 
127 template <class T> class IMATH_EXPORT_TEMPLATE_TYPE Color4
128 {
129 public:
130  /// @{
131  /// @name Direct access to elements
132 
133  T r, g, b, a;
134 
135  /// @}
136 
137  /// @{
138  /// @name Constructors and Assignment
139 
140  /// No initialization by default
142 
143  /// Initialize to `(a a a a)`
144  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Color4 (T a) IMATH_NOEXCEPT;
145 
146  /// Initialize to `(a b c d)`
147  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (T a, T b, T c, T d)
148  IMATH_NOEXCEPT;
149 
150  /// Construct from Color4
151  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4& v) IMATH_NOEXCEPT;
152 
153  /// Construct from Color4
154  template <class S>
155  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4<S>& v)
156  IMATH_NOEXCEPT;
157 
158  /// Destructor
159  ~Color4() = default;
160 
161  /// Assignment
162  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
163  operator= (const Color4& v) IMATH_NOEXCEPT;
164 
165  /// Component-wise value
166  IMATH_HOSTDEVICE T& operator[] (int i) IMATH_NOEXCEPT;
167 
168  /// Component-wise value
169  IMATH_HOSTDEVICE const T& operator[] (int i) const IMATH_NOEXCEPT;
170 
171  /// @}
172 
173  /// @{
174  /// @name Arithmetic and Comparison
175 
176  /// Equality
177  template <class S>
178  IMATH_HOSTDEVICE constexpr bool
179  operator== (const Color4<S>& v) const IMATH_NOEXCEPT;
180 
181  /// Inequality
182  template <class S>
183  IMATH_HOSTDEVICE constexpr bool
184  operator!= (const Color4<S>& v) const IMATH_NOEXCEPT;
185 
186  /// Component-wise addition
187  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
188  operator+= (const Color4& v) IMATH_NOEXCEPT;
189 
190  /// Component-wise addition
191  IMATH_HOSTDEVICE constexpr Color4
192  operator+ (const Color4& v) const IMATH_NOEXCEPT;
193 
194  /// Component-wise subtraction
195  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
196  operator-= (const Color4& v) IMATH_NOEXCEPT;
197 
198  /// Component-wise subtraction
199  IMATH_HOSTDEVICE constexpr Color4
200  operator- (const Color4& v) const IMATH_NOEXCEPT;
201 
202  /// Component-wise multiplication by -1
203  IMATH_HOSTDEVICE constexpr Color4 operator- () const IMATH_NOEXCEPT;
204 
205  /// Component-wise multiplication by -1
206  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& negate () IMATH_NOEXCEPT;
207 
208  /// Component-wise multiplication
209  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
210  operator*= (const Color4& v) IMATH_NOEXCEPT;
211 
212  /// Component-wise multiplication
213  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
214  operator*= (T a) IMATH_NOEXCEPT;
215 
216  /// Component-wise multiplication
217  IMATH_HOSTDEVICE constexpr Color4
218  operator* (const Color4& v) const IMATH_NOEXCEPT;
219 
220  /// Component-wise multiplication
221  IMATH_HOSTDEVICE constexpr Color4 operator* (T a) const IMATH_NOEXCEPT;
222 
223  /// Component-wise division
224  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
225  operator/= (const Color4& v) IMATH_NOEXCEPT;
226 
227  /// Component-wise division
228  IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4&
229  operator/= (T a) IMATH_NOEXCEPT;
230 
231  /// Component-wise division
232  IMATH_HOSTDEVICE constexpr Color4
233  operator/ (const Color4& v) const IMATH_NOEXCEPT;
234 
235  /// Component-wise division
236  IMATH_HOSTDEVICE constexpr Color4 operator/ (T a) const IMATH_NOEXCEPT;
237 
238  /// @}
239 
240  /// @{
241  /// @name Numeric Limits
242 
243  /// Number of dimensions (channels), i.e. 4 for a Color4
244  IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT
245  {
246  return 4;
247  }
248 
249  /// Largest possible negative value
251  {
252  return std::numeric_limits<T>::lowest ();
253  }
254 
255  /// Largest possible positive value
257  {
258  return std::numeric_limits<T>::max ();
259  }
260 
261  /// Smallest possible positive value
263  {
264  return std::numeric_limits<T>::min ();
265  }
266 
267  /// Smallest possible e for which 1+e != 1
269  {
270  return std::numeric_limits<T>::epsilon ();
271  }
272 
273  /// @}
274 
275  /// The base type: In templates that accept a parameter `V` (could
276  /// be a Color4), you can refer to `T` as `V::BaseType`
277  typedef T BaseType;
278 
279  /// @{
280  /// @name Compatibilty with Sb
281 
282  /// Set the value
283  template <class S>
284  IMATH_HOSTDEVICE void setValue (S a, S b, S c, S d) IMATH_NOEXCEPT;
285 
286  /// Set the value
287  template <class S>
288  IMATH_HOSTDEVICE void setValue (const Color4<S>& v) IMATH_NOEXCEPT;
289 
290  /// Return the value
291  template <class S>
292  IMATH_HOSTDEVICE void
293  getValue (S& a, S& b, S& c, S& d) const IMATH_NOEXCEPT;
294 
295  /// Return the value
296  template <class S>
298 
299  /// Return raw pointer to the value
301 
302  /// Return raw pointer to the value
303  IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT;
304 
305  /// @}
306 };
307 
308 /// Stream output, as "(r g b a)"
309 template <class T>
310 std::ostream& operator<< (std::ostream& s, const Color4<T>& v);
311 
312 /// Reverse multiplication: S * Color4
313 template <class S, class T>
314 IMATH_HOSTDEVICE constexpr Color4<T>
315 operator* (S a, const Color4<T>& v) IMATH_NOEXCEPT;
316 
317 /// 3 float channels
318 typedef Color3<float> Color3f;
319 
320 /// 3 half channels
321 typedef Color3<half> Color3h;
322 
323 /// 3 8-bit integer channels
324 typedef Color3<unsigned char> Color3c;
325 
326 /// 3 half channels
327 typedef Color3<half> C3h;
328 
329 /// 3 float channels
330 typedef Color3<float> C3f;
331 
332 /// 3 8-bit integer channels
333 typedef Color3<unsigned char> C3c;
334 
335 /// 4 float channels
336 typedef Color4<float> Color4f;
337 
338 /// 4 half channels
339 typedef Color4<half> Color4h;
340 
341 /// 4 8-bit integer channels
342 typedef Color4<unsigned char> Color4c;
343 
344 /// 4 float channels
345 typedef Color4<float> C4f;
346 
347 /// 4 half channels
348 typedef Color4<half> C4h;
349 
350 /// 4 8-bit integer channels
351 typedef Color4<unsigned char> C4c;
352 
353 /// Packed 32-bit integer
354 typedef unsigned int PackedColor;
355 
356 //
357 // Implementation of Color3
358 //
359 
360 template <class T>
361 IMATH_HOSTDEVICE inline Color3<T>::Color3 () IMATH_NOEXCEPT : Vec3<T> ()
362 {
363  // empty
364 }
365 
366 template <class T>
368  : Vec3<T> (a)
369 {
370  // empty
371 }
372 
373 template <class T>
374 IMATH_HOSTDEVICE constexpr inline Color3<T>::Color3 (T a, T b, T c)
375  IMATH_NOEXCEPT : Vec3<T> (a, b, c)
376 {
377  // empty
378 }
379 
380 template <class T>
381 IMATH_HOSTDEVICE constexpr inline Color3<T>::Color3 (const Color3& c)
383 {
384  // empty
385 }
386 
387 template <class T>
388 template <class S>
389 IMATH_HOSTDEVICE constexpr inline Color3<T>::Color3 (const Vec3<S>& v)
391 {
392  //empty
393 }
394 
395 template <class T>
396 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
398 {
399  *((Vec3<T>*) this) = c;
400  return *this;
401 }
402 
403 template <class T>
404 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
406 {
407  *((Vec3<T>*) this) += c;
408  return *this;
409 }
410 
411 template <class T>
412 IMATH_HOSTDEVICE constexpr inline Color3<T>
414 {
415  return Color3 (*(Vec3<T>*) this + (const Vec3<T>&) c);
416 }
417 
418 template <class T>
419 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
421 {
422  *((Vec3<T>*) this) -= c;
423  return *this;
424 }
425 
426 template <class T>
427 IMATH_HOSTDEVICE constexpr inline Color3<T>
429 {
430  return Color3 (*(Vec3<T>*) this - (const Vec3<T>&) c);
431 }
432 
433 template <class T>
434 IMATH_HOSTDEVICE constexpr inline Color3<T>
436 {
437  return Color3 (-(*(Vec3<T>*) this));
438 }
439 
440 template <class T>
441 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
443 {
444  ((Vec3<T>*) this)->negate ();
445  return *this;
446 }
447 
448 template <class T>
449 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
451 {
452  *((Vec3<T>*) this) *= c;
453  return *this;
454 }
455 
456 template <class T>
457 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
459 {
460  *((Vec3<T>*) this) *= a;
461  return *this;
462 }
463 
464 template <class T>
465 IMATH_HOSTDEVICE constexpr inline Color3<T>
467 {
468  return Color3 (*(Vec3<T>*) this * (const Vec3<T>&) c);
469 }
470 
471 template <class T>
472 IMATH_HOSTDEVICE constexpr inline Color3<T>
474 {
475  return Color3 (*(Vec3<T>*) this * a);
476 }
477 
478 template <class T>
479 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
481 {
482  *((Vec3<T>*) this) /= c;
483  return *this;
484 }
485 
486 template <class T>
487 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3<T>&
489 {
490  *((Vec3<T>*) this) /= a;
491  return *this;
492 }
493 
494 template <class T>
495 IMATH_HOSTDEVICE constexpr inline Color3<T>
497 {
498  return Color3 (*(Vec3<T>*) this / (const Vec3<T>&) c);
499 }
500 
501 template <class T>
502 IMATH_HOSTDEVICE constexpr inline Color3<T>
504 {
505  return Color3 (*(Vec3<T>*) this / a);
506 }
507 
508 //
509 // Implementation of Color4
510 //
511 
512 template <class T>
513 IMATH_HOSTDEVICE inline T&
515 {
516  return reinterpret_cast<T *> (this)[i];
517 }
518 
519 template <class T>
520 IMATH_HOSTDEVICE inline const T&
522 {
523  return reinterpret_cast<const T *> (this)[i];
524 }
525 
527 {
528  // empty
529 }
530 
531 template <class T>
533 {
534  r = g = b = a = x;
535 }
536 
537 template <class T>
538 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4<T>::Color4 (T x, T y, T z, T w)
540 {
541  r = x;
542  g = y;
543  b = z;
544  a = w;
545 }
546 
547 template <class T>
549  IMATH_CONSTEXPR14 inline Color4<T>::Color4 (const Color4& v) IMATH_NOEXCEPT
550 {
551  r = v.r;
552  g = v.g;
553  b = v.b;
554  a = v.a;
555 }
556 
557 template <class T>
558 template <class S>
559 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4<T>::Color4 (const Color4<S>& v)
561 {
562  r = T (v.r);
563  g = T (v.g);
564  b = T (v.b);
565  a = T (v.a);
566 }
567 
568 template <class T>
569 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
571 {
572  r = v.r;
573  g = v.g;
574  b = v.b;
575  a = v.a;
576  return *this;
577 }
578 
579 template <class T>
580 template <class S>
581 IMATH_HOSTDEVICE inline void
583 {
584  r = T (x);
585  g = T (y);
586  b = T (z);
587  a = T (w);
588 }
589 
590 template <class T>
591 template <class S>
592 IMATH_HOSTDEVICE inline void
594 {
595  r = T (v.r);
596  g = T (v.g);
597  b = T (v.b);
598  a = T (v.a);
599 }
600 
601 template <class T>
602 template <class S>
603 IMATH_HOSTDEVICE inline void
605 {
606  x = S (r);
607  y = S (g);
608  z = S (b);
609  w = S (a);
610 }
611 
612 template <class T>
613 template <class S>
614 IMATH_HOSTDEVICE inline void
616 {
617  v.r = S (r);
618  v.g = S (g);
619  v.b = S (b);
620  v.a = S (a);
621 }
622 
623 template <class T>
624 IMATH_HOSTDEVICE inline T*
626 {
627  return reinterpret_cast<T*> (this);
628 }
629 
630 template <class T>
631 IMATH_HOSTDEVICE inline const T*
633 {
634  return reinterpret_cast<const T*> (this);
635 }
636 
637 template <class T>
638 template <class S>
639 IMATH_HOSTDEVICE constexpr inline bool
641 {
642  return r == v.r && g == v.g && b == v.b && a == v.a;
643 }
644 
645 template <class T>
646 template <class S>
647 IMATH_HOSTDEVICE constexpr inline bool
649 {
650  return r != v.r || g != v.g || b != v.b || a != v.a;
651 }
652 
653 template <class T>
654 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
656 {
657  r += v.r;
658  g += v.g;
659  b += v.b;
660  a += v.a;
661  return *this;
662 }
663 
664 template <class T>
665 IMATH_HOSTDEVICE constexpr inline Color4<T>
667 {
668  return Color4 (r + v.r, g + v.g, b + v.b, a + v.a);
669 }
670 
671 template <class T>
672 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
674 {
675  r -= v.r;
676  g -= v.g;
677  b -= v.b;
678  a -= v.a;
679  return *this;
680 }
681 
682 template <class T>
683 IMATH_HOSTDEVICE constexpr inline Color4<T>
685 {
686  return Color4 (r - v.r, g - v.g, b - v.b, a - v.a);
687 }
688 
689 template <class T>
690 IMATH_HOSTDEVICE constexpr inline Color4<T>
692 {
693  return Color4 (-r, -g, -b, -a);
694 }
695 
696 template <class T>
697 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
699 {
700  r = -r;
701  g = -g;
702  b = -b;
703  a = -a;
704  return *this;
705 }
706 
707 template <class T>
708 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
710 {
711  r *= v.r;
712  g *= v.g;
713  b *= v.b;
714  a *= v.a;
715  return *this;
716 }
717 
718 template <class T>
719 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
721 {
722  r *= x;
723  g *= x;
724  b *= x;
725  a *= x;
726  return *this;
727 }
728 
729 template <class T>
730 IMATH_HOSTDEVICE constexpr inline Color4<T>
732 {
733  return Color4 (r * v.r, g * v.g, b * v.b, a * v.a);
734 }
735 
736 template <class T>
737 IMATH_HOSTDEVICE constexpr inline Color4<T>
739 {
740  return Color4 (r * x, g * x, b * x, a * x);
741 }
742 
743 template <class T>
744 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
746 {
747  r /= v.r;
748  g /= v.g;
749  b /= v.b;
750  a /= v.a;
751  return *this;
752 }
753 
754 template <class T>
755 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4<T>&
757 {
758  r /= x;
759  g /= x;
760  b /= x;
761  a /= x;
762  return *this;
763 }
764 
765 template <class T>
766 IMATH_HOSTDEVICE constexpr inline Color4<T>
768 {
769  return Color4 (r / v.r, g / v.g, b / v.b, a / v.a);
770 }
771 
772 template <class T>
773 IMATH_HOSTDEVICE constexpr inline Color4<T>
775 {
776  return Color4 (r / x, g / x, b / x, a / x);
777 }
778 
779 template <class T>
780 std::ostream&
781 operator<< (std::ostream& s, const Color4<T>& v)
782 {
783  return s << '(' << v.r << ' ' << v.g << ' ' << v.b << ' ' << v.a << ')';
784 }
785 
786 //
787 // Implementation of reverse multiplication
788 //
789 
790 template <class S, class T>
791 IMATH_HOSTDEVICE constexpr inline Color4<T>
793 {
794  return Color4<T> (x * v.r, x * v.g, x * v.b, x * v.a);
795 }
796 
797 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
798 
799 #endif // INCLUDED_IMATHCOLOR_H
Color3 operator+() const
Unary plus of a vector. Returns the unaltered vector.
Definition: Types.h:210
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator*=(const Color4 &v) IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathColor.h:709
IMATH_HOSTDEVICE void setValue(S a, S b, S c, S d) IMATH_NOEXCEPT
Set the value.
Definition: ImathColor.h:582
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator=(const Color4 &v) IMATH_NOEXCEPT
Assignment.
Definition: ImathColor.h:570
IMATH_HOSTDEVICE static constexpr T baseTypeSmallest() IMATH_NOEXCEPT
Smallest possible positive value.
Definition: ImathColor.h:262
#define IMATH_NOEXCEPT
Definition: ImathConfig.h:78
IMATH_HOSTDEVICE static constexpr T baseTypeLowest() IMATH_NOEXCEPT
Largest possible negative value.
Definition: ImathColor.h:250
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator=(const Color3 &c) IMATH_NOEXCEPT
Component-wise assignment.
Definition: ImathColor.h:397
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator+=(const Color3 &c) IMATH_NOEXCEPT
Component-wise addition.
Definition: ImathColor.h:405
Definition: ImathVec.h:40
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:632
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
Definition: half.h:268
IMATH_HOSTDEVICE T * getValue() IMATH_NOEXCEPT
Return raw pointer to the value.
Definition: ImathColor.h:625
const GLdouble * v
Definition: glcorearb.h:837
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:848
GLboolean GLboolean g
Definition: glcorearb.h:1222
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator*=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathVec.h:1967
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
GLdouble s
Definition: glad.h:3009
unsigned int PackedColor
Packed 32-bit integer.
Definition: ImathColor.h:354
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathColor.h:442
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLint y
Definition: glcorearb.h:103
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator+=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise addition.
Definition: ImathVec.h:1916
IMATH_HOSTDEVICE static constexpr T baseTypeMax() IMATH_NOEXCEPT
Largest possible positive value.
Definition: ImathColor.h:256
#define IMATH_HOSTDEVICE
Definition: ImathConfig.h:108
__hostdev__ float getValue(uint32_t i) const
Definition: NanoVDB.h:5578
IMATH_HOSTDEVICE constexpr bool operator==(const Color4< S > &v) const IMATH_NOEXCEPT
Equality.
Definition: ImathColor.h:640
IMATH_HOSTDEVICE constexpr Vec3 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathVec.h:1950
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator*=(const Color3 &c) IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathColor.h:450
IMATH_HOSTDEVICE Color3() IMATH_NOEXCEPT
No initialization by default.
Definition: ImathColor.h:361
IMATH_HOSTDEVICE constexpr bool operator!=(const Color4< S > &v) const IMATH_NOEXCEPT
Inequality.
Definition: ImathColor.h:648
IMATH_HOSTDEVICE constexpr Color3 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathColor.h:435
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator+=(const Color4 &v) IMATH_NOEXCEPT
Component-wise addition.
Definition: ImathColor.h:655
IMATH_HOSTDEVICE constexpr Color3 operator*(const Color3 &c) const IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathColor.h:466
IMATH_HOSTDEVICE T & operator[](int i) IMATH_NOEXCEPT
Component-wise value.
Definition: ImathColor.h:514
IMATH_HOSTDEVICE constexpr Vec3 operator+(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise addition.
Definition: ImathVec.h:1926
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator-=(const Color4 &v) IMATH_NOEXCEPT
Component-wise subtraction.
Definition: ImathColor.h:673
IMATH_HOSTDEVICE constexpr Color4< T > operator*(S a, const Color4< T > &v) IMATH_NOEXCEPT
Reverse multiplication: S * Color4.
Definition: ImathColor.h:792
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathVec.h:1957
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GLint GLenum GLint x
Definition: glcorearb.h:409
IMATH_HOSTDEVICE static constexpr T baseTypeEpsilon() IMATH_NOEXCEPT
Smallest possible e for which 1+e != 1.
Definition: ImathColor.h:268
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator/=(const Color3 &c) IMATH_NOEXCEPT
Component-wise division.
Definition: ImathColor.h:480
IMATH_HOSTDEVICE constexpr Color4 operator*(const Color4 &v) const IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathColor.h:731
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathColor.h:698
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator-=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise subtraction.
Definition: ImathVec.h:1933
T BaseType
Definition: ImathColor.h:277
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator/=(const Color4 &v) IMATH_NOEXCEPT
Component-wise division.
Definition: ImathColor.h:745
#define IMATH_EXPORT_TEMPLATE_TYPE
Definition: ImathExport.h:61
IMATH_HOSTDEVICE constexpr Color3 operator/(const Color3 &c) const IMATH_NOEXCEPT
Component-wise division.
Definition: ImathColor.h:496
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
IMATH_HOSTDEVICE Color4() IMATH_NOEXCEPT
No initialization by default.
Definition: ImathColor.h:526
GLboolean r
Definition: glcorearb.h:1222
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator=(const Vec3 &v) IMATH_NOEXCEPT
Assignment.
Definition: ImathVec.h:1740
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator-=(const Color3 &c) IMATH_NOEXCEPT
Component-wise subtraction.
Definition: ImathColor.h:420
IMATH_HOSTDEVICE constexpr Color4 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
Definition: ImathColor.h:691
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator/=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise division.
Definition: ImathVec.h:2001
IMATH_HOSTDEVICE constexpr Vec3 operator*(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise multiplication.
Definition: ImathVec.h:1987
IMATH_HOSTDEVICE constexpr Vec3 operator/(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise division.
Definition: ImathVec.h:2021
IMATH_HOSTDEVICE constexpr Color4 operator/(const Color4 &v) const IMATH_NOEXCEPT
Component-wise division.
Definition: ImathColor.h:767