public final class CustomPaletteBuilder extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
CustomPaletteBuilder.ColorNode
The node of color tree.
|
Modifier and Type | Field and Description |
---|---|
protected int |
alphaThreshold |
protected int |
currLevel |
protected int |
currSize |
static int |
DEFAULT_ALPHA_TH
Default value for the threshold to decide whether a pixel is opaque (>=) or transparent (<).
|
protected int |
maxLevel
maximum of tree depth
|
protected int |
maxNodes |
protected int |
numBands |
protected int |
numNodes |
protected CustomPaletteBuilder.ColorNode[] |
palette |
protected CustomPaletteBuilder.ColorNode[] |
reduceList |
protected int |
requiredSize |
protected CustomPaletteBuilder.ColorNode |
root |
protected RenderedImage |
src |
protected ColorModel |
srcColorModel |
protected int |
subsampleX |
protected int |
subsampley |
protected CustomPaletteBuilder.ColorNode |
transColor |
protected int |
transparency |
Constructor and Description |
---|
CustomPaletteBuilder(RenderedImage src) |
CustomPaletteBuilder(RenderedImage src,
int size,
int subsx,
int subsy,
int alpha_th) |
Modifier and Type | Method and Description |
---|---|
CustomPaletteBuilder |
buildPalette() |
static boolean |
canCreatePalette(ImageTypeSpecifier type)
Returns
true if PaletteBuilder is able to create palette for given image type. |
static boolean |
canCreatePalette(RenderedImage image)
Returns
true if PaletteBuilder is able to create palette for given rendered
image. |
protected int |
findColorIndex(CustomPaletteBuilder.ColorNode aNode,
int[] rgba,
int transpBand) |
int |
findNearestColorIndex(int[] rgba,
int transparentBand) |
protected int |
findPaletteEntry(CustomPaletteBuilder.ColorNode aNode,
int index,
byte[] red,
byte[] green,
byte[] blue) |
protected CustomPaletteBuilder.ColorNode |
freeTree(CustomPaletteBuilder.ColorNode aNode) |
protected int |
getBranchIndex(int[] rgba,
int aLevel) |
IndexColorModel |
getIndexColorModel() |
RenderedImage |
getIndexedImage() |
protected CustomPaletteBuilder.ColorNode |
insertNode(CustomPaletteBuilder.ColorNode aNode,
int[] rgba,
int aLevel) |
protected void |
reduceTree() |
public static final int DEFAULT_ALPHA_TH
protected int maxLevel
protected RenderedImage src
protected ColorModel srcColorModel
protected int requiredSize
protected CustomPaletteBuilder.ColorNode root
protected int numNodes
protected int maxNodes
protected int currLevel
protected int currSize
protected CustomPaletteBuilder.ColorNode[] reduceList
protected CustomPaletteBuilder.ColorNode[] palette
protected int transparency
protected CustomPaletteBuilder.ColorNode transColor
protected int subsampleX
protected int subsampley
protected int numBands
protected int alphaThreshold
public CustomPaletteBuilder(RenderedImage src)
public CustomPaletteBuilder(RenderedImage src, int size, int subsx, int subsy, int alpha_th)
public static boolean canCreatePalette(ImageTypeSpecifier type)
true
if PaletteBuilder is able to create palette for given image type.type
- an instance of ImageTypeSpecifier
to be indexed.true
if the PaletteBuilder
is likely to be able to create
palette for this image type.IllegalArgumentException
- if type
is null
.public static boolean canCreatePalette(RenderedImage image)
true
if PaletteBuilder is able to create palette for given rendered
image.image
- an instance of RenderedImage
to be indexed.true
if the PaletteBuilder
is likely to be able to create
palette for this image type.IllegalArgumentException
- if image
is null
.public RenderedImage getIndexedImage()
protected int findColorIndex(CustomPaletteBuilder.ColorNode aNode, int[] rgba, int transpBand)
public CustomPaletteBuilder buildPalette()
protected CustomPaletteBuilder.ColorNode insertNode(CustomPaletteBuilder.ColorNode aNode, int[] rgba, int aLevel)
public IndexColorModel getIndexColorModel()
protected int findPaletteEntry(CustomPaletteBuilder.ColorNode aNode, int index, byte[] red, byte[] green, byte[] blue)
protected int getBranchIndex(int[] rgba, int aLevel)
protected void reduceTree()
protected CustomPaletteBuilder.ColorNode freeTree(CustomPaletteBuilder.ColorNode aNode)
public int findNearestColorIndex(int[] rgba, int transparentBand)
Copyright © 1996–2023 Geotools. All rights reserved.