|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdeadbeef.SupTools.Palette
public class Palette
Palette class for mixed representation of RGB/YCbCr palettes with alpha information.
Constructor Summary | |
---|---|
Palette(byte[] red,
byte[] green,
byte[] blue,
byte[] alpha)
Ctor - construct palette from red, green blue and alpha buffers |
|
Palette(byte[] red,
byte[] green,
byte[] blue,
byte[] alpha,
boolean use601)
Ctor - construct palette from red, green blue and alpha buffers |
|
Palette(int palSize)
Ctor - initializes palette with transparent black (RGBA: 0x00000000) |
|
Palette(int palSize,
boolean use601)
Ctor - initializes palette with transparent black (RGBA: 0x00000000) |
|
Palette(Palette p)
Ctor - construct new (independent) palette from existing one |
Method Summary | |
---|---|
byte[] |
getAlpha()
Return byte array of alpha channel components |
int |
getAlpha(int index)
Get alpha channel |
int |
getARGB(int index)
Return palette entry at index as Integer in ARGB format |
byte[] |
getB()
Return byte array of blue components |
byte[] |
getCb()
Return byte array of Cb components |
java.awt.Color |
getColor(int index)
Return palette entry at index as Color |
java.awt.image.ColorModel |
getColorModel()
Construct ColorModel from internal data |
java.awt.Color[] |
getColors()
Return whole palette as array of Colors |
byte[] |
getCr()
Return byte array of Cr components |
byte[] |
getG()
Return byte array of green components |
byte[] |
getR()
Return byte array of red components |
int[] |
getRGB(int index)
Get Integer array containing 8bit red, green, blue components (in this order) |
int |
getSize()
Get size of palette (number of entries) |
int |
getTransparentIndex()
Return index of most transparent palette entry or the index of the first completely transparent color |
byte[] |
getY()
Return byte array of Y components |
int[] |
getYCbCr(int index)
Get Integer array containing 8bit Y, Cb, Cr components (in this order) |
void |
setAlpha(int index,
int alpha)
Set alpha channel |
void |
setARGB(int index,
int c)
Set palette index "index" to color "c" in ARGB format |
void |
setColor(int index,
java.awt.Color c)
Set palette index "index" to color "c" |
void |
setRGB(int index,
int red,
int green,
int blue)
Set palette entry (RGB mode) |
void |
setYCbCr(int index,
int yn,
int cbn,
int crn)
Set palette entry (YCbCr mode) |
boolean |
usesBT601()
Get: use of BT.601 color model instead of BT.709 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Palette(int palSize, boolean use601)
palSize
- Number of palette entriesuse601
- Use BT.601 instead of BT.709public Palette(int palSize)
palSize
- Number of palette entriespublic Palette(byte[] red, byte[] green, byte[] blue, byte[] alpha, boolean use601)
red
- Byte buffer containing the red componentsgreen
- Byte buffer containing the green componentsblue
- Byte buffer containing the blue componentsalpha
- Byte buffer containing the alpha componentsuse601
- Use BT.601 instead of BT.709public Palette(byte[] red, byte[] green, byte[] blue, byte[] alpha)
red
- Byte buffer containing the red componentsgreen
- Byte buffer containing the green componentsblue
- Byte buffer containing the blue componentsalpha
- Byte buffer containing the alpha componentspublic Palette(Palette p)
p
- Palette to copy values fromMethod Detail |
---|
public java.awt.image.ColorModel getColorModel()
public void setColor(int index, java.awt.Color c)
index
- Palette indexc
- Colorpublic void setARGB(int index, int c)
index
- Palette indexc
- Color in ARGB formatpublic java.awt.Color getColor(int index)
index
- Palette index
public int getARGB(int index)
index
- Palette index
public java.awt.Color[] getColors()
public void setRGB(int index, int red, int green, int blue)
index
- Palette indexred
- 8bit red componentgreen
- 8bit green componentblue
- 8bit blue componentpublic void setYCbCr(int index, int yn, int cbn, int crn)
index
- Palette indexyn
- 8bit Y componentcbn
- 8bit Cb componentcrn
- 8bit Cr componentpublic void setAlpha(int index, int alpha)
index
- Palette indexalpha
- 8bit alpha channel valuepublic int getAlpha(int index)
index
- Palette index
public byte[] getAlpha()
public int[] getRGB(int index)
index
- Palette index
public int[] getYCbCr(int index)
index
- Palette index
public byte[] getR()
public byte[] getG()
public byte[] getB()
public byte[] getY()
public byte[] getCb()
public byte[] getCr()
public int getSize()
public int getTransparentIndex()
public boolean usesBT601()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |