Class OFImage

java.lang.Object
  extended by java.awt.Image
      extended by java.awt.image.BufferedImage
          extended by OFImage
All Implemented Interfaces:
java.awt.image.RenderedImage, java.awt.image.WritableRenderedImage, java.awt.Transparency

public class OFImage
extends java.awt.image.BufferedImage

OFImage is a class that defines an image in OF (Objects First) format.

Version:
2.0
Author:
Michael Kölling and David J. Barnes.

Field Summary
 
Fields inherited from class java.awt.image.BufferedImage
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY
 
Fields inherited from class java.awt.Image
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
OFImage(java.awt.image.BufferedImage image)
          Create an OFImage copied from a BufferedImage.
OFImage(int width, int height)
          Create an OFImage with specified size and unspecified content.
 
Method Summary
 java.awt.Color getPixel(int x, int y)
          Get the color value at a specified pixel position.
 void setPixel(int x, int y, java.awt.Color col)
          Set a given pixel of this image to a specified color.
 
Methods inherited from class java.awt.image.BufferedImage
addTileObserver, coerceData, copyData, createGraphics, getAlphaRaster, getColorModel, getData, getData, getGraphics, getHeight, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB, toString
 
Methods inherited from class java.awt.Image
flush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OFImage

public OFImage(java.awt.image.BufferedImage image)
Create an OFImage copied from a BufferedImage.

Parameters:
image - The image to copy.

OFImage

public OFImage(int width,
               int height)
Create an OFImage with specified size and unspecified content.

Parameters:
width - The width of the image.
height - The height of the image.
Method Detail

getPixel

public java.awt.Color getPixel(int x,
                               int y)
Get the color value at a specified pixel position.

Parameters:
x - The x position of the pixel.
y - The y position of the pixel.
Returns:
The color of the pixel at the given position.

setPixel

public void setPixel(int x,
                     int y,
                     java.awt.Color col)
Set a given pixel of this image to a specified color. The color is represented as an (r,g,b) value.

Parameters:
x - The x position of the pixel.
y - The y position of the pixel.
col - The color of the pixel.