OSDN Git Service

Adjust display inversion matrix to account for luminance
authorAlan Viverette <alanv@google.com>
Wed, 29 Apr 2015 00:30:04 +0000 (17:30 -0700)
committerDan Stoza <stoza@google.com>
Wed, 29 Apr 2015 19:26:38 +0000 (12:26 -0700)
Bug: 20346301
Change-Id: I10633705f2bfddbdeec063f9489a4f8679b9e8ee
(cherry picked from commit 6437518061fc8718590e0272ed17ea64710d2299)

services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java

index 38827d0..d0b5898 100644 (file)
@@ -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. */