color blindness enhancement
This is an attempt at improving the experience of
users with color vision impairement.
At this time this feature can only be enabled for
debugging:
adb shell service call SurfaceFlinger 1014 i32 PARAM
with PARAM:
0 : disabled
1 : protanomaly/protanopia simulation
2 : deuteranomaly/deuteranopia simulation
3 : tritanopia/tritanomaly simulation
11, 12, 13: same as above w/ attempted correction/enhancement
The enhancement algorithm tries to spread the "error"
such that tones that would otherwise appear similar can be
distinguished.
Bug: 9465644
Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
diff --git a/services/surfaceflinger/Transform.cpp b/services/surfaceflinger/Transform.cpp
index 315720e..3456abf 100644
--- a/services/surfaceflinger/Transform.cpp
+++ b/services/surfaceflinger/Transform.cpp
@@ -83,8 +83,8 @@
return r;
}
-float const* Transform::operator [] (int i) const {
- return mMatrix[i].v;
+const vec3& Transform::operator [] (size_t i) const {
+ return mMatrix[i];
}
bool Transform::transformed() const {
@@ -173,7 +173,7 @@
return NO_ERROR;
}
-Transform::vec2 Transform::transform(const vec2& v) const {
+vec2 Transform::transform(const vec2& v) const {
vec2 r;
const mat33& M(mMatrix);
r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0];
@@ -181,7 +181,7 @@
return r;
}
-Transform::vec3 Transform::transform(const vec3& v) const {
+vec3 Transform::transform(const vec3& v) const {
vec3 r;
const mat33& M(mMatrix);
r[0] = M[0][0]*v[0] + M[1][0]*v[1] + M[2][0]*v[2];
@@ -190,12 +190,9 @@
return r;
}
-void Transform::transform(float* point, int x, int y) const
+vec2 Transform::transform(int x, int y) const
{
- vec2 v(x, y);
- v = transform(v);
- point[0] = v[0];
- point[1] = v[1];
+ return transform(vec2(x,y));
}
Rect Transform::makeBounds(int w, int h) const