| java.lang.Object com.sun.media.imageioimpl.common.PaletteBuilder
PaletteBuilder | public class PaletteBuilder (Code) | | This class implements the octree quantization method
as it is described in the "Graphics Gems"
(ISBN 0-12-286166-3, Chapter 4, pages 297-293)
|
Inner Class :protected class ColorNode | |
MAXLEVEL | final protected static int MAXLEVEL(Code) | | maximum of tree depth
|
currLevel | protected int currLevel(Code) | | |
currSize | protected int currSize(Code) | | |
maxNodes | protected int maxNodes(Code) | | |
numNodes | protected int numNodes(Code) | | |
palette | protected ColorNode[] palette(Code) | | |
reduceList | protected ColorNode[] reduceList(Code) | | |
requiredSize | protected int requiredSize(Code) | | |
root | protected ColorNode root(Code) | | |
src | protected RenderedImage src(Code) | | |
srcRaster | protected Raster srcRaster(Code) | | |
transColor | protected ColorNode transColor(Code) | | |
transparency | protected int transparency(Code) | | |
PaletteBuilder | protected PaletteBuilder(RenderedImage src)(Code) | | |
PaletteBuilder | protected PaletteBuilder(RenderedImage src, int size)(Code) | | |
buildPalette | protected void buildPalette()(Code) | | |
canCreatePalette | public static boolean canCreatePalette(ImageTypeSpecifier type)(Code) | | Returns true if PaletteBuilder is able to create
palette for given image type.
Parameters: type - an instance of ImageTypeSpecifier to beindexed. true if the PaletteBuilder is likely to be able to create palette for this image type. exception: IllegalArgumentException - if type is null . |
canCreatePalette | public static boolean canCreatePalette(RenderedImage image)(Code) | | Returns true if PaletteBuilder is able to create
palette for given rendered image.
Parameters: image - an instance of RenderedImage to beindexed. true if the PaletteBuilder is likely to be able to create palette for this image type. exception: IllegalArgumentException - if image is null . |
createIndexColorModel | public static IndexColorModel createIndexColorModel(RenderedImage img)(Code) | | Creates an palette representing colors from given image
img . If number of colors in the given image exceeds
maximum palette size closest colors would be merged.
exception: IllegalArgumentException - if img isnull . exception: UnsupportedOperationException - if implemented methodis unable to create approximation of img and canCreatePalette returns false . See Also: createIndexedImage See Also: canCreatePalette |
createIndexedImage | public static RenderedImage createIndexedImage(RenderedImage src)(Code) | | Creates an image representing given image
src using IndexColorModel.
Lossless conversion is not always possible (e.g. if number
of colors in the given image exceeds maximum palette size).
Result image then is an approximation constructed by octree
quantization method.
exception: IllegalArgumentException - if src isnull . exception: UnsupportedOperationException - if implemented methodis unable to create approximation of src and canCreatePalette returns false . See Also: createIndexColorModel See Also: canCreatePalette |
findColorIndex | protected int findColorIndex(ColorNode aNode, Color aColor)(Code) | | |
findPaletteEntry | protected int findPaletteEntry(ColorNode aNode, int index, byte[] red, byte[] green, byte[] blue)(Code) | | |
freeTree | protected ColorNode freeTree(ColorNode aNode)(Code) | | |
getBranchIndex | protected int getBranchIndex(Color aColor, int aLevel)(Code) | | |
getIndexedImage | protected RenderedImage getIndexedImage()(Code) | | |
insertNode | protected ColorNode insertNode(ColorNode aNode, Color aColor, int aLevel)(Code) | | |
reduceTree | protected void reduceTree()(Code) | | |
|
|