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

Commit d98a07ca authored by John Wu's avatar John Wu Committed by Android (Google) Code Review
Browse files

Merge "[Ravenwood] Enable ColorUtils and c.a.i.graphics.cam" into main

parents baec9e6d 06d0f7cf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.annotation.FloatRange;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.graphics.Color;

import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import com.android.internal.graphics.cam.Cam;

/**
@@ -29,6 +29,7 @@ import com.android.internal.graphics.cam.Cam;
 *
 * A set of color-related utility methods, building upon those available in {@code Color}.
 */
@RavenwoodKeepWholeClass
public final class ColorUtils {

    private static final double XYZ_WHITE_REFERENCE_X = 95.047;
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.graphics.cam;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;

import com.android.internal.graphics.ColorUtils;

@@ -25,6 +26,7 @@ import com.android.internal.graphics.ColorUtils;
 * A color appearance model, based on CAM16, extended to use L* as the lightness dimension, and
 * coupled to a gamut mapping algorithm. Creates a color system, enables a digital design system.
 */
@RavenwoodKeepWholeClass
public class Cam {
    // The maximum difference between the requested L* and the L* returned.
    private static final float DL_MAX = 0.2f;
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.graphics.cam;

import android.annotation.NonNull;
import android.graphics.Color;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;

import com.android.internal.graphics.ColorUtils;

@@ -45,6 +46,7 @@ import com.android.internal.graphics.ColorUtils;
 * consistent, and reasonably good. It worked." - Fairchild, Color Models and Systems: Handbook of
 * Color Psychology, 2015
 */
@RavenwoodKeepWholeClass
public final class CamUtils {
    private CamUtils() {
    }
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.graphics.cam;

import android.annotation.NonNull;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.util.MathUtils;

import com.android.internal.annotations.VisibleForTesting;
@@ -33,6 +34,7 @@ import com.android.internal.annotations.VisibleForTesting;
 * number of calculations during the color => CAM conversion process that depend only on the viewing
 * conditions. Caching those calculations in a Frame instance saves a significant amount of time.
 */
@RavenwoodKeepWholeClass
public final class Frame {
    // Standard viewing conditions assumed in RGB specification - Stokes, Anderson, Chandrasekar,
    // Motta - A Standard Default Color Space for the Internet: sRGB, 1996.
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.graphics.cam;

import android.ravenwood.annotation.RavenwoodKeepWholeClass;

/**
 * An efficient algorithm for determining the closest sRGB color to a set of HCT coordinates,
 * based on geometrical insights for finding intersections in linear RGB, CAM16, and L*a*b*.
@@ -24,6 +26,7 @@ package com.android.internal.graphics.cam;
 * Copied from //java/com/google/ux/material/libmonet/hct on May 22 2022.
 * ColorUtils/MathUtils functions that were required were added to CamUtils.
 */
@RavenwoodKeepWholeClass
public class HctSolver {
    private HctSolver() {}

Loading