|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sunflow.image.ColorEncoder
public final class ColorEncoder
This class contains many static helper methods that may be helpful for encoding colors into files.
Constructor Summary | |
---|---|
ColorEncoder()
|
Method Summary | |
---|---|
static int[] |
encodeRGBE(Color[] color)
Encode the specified colors using Ward's RGBE technique. |
static byte[] |
quantizeRGB8(Color[] color)
Quantize the specified colors to 8-bit RGB format. |
static byte[] |
quantizeRGBA8(Color[] color,
float[] alpha)
Quantize the specified colors to 8-bit RGBA format. |
static Color[] |
unlinearize(Color[] color)
Moves the colors in the specified array to non-linear space. |
static Color[] |
unpremult(Color[] color,
float[] alpha)
Undoes the premultiplication of the specified color array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorEncoder()
Method Detail |
---|
public static final Color[] unpremult(Color[] color, float[] alpha)
color
- an array of premultiplied colorsalpha
- alpha values corresponding to the colors
public static final Color[] unlinearize(Color[] color)
color
- an array of colors in linear space
public static final byte[] quantizeRGB8(Color[] color)
color
- array of colors to quantize
public static final byte[] quantizeRGBA8(Color[] color, float[] alpha)
color
- array of colors to quantizealpha
- array of alpha values (same length as color)
public static final int[] encodeRGBE(Color[] color)
color
- array of colors to encode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |