Class AmigaHAMColorModel

All Implemented Interfaces:
Transparency

public class AmigaHAMColorModel extends DirectColorModel
ColorModel for HAM compressed images.
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
  • 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.