public class ImageHistogram extends Object implements Measurable
T-Plan Robot Enterprise, (C) 2009-2025 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
ImageHistogram() |
Modifier and Type | Method and Description |
---|---|
long |
getLength() |
void |
getMajorColors(int[] c)
Get major colors.
|
int |
getMinAlpha() |
void |
getMinorColors(int[] c)
Get minor colors.
|
int |
getNumberOfComparablePixels() |
Map<Integer,int[]> |
getPointers() |
float |
getProgress()
Get the task progress where 0 means "0% done" and 1 means "100% done".
|
int[] |
getSortedListOfColors(int maxColors)
Return an array of colors sorted descending based on pixel count.
|
List<Integer> |
getSortedListOfMajorColors(int maxColors)
Return an array of colors sorted ascending based on pixel count.
|
ImageHistogram |
load(Image img,
Rectangle rect) |
ImageHistogram |
load(int[] pixels) |
ImageHistogram |
load(int[] pixels,
Rectangle histRect,
Rectangle sourceRect) |
void |
setMinAlpha(int minAlpha) |
String |
toString() |
public long getLength()
public ImageHistogram load(Image img, Rectangle rect)
public ImageHistogram load(int[] pixels)
public ImageHistogram load(int[] pixels, Rectangle histRect, Rectangle sourceRect)
public List<Integer> getSortedListOfMajorColors(int maxColors)
maxColors
- maximum length of the array.public int[] getSortedListOfColors(int maxColors)
maxColors
- maximum length of the array.public float getProgress()
Measurable
getProgress
in interface Measurable
public int getNumberOfComparablePixels()
public int getMinAlpha()
public void setMinAlpha(int minAlpha)
minAlpha
- the minAlpha to setpublic void getMinorColors(int[] c)
c
- array to store the minor (low occurrence) colors to.public void getMajorColors(int[] c)
c
- array to store the major (high occurrence) colors to.