summaryrefslogtreecommitdiffstats
path: root/services/accessibility
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-04-28 17:30:04 -0700
committerAlan Viverette <alanv@google.com>2015-04-28 17:30:04 -0700
commit6437518061fc8718590e0272ed17ea64710d2299 (patch)
treed34dde8dcf77f510e99dd2191860ecc068cdddb9 /services/accessibility
parente658285baf86a223ad369851d1fc5ebacad7b408 (diff)
downloadframeworks_base-6437518061fc8718590e0272ed17ea64710d2299.zip
frameworks_base-6437518061fc8718590e0272ed17ea64710d2299.tar.gz
frameworks_base-6437518061fc8718590e0272ed17ea64710d2299.tar.bz2
Adjust display inversion matrix to account for luminance
Bug: 20346301 Change-Id: I10633705f2bfddbdeec063f9489a4f8679b9e8ee
Diffstat (limited to 'services/accessibility')
-rw-r--r--services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java b/services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java
index 38827d0..d0b5898 100644
--- a/services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java
+++ b/services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java
@@ -41,12 +41,18 @@ class DisplayAdjustmentUtils {
0, 0, 0, 1
};
- /** Matrix and offset used for value-only display inversion. */
+ /**
+ * Matrix and offset used for luminance inversion. Represents a transform
+ * from RGB to YIQ color space, rotation around the Y axis by 180 degrees,
+ * transform back to RGB color space, and subtraction from 1. The last row
+ * represents a non-multiplied addition, see surfaceflinger's ProgramCache
+ * for full implementation details.
+ */
private static final float[] INVERSION_MATRIX_VALUE_ONLY = new float[] {
- 0, -.5f, -.5f, 0,
- -.5f, 0, -.5f, 0,
- -.5f, -.5f, 0, 0,
- 1, 1, 1, 1
+ 0.402f, -0.598f, -0.599f, 0,
+ -1.174f, -0.174f, -1.175f, 0,
+ -0.228f, -0.228f, 0.772f, 0,
+ 1, 1, 1, 1
};
/** Default inversion mode for display color correction. */