• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.ux.material.libmonet.quantize;
18 
19 /** An interface to allow use of different color spaces by quantizers. */
20 public interface PointProvider {
21   /** The four components in the color space of an sRGB color. */
fromInt(int argb)22   public double[] fromInt(int argb);
23 
24   /** The ARGB (i.e. hex code) representation of this color. */
toInt(double[] point)25   public int toInt(double[] point);
26 
27   /**
28    * Squared distance between two colors. Distance is defined by scientific color spaces and
29    * referred to as delta E.
30    */
distance(double[] a, double[] b)31   public double distance(double[] a, double[] b);
32 }
33