Package bdsup2sub.bitmap
Class Palette
java.lang.Object
bdsup2sub.bitmap.Palette
Palette class for mixed representation of RGB/YCbCr palettes with alpha information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
Byte buffer for alpha infoprivate final byte[]
Byte buffer for BLUE infoprivate final byte[]
Byte buffer for Cb (chrominance blue) infoprivate final byte[]
Byte buffer for Cr (chrominance red) infoprivate final byte[]
Byte buffer for GREEN infoprivate final byte[]
Byte buffer for RED infoprivate final int
Number of palette entriesprivate final boolean
Use BT.601 color model instead of BT.709private final byte[]
Byte buffer for Y (luminance) info -
Constructor Summary
ConstructorsConstructorDescriptionPalette
(byte[] red, byte[] green, byte[] blue, byte[] alpha) Constructs a palette from red, green blue and alpha buffers using BT.709Palette
(byte[] red, byte[] green, byte[] blue, byte[] alpha, boolean useBT601) Palette
(int size) Initializes a palette with transparent black (RGBA: 0x00000000)Palette
(int size, boolean useBT601) Initializes palette with transparent black (RGBA: 0x00000000) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getAlpha()
int
getAlpha
(int index) int
getARGB
(int index) byte[]
getB()
byte[]
getCb()
getColor
(int index) byte[]
getCr()
byte[]
getG()
int
byte[]
getR()
int[]
getRGB
(int index) int
getSize()
byte[]
getY()
int[]
getYCbCr
(int index) void
setAlpha
(int index, int alpha) void
setARGB
(int index, int c) void
void
setRGB
(int index, int red, int green, int blue) void
setYCbCr
(int index, int yn, int cbn, int crn) boolean
-
Field Details
-
size
private final int sizeNumber of palette entries -
r
private final byte[] rByte buffer for RED info -
g
private final byte[] gByte buffer for GREEN info -
b
private final byte[] bByte buffer for BLUE info -
a
private final byte[] aByte buffer for alpha info -
y
private final byte[] yByte buffer for Y (luminance) info -
cb
private final byte[] cbByte buffer for Cb (chrominance blue) info -
cr
private final byte[] crByte buffer for Cr (chrominance red) info -
useBT601
private final boolean useBT601Use BT.601 color model instead of BT.709
-
-
Constructor Details
-
Palette
public Palette(int size, boolean useBT601) Initializes palette with transparent black (RGBA: 0x00000000)- Parameters:
size
- Number of palette entries
-
Palette
public Palette(int size) Initializes a palette with transparent black (RGBA: 0x00000000) -
Palette
public Palette(byte[] red, byte[] green, byte[] blue, byte[] alpha, boolean useBT601) -
Palette
public Palette(byte[] red, byte[] green, byte[] blue, byte[] alpha) Constructs a palette from red, green blue and alpha buffers using BT.709 -
Palette
-
-
Method Details
-
getColorModel
-
setColor
-
setARGB
public void setARGB(int index, int c) -
getColor
-
getARGB
public int getARGB(int index) -
setRGB
public void setRGB(int index, int red, int green, int blue) -
setYCbCr
public void setYCbCr(int index, int yn, int cbn, int crn) -
setAlpha
public void setAlpha(int index, int alpha) -
getAlpha
public int getAlpha(int index) -
getAlpha
public byte[] getAlpha() -
getRGB
public int[] getRGB(int index) -
getYCbCr
public int[] getYCbCr(int index) -
getR
public byte[] getR() -
getG
public byte[] getG() -
getB
public byte[] getB() -
getY
public byte[] getY() -
getCb
public byte[] getCb() -
getCr
public byte[] getCr() -
getSize
public int getSize() -
getIndexOfMostTransparentPaletteEntry
public int getIndexOfMostTransparentPaletteEntry() -
usesBT601
public boolean usesBT601()
-