Add ColorSpace class
The ColorSpace class can be used to create an RGB color space from
either primaries/whitepoint or an RGB->XYZ matrix.
The primaries and whitepoint are in xyY space. A utility function
is provided to compute xyY coordinates from XYZ coordinats.
The class contains numerous functions to create common RGB color
spaces (sRGB, DCI-P3, etc.).
Test: colorspace_test
Bug: 29940137
Change-Id: Ifba8701377d058f5877176dabf4183e904a4cde0
diff --git a/include/ui/vec2.h b/include/ui/vec2.h
index a88d026..fdd2e20 100644
--- a/include/ui/vec2.h
+++ b/include/ui/vec2.h
@@ -24,6 +24,9 @@
#include <sys/types.h>
#include <type_traits>
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
+#pragma clang diagnostic ignored "-Wnested-anon-types"
namespace android {
// -------------------------------------------------------------------------------------
@@ -94,7 +97,7 @@
constexpr TVec2(const TVec2<A>& v) : x(v.x), y(v.y) { }
// cross product works only on vectors of size 2 or 3
- template <typename RT>
+ template<typename RT>
friend inline
constexpr value_type cross(const TVec2& u, const TVec2<RT>& v) {
return value_type(u.x*v.y - u.y*v.x);
@@ -119,4 +122,6 @@
// ----------------------------------------------------------------------------------------
} // namespace android
+#pragma clang diagnostic pop
+
#endif // UI_VEC2_H_