Class BMPData

java.lang.Object
  |
  +--BMPData

public class BMPData
extends java.lang.Object

Used by the codec to store BMP raster data. This class also contains some simple rip functions.

See Also:
BMPEncoder, BMPDecoder

Method Summary
static int[] flipImageData(int[] values, int width, int height)
          Flips image data between standard order (top-down) and BMP order (bottom-up).
 int[] getColPal()
          Returns the palette color array of the BMP Raster.
 int getDataType()
          Returns a value equal to the bits/pixel of the raster data.
 int getHeight()
          Returns the height of the BMP Raster.
 int[] getPixelData()
          Returns the pixel-data array of the BMP Raster.
 int getWidth()
          Returns the width of the BMP Raster.
static BMPData make(int[] pixdat, int[] pal, int width, int height)
          Creates a new BMPData object from user data.
static BMPData rip1i(java.awt.Image src, java.awt.Component comp)
          Rips image data from a java.awt.Image object and creates a new 1bit BMPData object.
static BMPData rip24(java.awt.Image src, java.awt.Component comp)
          Rips image data from a java.awt.Image object and creates a new 24bit BMPData object.
static BMPData rip4i(java.awt.Image src, java.awt.Component comp)
          Rips image data from a java.awt.Image object and creates a new 4bit BMPData object.
static BMPData rip8i(java.awt.Image src, java.awt.Component comp)
          Rips image data from a java.awt.Image object and creates a new 8bit BMPData object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataType

public int getDataType()
Returns a value equal to the bits/pixel of the raster data.

getPixelData

public int[] getPixelData()
Returns the pixel-data array of the BMP Raster.

getColPal

public int[] getColPal()
Returns the palette color array of the BMP Raster.

getHeight

public int getHeight()
Returns the height of the BMP Raster.

getWidth

public int getWidth()
Returns the width of the BMP Raster.

rip24

public static BMPData rip24(java.awt.Image src,
                            java.awt.Component comp)
                     throws BMPCodecException
Rips image data from a java.awt.Image object and creates a new 24bit BMPData object.

rip8i

public static BMPData rip8i(java.awt.Image src,
                            java.awt.Component comp)
                     throws BMPCodecException
Rips image data from a java.awt.Image object and creates a new 8bit BMPData object.

rip4i

public static BMPData rip4i(java.awt.Image src,
                            java.awt.Component comp)
                     throws BMPCodecException
Rips image data from a java.awt.Image object and creates a new 4bit BMPData object.

rip1i

public static BMPData rip1i(java.awt.Image src,
                            java.awt.Component comp)
                     throws BMPCodecException
Rips image data from a java.awt.Image object and creates a new 1bit BMPData object.

make

public static BMPData make(int[] pixdat,
                           int[] pal,
                           int width,
                           int height)
                    throws BMPCodecException
Creates a new BMPData object from user data.
Note: Pixel data must be provided in BMP-Order
See Also:
flipImageData(int[],int,int)

flipImageData

public static int[] flipImageData(int[] values,
                                  int width,
                                  int height)
Flips image data between standard order (top-down) and BMP order (bottom-up).
Note: The array passed to this function is never directly changed in any way. The new data is the returned array.