Class Overview
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)
Summary
Nested Classes |
class |
PaletteBuilder.ColorNode |
The node of color tree. |
Constants |
int |
MAXLEVEL |
maximum of tree depth
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Constants
protected
static
final
int
MAXLEVEL
Constant Value:
8
(0x00000008)
Fields
protected
int
requiredSize
protected
int
transparency
Protected Constructors
Public Methods
public
static
boolean
canCreatePalette
(RenderedImage image)
Returns true
if PaletteBuilder is able to create
palette for given rendered image.
Parameters
image
| an instance of RenderedImage to be
indexed. |
Returns
true
if the PaletteBuilder
is likely to be able to create palette for this image type.
public
static
boolean
canCreatePalette
(ImageTypeSpecifier type)
Returns true
if PaletteBuilder is able to create
palette for given image type.
Parameters
type
| an instance of ImageTypeSpecifier to be
indexed. |
Returns
true
if the PaletteBuilder
is likely to be able to create palette for this image type.
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.
See Also
- createIndexedImage
- canCreatePalette
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.
See Also
- createIndexColorModel
- canCreatePalette
Protected Methods
protected
void
buildPalette
()
protected
int
getBranchIndex
(Color aColor, int aLevel)
protected
void
reduceTree
()