java.lang.Object
java.awt.image.ColorModel
java.awt.image.PackedColorModel
java.awt.image.DirectColorModel
org.monte.media.amigabitmap.AmigaHAMColorModel
- All Implemented Interfaces:
Transparency
ColorModel for HAM compressed images.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprotected intprotected intprotected booleanprotected int[]Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferTypeFields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionAmigaHAMColorModel(int aHAMType, int size, byte[] r, byte[] g, byte[] b, boolean isOCS) Creates a new HAM Color model using the specified base colors.AmigaHAMColorModel(int aHAMType, int size, int[] rgb, boolean isOCS) Creates a new HAM Color model using the specified base colors. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidgetBlues(byte[] b) Copies the array of blue color components into the given array.intgetDepth()Returns the number of planes required to represent this AmigaHAMColorModel in a Bitmap.final voidgetGreens(byte[] g) Copies the array of green color components into the given array.intReturns the HAM Type of this AmigaHAMColorModel: HAM8 or HAM6.final intReturns the size of the color component arrays in this IndexColorModel.final voidgetReds(byte[] r) Copies the array of red color components into the given array.final voidgetRGBs(int[] rgbs) Copies the array of color components into the given array.protected voidsetRGBs(int size, byte[] r, byte[] g, byte[] b, byte[] a) Sets the HAM base colors.Methods inherited from class java.awt.image.DirectColorModel
coerceData, createCompatibleWritableRaster, getAlpha, getAlpha, getAlphaMask, getBlue, getBlue, getBlueMask, getComponents, getComponents, getDataElement, getDataElements, getDataElements, getGreen, getGreen, getGreenMask, getRed, getRed, getRedMask, getRGB, getRGB, isCompatibleRaster, toStringMethods inherited from class java.awt.image.PackedColorModel
createCompatibleSampleModel, equals, getAlphaRaster, getMask, getMasks, hashCode, isCompatibleSampleModelMethods inherited from class java.awt.image.ColorModel
getColorSpace, getComponentSize, getComponentSize, getDataElement, getDataElements, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied
-
Field Details
-
HAM6
public static final int HAM6- See Also:
-
HAM8
public static final int HAM8- See Also:
-
HAMType
protected int HAMType -
map_size
protected int map_size -
opaque
protected boolean opaque -
rgb
protected int[] rgb
-
-
Constructor Details
-
AmigaHAMColorModel
public AmigaHAMColorModel(int aHAMType, int size, byte[] r, byte[] g, byte[] b, boolean isOCS) Creates a new HAM Color model using the specified base colors.- Parameters:
aHAMType- Type, must be HAM6 or HAM 8.size- The size of the color palette.r- The red colors as 8 bit or as 4 bit values.g- The green colors as 8 bit or as 4 bit values.b- The blue colors as 8 bit or as 4 bit values.isOCS- Set this to true if the colors are 4 bit values.
-
AmigaHAMColorModel
public AmigaHAMColorModel(int aHAMType, int size, int[] rgb, boolean isOCS) Creates a new HAM Color model using the specified base colors.- Parameters:
aHAMType- Type, must be HAM6 or HAM 8.size- The size of the color palette.rgb- The rgb colors.isOCS- Set this to true if the colors are 12 bit precision only.
-
-
Method Details
-
getHAMType
public int getHAMType()Returns the HAM Type of this AmigaHAMColorModel: HAM8 or HAM6. -
getDepth
public int getDepth()Returns the number of planes required to represent this AmigaHAMColorModel in a Bitmap. -
setRGBs
protected void setRGBs(int size, byte[] r, byte[] g, byte[] b, byte[] a) Sets the HAM base colors.- Parameters:
size- The size of the color palette.r- The red colors as 8 bit values.g- The green colors as 8 bit values.b- The blue colors as 8 bit values.a- The alpha channels as 8 bit values.
-
getReds
public final void getReds(byte[] r) Copies the array of red color components into the given array. Only the initial entries of the array as specified by getMapSize() are written. -
getGreens
public final void getGreens(byte[] g) Copies the array of green color components into the given array. Only the initial entries of the array as specified by getMapSize() are written. -
getBlues
public final void getBlues(byte[] b) Copies the array of blue color components into the given array. Only the initial entries of the array as specified by getMapSize() will be written. -
getRGBs
public final void getRGBs(int[] rgbs) Copies the array of color components into the given array. Only the initial entries of the array as specified by getMapSize() will be written. -
getMapSize
public final int getMapSize()Returns the size of the color component arrays in this IndexColorModel.
-