Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
MedianCut Class Reference

Public Member Functions

 MedianCut (int[] pixels, int width, int height)
 
 MedianCut (ColorProcessor ip)
 
Image convert (int maxcubes)
 
ImageProcessor convertToByte (int maxcubes)
 

Detailed Description

Converts an RGB image to 8-bit index color using Heckbert's median-cut color quantization algorithm. Based on median.c by Anton Kruger from the September, 1994 issue of Dr. Dobbs Journal.

Definition at line 11 of file MedianCut.java.

Member Function Documentation

Image convert ( int  maxcubes)
inline
Uses Heckbert's median-cut algorithm to divide the color space defined by

"hist" into "maxcubes" cubes. The centroids (average value) of each cube are are used to create a color table. "hist" is then updated to function as an inverse color map that is used to generate an 8-bit image.

Definition at line 91 of file MedianCut.java.

ImageProcessor convertToByte ( int  maxcubes)
inline

This is a version of convert that returns a ByteProcessor.

Definition at line 97 of file MedianCut.java.


The documentation for this class was generated from the following file: