com.sun.jimi.core.raster
Interface IntRasterImage

All Known Subinterfaces:
ChanneledIntRasterImage

public abstract interface IntRasterImage
extends MutableJimiRasterImage

Int-based image representation.


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
 
Fields inherited from class com.sun.jimi.core.raster.JimiRasterImage
CHANNEL_ALPHA, CHANNEL_BLUE, CHANNEL_GREEN, CHANNEL_RED, UNKNOWN
 
Method Summary
 int[] asIntArray()
          Return a representation of the image in an int array.
 void getChannelRectangle(int channel, int x, int y, int width, int height, byte[] buffer, int offset, int scansize)
          Get a rectangular area of pixel data for a single byte channel of the image.
 void getChannelRow(int channel, int y, byte[] buffer, int offset)
          Get a row of pixel data for a single byte channel of the image.
 int getPixel(int x, int y)
          Get a pixel.
 void getRectangle(int x, int y, int width, int height, int[] buffer, int offset, int scansize)
          Get a rectangular area of pixel data.
 void getRow(int y, int[] buffer, int offset)
          Get a row of pixel data.
 void setPixel(int x, int y, int value)
          Set a pixel.
 void setRectangle(int x, int y, int width, int height, int[] pixels, int offset, int scansize)
          Set a rectangular area of pixel data.
 void setRow(int y, int[] pixels, int offset)
          Set a row of pixel data.
 
Methods inherited from interface com.sun.jimi.core.raster.JimiRasterImage
getColorModel, getCroppedImageProducer, getHeight, getPixelRGB, getProperties, getRectangleARGBChannels, getRectangleRGB, getRectangleRGBAChannels, getRectangleRGBChannels, getRowRGB, getWidth, waitInfoAvailable
 
Methods inherited from interface com.sun.jimi.core.MutableJimiImage
mustWaitForOptions, setDecodingController, setError, setFinished, setImageConsumerHints, setOptions, setWaitForOptions
 

Field Detail

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

setRectangle

public void setRectangle(int x,
                         int y,
                         int width,
                         int height,
                         int[] pixels,
                         int offset,
                         int scansize)
                  throws ImageAccessException
Set a rectangular area of pixel data.
Parameters:
x - x-coordinate
y - y-coordinate
width - rectangle width
height - rectangle height
pixels - pixel data
offset - offset in pixels to start at
scansize - length from the start of one row to the start of the next
Throws:
ImageAccessException - if an error prevents image from being accessed

setRow

public void setRow(int y,
                   int[] pixels,
                   int offset)
            throws ImageAccessException
Set a row of pixel data.
Parameters:
y - y-coordinate
pixels - pixel data
offset - offset in pixels to start at
Throws:
ImageAccessException - if an error prevents image from being accessed

setPixel

public void setPixel(int x,
                     int y,
                     int value)
              throws ImageAccessException
Set a pixel.
Parameters:
x - x-coordinate
y - y-coordinate
value - pixel value
Throws:
ImageAccessException - if an error prevents image from being accessed

getRectangle

public void getRectangle(int x,
                         int y,
                         int width,
                         int height,
                         int[] buffer,
                         int offset,
                         int scansize)
                  throws ImageAccessException
Get a rectangular area of pixel data.
Parameters:
x - x-coordinate
y - y-coordinate
width - rectangle width
height - rectangle height
buffer - buffer to copy pixel data into
offset - offset in buffer to start copying to
scansize - length from the start of one row to the start of the next in buffer
Throws:
ImageAccessException - if an error prevents image from being accessed

getRow

public void getRow(int y,
                   int[] buffer,
                   int offset)
            throws ImageAccessException
Get a row of pixel data.
Parameters:
y - y-coordinate
buffer - buffer to copy pixel data into
offset - offset in buffer to start copying to
Throws:
ImageAccessException - if an error prevents image from being accessed

getPixel

public int getPixel(int x,
                    int y)
             throws ImageAccessException
Get a pixel.
Parameters:
x - x-coordinate
y - y-coordinate
Returns:
the value of the pixel at (x, y)
Throws:
ImageAccessException - if an error prevents image from being accessed

getChannelRectangle

public void getChannelRectangle(int channel,
                                int x,
                                int y,
                                int width,
                                int height,
                                byte[] buffer,
                                int offset,
                                int scansize)
                         throws ImageAccessException
Get a rectangular area of pixel data for a single byte channel of the image. Channels use the standard AARRGGBB mask, where ALPHA/RED/GREEN/BLUE represent the position of the data though the actual ARGB interpretation if handled by the ColorModel. The channel of data returned thus may not represent the color component suggested by the channel label.
Parameters:
channel - the channel to read, either CHANNEL_ALPHA, CHANNEL_RED, CHANNEL_GREEN, or CHANNEL_BLUE
x - x-coordinate
y - y-coordinate
width - rectangle width
height - rectangle height
buffer - buffer to copy pixel data into
offset - offset in buffer to start copying to
scansize - length from the start of one row to the start of the next in buffer
Throws:
ImageAccessException - if an error prevents image from being accessed

getChannelRow

public void getChannelRow(int channel,
                          int y,
                          byte[] buffer,
                          int offset)
                   throws ImageAccessException
Get a row of pixel data for a single byte channel of the image. Channels use the standard AARRGGBB mask, where ALPHA/RED/GREEN/BLUE represent the position of the data though the actual ARGB interpretation if handled by the ColorModel. The channel of data returned thus may not represent the color component suggested by the channel label.
Parameters:
channel - the channel to read, either CHANNEL_ALPHA, CHANNEL_RED, CHANNEL_GREEN, or CHANNEL_BLUE
y - y-coordinate
buffer - the buffer to copy into
offset - offset in buffer to start copying to
Throws:
ImageAccessException - if an error prevents image from being accessed

asIntArray

public int[] asIntArray()
Return a representation of the image in an int array. Pixels should be ordered TDLR, with a scansize equal to the image width.
Returns:
an array of image pixels, or null if not appropriate (e.g., VMM and too large to fit in memory)