Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0caac281 authored by Christine Franks's avatar Christine Franks Committed by android-build-merger
Browse files

Merge "DO NOT MERGE - Update night display coefficients" into oc-dr1-dev

am: bdaada0a

Change-Id: I1b15ab6395b4935d1169246d42fa0a6f0c588a3d
parents 400f0920 bdaada0a
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -111,11 +111,7 @@ public final class NightDisplayService extends SystemService
    private float[] mMatrixNight = new float[16];
    private float[] mMatrixNight = new float[16];


    /**
    /**
     *  These coefficients were generated by an LLS quadratic regression fitted to the
     *  The 3x3 color transformation matrix is formatted like so:
     *  overdetermined system based on experimental readings (and subsequent conversion from xy
     *  chromaticity coordinates to gamma-corrected RGB values): { (temperature, R, G, B) } ->
     *  { (7304, 1.0, 1.0, 1.0), (4082, 1.0, 0.857, 0.719), (2850, 1.0, .754, .516),
     *  (2596, 1.0, 0.722, 0.454) }. The 3x3 matrix is formatted like so:
     *  <table>
     *  <table>
     *      <tr><td>R: a coefficient</td><td>G: a coefficient</td><td>B: a coefficient</td></tr>
     *      <tr><td>R: a coefficient</td><td>G: a coefficient</td><td>B: a coefficient</td></tr>
     *      <tr><td>R: b coefficient</td><td>G: b coefficient</td><td>B: b coefficient</td></tr>
     *      <tr><td>R: b coefficient</td><td>G: b coefficient</td><td>B: b coefficient</td></tr>
@@ -123,9 +119,9 @@ public final class NightDisplayService extends SystemService
     *  </table>
     *  </table>
     */
     */
    private static final float[] mColorTempCoefficients = new float[] {
    private static final float[] mColorTempCoefficients = new float[] {
            0.0f, -0.00000000962353339f, -0.0000000189359041f,
            0.0f, -0.0000000871377221f, -0.0000000753960646f,
            0.0f, 0.000153045476f, 0.000302412211f,
            0.0f, 0.000750142586f, .000725567598f,
            1.0f, 0.390782778f, -0.198650895f
            1.0f, -.830130222f, -1.15546312f
    };
    };


    private int mCurrentUser = UserHandle.USER_NULL;
    private int mCurrentUser = UserHandle.USER_NULL;
@@ -410,7 +406,7 @@ public final class NightDisplayService extends SystemService
            return;
            return;
        }
        }


        Matrix.setIdentityM(mMatrixNight, 0);
        Matrix.setIdentityM(outTemp, 0);


        final float squareTemperature = colorTemperature * colorTemperature;
        final float squareTemperature = colorTemperature * colorTemperature;
        final float red = squareTemperature * mColorTempCoefficients[0]
        final float red = squareTemperature * mColorTempCoefficients[0]