Atoms Crowd  7.0.0
ImathColor.h
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_ATOMSMATHCOLOR_H
11 #define INCLUDED_ATOMSMATHCOLOR_H
12 
13 #include <AtomsMath/ImathNamespace.h>
14 #include <AtomsMath/ImathVec.h>
15 #include <AtomsMath/half.h>
16 
17 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_ENTER
18 
27 
28 template <class T> class Color3 : public Vec3<T>
29 {
30  public:
31 
34 
36  ATOMSMATH_HOSTDEVICE Color3() noexcept;
37 
39  ATOMSMATH_HOSTDEVICE constexpr explicit Color3 (T a) noexcept;
40 
42  ATOMSMATH_HOSTDEVICE constexpr Color3 (T a, T b, T c) noexcept;
43 
45  ATOMSMATH_HOSTDEVICE constexpr Color3 (const Color3& c) noexcept;
46 
48  template <class S> ATOMSMATH_HOSTDEVICE constexpr Color3 (const Vec3<S>& v) noexcept;
49 
51  ~Color3() = default;
52 
54  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator= (const Color3& c) noexcept;
55 
57 
60 
62  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator+= (const Color3& c) noexcept;
63 
65  ATOMSMATH_HOSTDEVICE constexpr Color3 operator+ (const Color3& c) const noexcept;
66 
68  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator-= (const Color3& c) noexcept;
69 
71  ATOMSMATH_HOSTDEVICE constexpr Color3 operator- (const Color3& c) const noexcept;
72 
74  ATOMSMATH_HOSTDEVICE constexpr Color3 operator-() const noexcept;
75 
77  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& negate() noexcept;
78 
80  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator*= (const Color3& c) noexcept;
81 
83  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator*= (T a) noexcept;
84 
86  ATOMSMATH_HOSTDEVICE constexpr Color3 operator* (const Color3& c) const noexcept;
87 
89  ATOMSMATH_HOSTDEVICE constexpr Color3 operator* (T a) const noexcept;
90 
92  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator/= (const Color3& c) noexcept;
93 
95  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3& operator/= (T a) noexcept;
96 
98  ATOMSMATH_HOSTDEVICE constexpr Color3 operator/ (const Color3& c) const noexcept;
99 
101  ATOMSMATH_HOSTDEVICE constexpr Color3 operator/ (T a) const noexcept;
102 
104 };
105 
113 
114 template <class T> class Color4
115 {
116  public:
117 
120 
121  T r, g, b, a;
122 
124 
127 
129  ATOMSMATH_HOSTDEVICE Color4() noexcept;
130 
132  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 explicit Color4 (T a) noexcept;
133 
135  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Color4 (T a, T b, T c, T d) noexcept;
136 
138  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Color4 (const Color4& v) noexcept;
139 
141  template <class S> ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Color4 (const Color4<S>& v) noexcept;
142 
144  ~Color4() = default;
145 
147  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator= (const Color4& v) noexcept;
148 
150  ATOMSMATH_HOSTDEVICE T& operator[] (int i) noexcept;
151 
153  ATOMSMATH_HOSTDEVICE const T& operator[] (int i) const noexcept;
154 
156 
159 
161  template <class S> ATOMSMATH_HOSTDEVICE constexpr bool operator== (const Color4<S>& v) const noexcept;
162 
164  template <class S> ATOMSMATH_HOSTDEVICE constexpr bool operator!= (const Color4<S>& v) const noexcept;
165 
167  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator+= (const Color4& v) noexcept;
168 
170  ATOMSMATH_HOSTDEVICE constexpr Color4 operator+ (const Color4& v) const noexcept;
171 
173  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator-= (const Color4& v) noexcept;
174 
176  ATOMSMATH_HOSTDEVICE constexpr Color4 operator- (const Color4& v) const noexcept;
177 
179  ATOMSMATH_HOSTDEVICE constexpr Color4 operator-() const noexcept;
180 
182  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& negate() noexcept;
183 
185  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator*= (const Color4& v) noexcept;
186 
188  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator*= (T a) noexcept;
189 
191  ATOMSMATH_HOSTDEVICE constexpr Color4 operator* (const Color4& v) const noexcept;
192 
194  ATOMSMATH_HOSTDEVICE constexpr Color4 operator* (T a) const noexcept;
195 
197  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator/= (const Color4& v) noexcept;
198 
200  ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4& operator/= (T a) noexcept;
201 
203  ATOMSMATH_HOSTDEVICE constexpr Color4 operator/ (const Color4& v) const noexcept;
204 
206  ATOMSMATH_HOSTDEVICE constexpr Color4 operator/ (T a) const noexcept;
207 
209 
212 
214  ATOMSMATH_HOSTDEVICE constexpr static unsigned int dimensions() noexcept { return 4; }
215 
217  ATOMSMATH_HOSTDEVICE constexpr static T baseTypeLowest() noexcept { return std::numeric_limits<T>::lowest(); }
218 
220  ATOMSMATH_HOSTDEVICE constexpr static T baseTypeMax() noexcept { return std::numeric_limits<T>::max(); }
221 
223  ATOMSMATH_HOSTDEVICE constexpr static T baseTypeSmallest() noexcept { return std::numeric_limits<T>::min(); }
224 
226  ATOMSMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() noexcept { return std::numeric_limits<T>::epsilon(); }
227 
229 
232  typedef T BaseType;
233 
236 
238  template <class S> ATOMSMATH_HOSTDEVICE void setValue (S a, S b, S c, S d) noexcept;
239 
241  template <class S> ATOMSMATH_HOSTDEVICE void setValue (const Color4<S>& v) noexcept;
242 
244  template <class S> ATOMSMATH_HOSTDEVICE void getValue (S& a, S& b, S& c, S& d) const noexcept;
245 
247  template <class S> ATOMSMATH_HOSTDEVICE void getValue (Color4<S>& v) const noexcept;
248 
250  ATOMSMATH_HOSTDEVICE T* getValue() noexcept;
251 
253  ATOMSMATH_HOSTDEVICE const T* getValue() const noexcept;
254 
256 };
257 
259 template <class T> std::ostream& operator<< (std::ostream& s, const Color4<T>& v);
260 
262 template <class S, class T> constexpr Color4<T> operator* (S a, const Color4<T>& v) noexcept;
263 
265 typedef Color3<float> Color3f;
266 
268 typedef Color3<half> Color3h;
269 
271 typedef Color3<unsigned char> Color3c;
272 
274 typedef Color3<half> C3h;
275 
277 typedef Color3<float> C3f;
278 
280 typedef Color3<unsigned char> C3c;
281 
283 typedef Color4<float> Color4f;
284 
286 typedef Color4<half> Color4h;
287 
289 typedef Color4<unsigned char> Color4c;
290 
292 typedef Color4<float> C4f;
293 
295 typedef Color4<half> C4h;
296 
298 typedef Color4<unsigned char> C4c;
299 
301 typedef unsigned int PackedColor;
302 
303 //
304 // Implementation of Color3
305 //
306 
307 template <class T> inline Color3<T>::Color3() noexcept : Vec3<T>()
308 {
309  // empty
310 }
311 
312 template <class T> constexpr inline Color3<T>::Color3 (T a) noexcept : Vec3<T> (a)
313 {
314  // empty
315 }
316 
317 template <class T> constexpr inline Color3<T>::Color3 (T a, T b, T c) noexcept : Vec3<T> (a, b, c)
318 {
319  // empty
320 }
321 
322 template <class T> constexpr inline Color3<T>::Color3 (const Color3& c) noexcept : Vec3<T> (c)
323 {
324  // empty
325 }
326 
327 template <class T>
328 template <class S>
329 constexpr inline Color3<T>::Color3 (const Vec3<S>& v) noexcept : Vec3<T> (v)
330 {
331  //empty
332 }
333 
334 template <class T>
335 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
336 Color3<T>::operator= (const Color3& c) noexcept
337 {
338  *((Vec3<T>*) this) = c;
339  return *this;
340 }
341 
342 template <class T>
343 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
344 Color3<T>::operator+= (const Color3& c) noexcept
345 {
346  *((Vec3<T>*) this) += c;
347  return *this;
348 }
349 
350 template <class T>
351 constexpr inline Color3<T>
352 Color3<T>::operator+ (const Color3& c) const noexcept
353 {
354  return Color3 (*(Vec3<T>*) this + (const Vec3<T>&) c);
355 }
356 
357 template <class T>
358 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
359 Color3<T>::operator-= (const Color3& c) noexcept
360 {
361  *((Vec3<T>*) this) -= c;
362  return *this;
363 }
364 
365 template <class T>
366 constexpr inline Color3<T>
367 Color3<T>::operator- (const Color3& c) const noexcept
368 {
369  return Color3 (*(Vec3<T>*) this - (const Vec3<T>&) c);
370 }
371 
372 template <class T>
373 constexpr inline Color3<T>
374 Color3<T>::operator-() const noexcept
375 {
376  return Color3 (-(*(Vec3<T>*) this));
377 }
378 
379 template <class T>
380 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
382 {
383  ((Vec3<T>*) this)->negate();
384  return *this;
385 }
386 
387 template <class T>
388 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
389 Color3<T>::operator*= (const Color3& c) noexcept
390 {
391  *((Vec3<T>*) this) *= c;
392  return *this;
393 }
394 
395 template <class T>
396 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
398 {
399  *((Vec3<T>*) this) *= a;
400  return *this;
401 }
402 
403 template <class T>
404 constexpr inline Color3<T>
405 Color3<T>::operator* (const Color3& c) const noexcept
406 {
407  return Color3 (*(Vec3<T>*) this * (const Vec3<T>&) c);
408 }
409 
410 template <class T>
411 constexpr inline Color3<T>
412 Color3<T>::operator* (T a) const noexcept
413 {
414  return Color3 (*(Vec3<T>*) this * a);
415 }
416 
417 template <class T>
418 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
419 Color3<T>::operator/= (const Color3& c) noexcept
420 {
421  *((Vec3<T>*) this) /= c;
422  return *this;
423 }
424 
425 template <class T>
426 ATOMSMATH_CONSTEXPR14 inline const Color3<T>&
428 {
429  *((Vec3<T>*) this) /= a;
430  return *this;
431 }
432 
433 template <class T>
434 constexpr inline Color3<T>
435 Color3<T>::operator/ (const Color3& c) const noexcept
436 {
437  return Color3 (*(Vec3<T>*) this / (const Vec3<T>&) c);
438 }
439 
440 template <class T>
441 constexpr inline Color3<T>
442 Color3<T>::operator/ (T a) const noexcept
443 {
444  return Color3 (*(Vec3<T>*) this / a);
445 }
446 
447 //
448 // Implementation of Color4
449 //
450 
451 template <class T>
452 inline T&
453 Color4<T>::operator[] (int i) noexcept
454 {
455  return (&r)[i];
456 }
457 
458 template <class T>
459 inline const T&
460 Color4<T>::operator[] (int i) const noexcept
461 {
462  return (&r)[i];
463 }
464 
465 template <class T> inline Color4<T>::Color4() noexcept
466 {
467  // empty
468 }
469 
470 template <class T> ATOMSMATH_CONSTEXPR14 inline Color4<T>::Color4 (T x) noexcept
471 {
472  r = g = b = a = x;
473 }
474 
475 template <class T> ATOMSMATH_CONSTEXPR14 inline Color4<T>::Color4 (T x, T y, T z, T w) noexcept
476 {
477  r = x;
478  g = y;
479  b = z;
480  a = w;
481 }
482 
483 template <class T> ATOMSMATH_CONSTEXPR14 inline Color4<T>::Color4 (const Color4& v) noexcept
484 {
485  r = v.r;
486  g = v.g;
487  b = v.b;
488  a = v.a;
489 }
490 
491 template <class T>
492 template <class S>
493 ATOMSMATH_CONSTEXPR14 inline Color4<T>::Color4 (const Color4<S>& v) noexcept
494 {
495  r = T (v.r);
496  g = T (v.g);
497  b = T (v.b);
498  a = T (v.a);
499 }
500 
501 template <class T>
502 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
503 Color4<T>::operator= (const Color4& v) noexcept
504 {
505  r = v.r;
506  g = v.g;
507  b = v.b;
508  a = v.a;
509  return *this;
510 }
511 
512 template <class T>
513 template <class S>
514 inline void
515 Color4<T>::setValue (S x, S y, S z, S w) noexcept
516 {
517  r = T (x);
518  g = T (y);
519  b = T (z);
520  a = T (w);
521 }
522 
523 template <class T>
524 template <class S>
525 inline void
526 Color4<T>::setValue (const Color4<S>& v) noexcept
527 {
528  r = T (v.r);
529  g = T (v.g);
530  b = T (v.b);
531  a = T (v.a);
532 }
533 
534 template <class T>
535 template <class S>
536 inline void
537 Color4<T>::getValue (S& x, S& y, S& z, S& w) const noexcept
538 {
539  x = S (r);
540  y = S (g);
541  z = S (b);
542  w = S (a);
543 }
544 
545 template <class T>
546 template <class S>
547 inline void
548 Color4<T>::getValue (Color4<S>& v) const noexcept
549 {
550  v.r = S (r);
551  v.g = S (g);
552  v.b = S (b);
553  v.a = S (a);
554 }
555 
556 template <class T>
557 inline T*
559 {
560  return (T*) &r;
561 }
562 
563 template <class T>
564 inline const T*
565 Color4<T>::getValue() const noexcept
566 {
567  return (const T*) &r;
568 }
569 
570 template <class T>
571 template <class S>
572 constexpr inline bool
573 Color4<T>::operator== (const Color4<S>& v) const noexcept
574 {
575  return r == v.r && g == v.g && b == v.b && a == v.a;
576 }
577 
578 template <class T>
579 template <class S>
580 constexpr inline bool
581 Color4<T>::operator!= (const Color4<S>& v) const noexcept
582 {
583  return r != v.r || g != v.g || b != v.b || a != v.a;
584 }
585 
586 template <class T>
587 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
588 Color4<T>::operator+= (const Color4& v) noexcept
589 {
590  r += v.r;
591  g += v.g;
592  b += v.b;
593  a += v.a;
594  return *this;
595 }
596 
597 template <class T>
598 constexpr inline Color4<T>
599 Color4<T>::operator+ (const Color4& v) const noexcept
600 {
601  return Color4 (r + v.r, g + v.g, b + v.b, a + v.a);
602 }
603 
604 template <class T>
605 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
606 Color4<T>::operator-= (const Color4& v) noexcept
607 {
608  r -= v.r;
609  g -= v.g;
610  b -= v.b;
611  a -= v.a;
612  return *this;
613 }
614 
615 template <class T>
616 constexpr inline Color4<T>
617 Color4<T>::operator- (const Color4& v) const noexcept
618 {
619  return Color4 (r - v.r, g - v.g, b - v.b, a - v.a);
620 }
621 
622 template <class T>
623 constexpr inline Color4<T>
624 Color4<T>::operator-() const noexcept
625 {
626  return Color4 (-r, -g, -b, -a);
627 }
628 
629 template <class T>
630 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
632 {
633  r = -r;
634  g = -g;
635  b = -b;
636  a = -a;
637  return *this;
638 }
639 
640 template <class T>
641 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
642 Color4<T>::operator*= (const Color4& v) noexcept
643 {
644  r *= v.r;
645  g *= v.g;
646  b *= v.b;
647  a *= v.a;
648  return *this;
649 }
650 
651 template <class T>
652 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
654 {
655  r *= x;
656  g *= x;
657  b *= x;
658  a *= x;
659  return *this;
660 }
661 
662 template <class T>
663 constexpr inline Color4<T>
664 Color4<T>::operator* (const Color4& v) const noexcept
665 {
666  return Color4 (r * v.r, g * v.g, b * v.b, a * v.a);
667 }
668 
669 template <class T>
670 constexpr inline Color4<T>
671 Color4<T>::operator* (T x) const noexcept
672 {
673  return Color4 (r * x, g * x, b * x, a * x);
674 }
675 
676 template <class T>
677 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
678 Color4<T>::operator/= (const Color4& v) noexcept
679 {
680  r /= v.r;
681  g /= v.g;
682  b /= v.b;
683  a /= v.a;
684  return *this;
685 }
686 
687 template <class T>
688 ATOMSMATH_CONSTEXPR14 inline const Color4<T>&
690 {
691  r /= x;
692  g /= x;
693  b /= x;
694  a /= x;
695  return *this;
696 }
697 
698 template <class T>
699 constexpr inline Color4<T>
700 Color4<T>::operator/ (const Color4& v) const noexcept
701 {
702  return Color4 (r / v.r, g / v.g, b / v.b, a / v.a);
703 }
704 
705 template <class T>
706 constexpr inline Color4<T>
707 Color4<T>::operator/ (T x) const noexcept
708 {
709  return Color4 (r / x, g / x, b / x, a / x);
710 }
711 
712 template <class T>
713 std::ostream&
714 operator<< (std::ostream& s, const Color4<T>& v)
715 {
716  return s << '(' << v.r << ' ' << v.g << ' ' << v.b << ' ' << v.a << ')';
717 }
718 
719 //
720 // Implementation of reverse multiplication
721 //
722 
723 template <class S, class T>
724 constexpr inline Color4<T>
725 operator* (S x, const Color4<T>& v) noexcept
726 {
727  return Color4<T> (x * v.r, x * v.g, x * v.b, x * v.a);
728 }
729 
730 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_EXIT
731 
732 #endif // INCLUDED_ATOMSMATHCOLOR_H
Definition: ImathColor.h:29
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & operator/=(const Color3 &c) noexcept
Component-wise division.
Definition: ImathColor.h:419
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & negate() noexcept
Component-wise multiplication by -1.
Definition: ImathColor.h:381
constexpr ATOMSMATH_HOSTDEVICE Color3 operator-() const noexcept
Component-wise multiplication by -1.
Definition: ImathColor.h:374
~Color3()=default
Destructor.
constexpr ATOMSMATH_HOSTDEVICE Color3 operator+(const Color3 &c) const noexcept
Component-wise addition.
Definition: ImathColor.h:352
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & operator+=(const Color3 &c) noexcept
Component-wise addition.
Definition: ImathColor.h:344
constexpr ATOMSMATH_HOSTDEVICE Color3 operator/(const Color3 &c) const noexcept
Component-wise division.
Definition: ImathColor.h:435
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & operator*=(const Color3 &c) noexcept
Component-wise multiplication.
Definition: ImathColor.h:389
constexpr ATOMSMATH_HOSTDEVICE Color3 operator*(const Color3 &c) const noexcept
Component-wise multiplication.
Definition: ImathColor.h:405
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & operator-=(const Color3 &c) noexcept
Component-wise subtraction.
Definition: ImathColor.h:359
constexpr ATOMSMATH_HOSTDEVICE Color3(const Vec3< S > &v) noexcept
Construct from Vec3.
ATOMSMATH_HOSTDEVICE Color3() noexcept
No initialization by default.
Definition: ImathColor.h:307
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color3 & operator=(const Color3 &c) noexcept
Component-wise assignment.
Definition: ImathColor.h:336
Definition: ImathColor.h:115
~Color4()=default
Destructor.
constexpr ATOMSMATH_HOSTDEVICE Color4 operator/(const Color4 &v) const noexcept
Component-wise division.
Definition: ImathColor.h:700
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & operator-=(const Color4 &v) noexcept
Component-wise subtraction.
Definition: ImathColor.h:606
T BaseType
Definition: ImathColor.h:232
constexpr static ATOMSMATH_HOSTDEVICE T baseTypeLowest() noexcept
Largest possible negative value.
Definition: ImathColor.h:217
ATOMSMATH_HOSTDEVICE void setValue(S a, S b, S c, S d) noexcept
Set the value.
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & operator=(const Color4 &v) noexcept
Assignment.
Definition: ImathColor.h:503
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & operator/=(const Color4 &v) noexcept
Component-wise division.
Definition: ImathColor.h:678
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & operator*=(const Color4 &v) noexcept
Component-wise multiplication.
Definition: ImathColor.h:642
constexpr static ATOMSMATH_HOSTDEVICE T baseTypeEpsilon() noexcept
Smallest possible e for which 1+e != 1.
Definition: ImathColor.h:226
constexpr ATOMSMATH_HOSTDEVICE bool operator==(const Color4< S > &v) const noexcept
Equality.
ATOMSMATH_HOSTDEVICE T & operator[](int i) noexcept
Component-wise value.
Definition: ImathColor.h:453
constexpr ATOMSMATH_HOSTDEVICE Color4 operator-() const noexcept
Component-wise multiplication by -1.
Definition: ImathColor.h:624
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & negate() noexcept
Component-wise multiplication by -1.
Definition: ImathColor.h:631
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Color4(const Color4< S > &v) noexcept
Construct from Color4.
constexpr ATOMSMATH_HOSTDEVICE bool operator!=(const Color4< S > &v) const noexcept
Inequality.
constexpr static ATOMSMATH_HOSTDEVICE T baseTypeMax() noexcept
Largest possible positive value.
Definition: ImathColor.h:220
ATOMSMATH_HOSTDEVICE void getValue(S &a, S &b, S &c, S &d) const noexcept
Return the value.
ATOMSMATH_HOSTDEVICE void getValue(Color4< S > &v) const noexcept
Return the value.
ATOMSMATH_HOSTDEVICE void setValue(const Color4< S > &v) noexcept
Set the value.
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Color4 & operator+=(const Color4 &v) noexcept
Component-wise addition.
Definition: ImathColor.h:588
constexpr static ATOMSMATH_HOSTDEVICE T baseTypeSmallest() noexcept
Smallest possible positive value.
Definition: ImathColor.h:223
constexpr ATOMSMATH_HOSTDEVICE Color4 operator+(const Color4 &v) const noexcept
Component-wise addition.
Definition: ImathColor.h:599
ATOMSMATH_HOSTDEVICE T * getValue() noexcept
Return raw pointer to the value.
Definition: ImathColor.h:558
ATOMSMATH_HOSTDEVICE Color4() noexcept
No initialization by default.
Definition: ImathColor.h:465
constexpr ATOMSMATH_HOSTDEVICE Color4 operator*(const Color4 &v) const noexcept
Component-wise multiplication.
Definition: ImathColor.h:664
Definition: ImathVec.h:260
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T & operator[](int i) noexcept
Element access by index.
Definition: ImathVec.h:1199
ATOMSMATH_HOSTDEVICE T * getValue() noexcept
Return a raw pointer to the array of values.
Definition: ImathVec.h:1318
constexpr ATOMSMATH_HOSTDEVICE bool operator==(const Vec3< S > &v) const noexcept
Equality.
constexpr ATOMSMATH_HOSTDEVICE bool operator!=(const Vec3< S > &v) const noexcept
Inequality.
constexpr static ATOMSMATH_HOSTDEVICE unsigned int dimensions() noexcept
Return the number of dimensions, i.e. 3.
Definition: ImathVec.h:471