|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.color.io.PaletteSerialization
public class PaletteSerialization
This class loads and saves palettes.
Loading is done using the ImageLoader
class - an image
is loaded which is supposed to have no more than 256 pixels, the palette entries.
When saving, the PNMCodec
is used to store palettes as .ppm files.
Field Summary |
---|
Fields inherited from interface net.sourceforge.jiu.data.RGBIndex |
---|
INDEX_BLUE, INDEX_GREEN, INDEX_RED |
Method Summary | |
---|---|
static Palette |
convertImageToPalette(RGB24Image image)
Create a palette from the pixels of the argument image. |
static RGB24Image |
convertPaletteToImage(Palette palette)
Creates an RGB24Image from the palette entries, each entry becomes a pixel in an image of width 1 and height palette.getNumEntries(). |
static Palette |
load(File paletteFile)
Loads a palette from the argument file. |
static void |
save(Palette palette,
File paletteFile)
Saves the palette to the given file as a PPM image file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Palette convertImageToPalette(RGB24Image image)
public static RGB24Image convertPaletteToImage(Palette palette)
public static Palette load(File paletteFile)
ImageLoader
to load an
image from the argument file, then calls convertImageToPalette(net.sourceforge.jiu.data.RGB24Image)
and returns the palette created that way.
public static void save(Palette palette, File paletteFile) throws IOException
PNMCodec
.
IOException
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |