Class Cluster
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.clustering.Cluster
A custer of colors, to be used with a
Clusterer.-
Constructor Summary
ConstructorsConstructorDescriptionCluster(int color) Create a cluster containing only the provided color.Cluster(Collection<Integer> colors) Create a cluster containing the provided colors -
Method Summary
-
Constructor Details
-
Cluster
public Cluster(int color) Create a cluster containing only the provided color. -
Cluster
Create a cluster containing the provided colors- Parameters:
colors- the colors to add to the cluster. Must be non-empty- Throws:
IllegalArgumentException- if no colors are provided
-
-
Method Details
-
dist
Calculate the distance between this cluster and another cluster.- Parameters:
other- the other cluster to compare torgb2labCache- a cache to use for converting colors to CIELAB, linked to the lifespan of the parent clusterer- Returns:
- the distance between the two clusters in CIELAB32 space
-
merge
Merges the provided cluster into this cluster. -
getColors
public it.unimi.dsi.fastutil.ints.IntList getColors()- Returns:
- an unmodifiable view of the colors in this cluster
-