com.sun.jimi.core.raster
Interface JimiRasterImage

All Known Subinterfaces:
BitRasterImage, ByteRasterImage, ChanneledIntRasterImage, IntRasterImage, MutableJimiRasterImage
All Known Implementing Classes:
JimiRasterImageHandle

public abstract interface JimiRasterImage
extends JimiImage

Base abstraction for raster-based JimiImages.

JimiRasterImage provides a uniform interface to raster-based images created with JIMI. Pixel data is made available in RGB format, allowing low-level image access to all images in JIMI.


Field Summary
static int CHANNEL_ALPHA
          Channel constant
static int CHANNEL_BLUE
          Channel constant
static int CHANNEL_GREEN
          Channel constant
static int CHANNEL_RED
          Channel constant
static int UNKNOWN
          Constant indicating unknown width or height.
 
Method Summary
 void getChannelRectangle(int channel, int x, int y, int width, int height, byte[] buffer, int offset, int scansize)
          Get an individual channel of data from a rectangular area.
 java.awt.image.ColorModel getColorModel()
          Get the ColorModel of the image.
 java.awt.image.ImageProducer getCroppedImageProducer(int x, int y, int width, int height)
          Get an ImageProducer for producing a cropped region of the image.
 int getHeight()
          Get the height of the image.
 int getPixelRGB(int x, int y)
          Get a pixel value.
 java.util.Hashtable getProperties()
          Deprecated. use getOptions(), inherited from JimiImage
 void getRectangleARGBChannels(int x, int y, int width, int height, byte[] buffer, int offset, int scansize)
          Get individual channels of image data for a rectangular area.
 void getRectangleRGB(int x, int y, int width, int height, int[] buffer, int offset, int scansize)
          Get a rectangular area of pixel data in RGB data expanded from the ColorModel.
 void getRectangleRGBAChannels(int x, int y, int width, int height, byte[] buffer, int offset, int scansize)
          Get individual channels of image data for a rectangular area.
 void getRectangleRGBChannels(int x, int y, int width, int height, byte[] buffer, int offset, int scansize)
          Get an individual channel of data from a rectangular area.
 void getRowRGB(int y, int[] buffer, int offset)
          Get a row of pixel data in RGB data expanded from the ColorModel.
 int getWidth()
          Get the width of the image.
 void waitInfoAvailable()
          Wait until the image dimensions and ColorModel are known.
 
Methods inherited from interface com.sun.jimi.core.JimiImage
getFactory, getImageProducer, getOptions, isError, setOptions, waitFinished
 

Field Detail

UNKNOWN

public static final int UNKNOWN
Constant indicating unknown width or height.

CHANNEL_ALPHA

public static final int CHANNEL_ALPHA
Channel constant

CHANNEL_RED

public static final int CHANNEL_RED
Channel constant

CHANNEL_GREEN

public static final int CHANNEL_GREEN
Channel constant

CHANNEL_BLUE

public static final int CHANNEL_BLUE
Channel constant
Method Detail

getWidth

public int getWidth()
Get the width of the image.
Returns:
the width, or UNKNOWN if the width has not been set yet

getHeight

public int getHeight()
Get the height of the image.
Returns:
the height, or UNKNOWN if the height has not been set yet

getColorModel

public java.awt.image.ColorModel getColorModel()
Get the ColorModel of the image.
Returns:
the ColorModel, or null if not set yet

getRectangleRGB

public void getRectangleRGB(int x,
                            int y,
                            int width,
                            int height,
                            int[] buffer,
                            int offset,
                            int scansize)
                     throws ImageAccessException
Get a rectangular area of pixel data in RGB data expanded from the ColorModel.
Parameters:
x - x-coord
y - y-coord
width - rectangle width
height - rectangle height
buffer - buffer to copy data into
offset - offset in buffer to start copying at
scansize - buffer scansize

getRowRGB

public void getRowRGB(int y,
                      int[] buffer,
                      int offset)
               throws ImageAccessException
Get a row of pixel data in RGB data expanded from the ColorModel.
Parameters:
y - y-coord
buffer - buffer to copy data into
offset - offset in buffer to start copying at

getPixelRGB

public int getPixelRGB(int x,
                       int y)
                throws ImageAccessException
Get a pixel value.
Parameters:
x - x-coordinate
y - y-coordinate
Returns:
the pixel value, expanded from the ColorModel

getChannelRectangle

public void getChannelRectangle(int channel,
                                int x,
                                int y,
                                int width,
                                int height,
                                byte[] buffer,
                                int offset,
                                int scansize)
                         throws ImageAccessException
Get an individual channel of data from a rectangular area.
Parameters:
channel - the channel, either CHANNEL_ALPHA, CHANNEL_RED, CHANNEL_GREEN, or CHANNEL_BLUE
x - x-coord
y - y-coord
width - rectangle width
height - rectangle height
buffer - buffer to copy data into
offset - offset in buffer to start copying at
scansize - buffer scansize

getRectangleRGBChannels

public void getRectangleRGBChannels(int x,
                                    int y,
                                    int width,
                                    int height,
                                    byte[] buffer,
                                    int offset,
                                    int scansize)
                             throws ImageAccessException
Get an individual channel of data from a rectangular area.
Parameters:
channel - the channel, either CHANNEL_ALPHA, CHANNEL_RED, CHANNEL_GREEN, or CHANNEL_BLUE
x - x-coord
y - y-coord
width - rectangle width
height - rectangle height
buffer - buffer to copy data into
offset - offset in buffer to start copying at
scansize - buffer scansize

getRectangleARGBChannels

public void getRectangleARGBChannels(int x,
                                     int y,
                                     int width,
                                     int height,
                                     byte[] buffer,
                                     int offset,
                                     int scansize)
                              throws ImageAccessException
Get individual channels of image data for a rectangular area. Each pixel is broken up into alpha, red, green, blue components and placed in consecutive bytes of the buffer.
Parameters:
x - x-coordinate
y - y-coordinate
width - rectangle width
height - rectangle height
buffer - buffer to copy data into
offset - offset in buffer to start at
scansize - buffer scansize

getRectangleRGBAChannels

public void getRectangleRGBAChannels(int x,
                                     int y,
                                     int width,
                                     int height,
                                     byte[] buffer,
                                     int offset,
                                     int scansize)
                              throws ImageAccessException
Get individual channels of image data for a rectangular area. Each pixel is broken up into red, green, blue, alpha components and placed in consecutive bytes of the buffer.
Parameters:
x - x-coordinate
y - y-coordinate
width - rectangle width
height - rectangle height
buffer - buffer to copy data into
offset - offset in buffer to start at
scansize - buffer scansize

getProperties

public java.util.Hashtable getProperties()
Deprecated. use getOptions(), inherited from JimiImage

waitInfoAvailable

public void waitInfoAvailable()
Wait until the image dimensions and ColorModel are known.

getCroppedImageProducer

public java.awt.image.ImageProducer getCroppedImageProducer(int x,
                                                            int y,
                                                            int width,
                                                            int height)
Get an ImageProducer for producing a cropped region of the image.
Parameters:
x - x-coordinate
y - y-coordinate
width - region width
height - region height