CONTENTS | PREV | NEXT Java 2D API



CHAPTER 5

Images

Image processing involves the manipulation of raster images, often to improve visual appearance or bring out subtle shapes and patterns that might otherwise escape visual detection. Any of the image processing effects provided in popular photo-editing programs can be produced using the Java 2D API image-processing classes, or by extending those classes.


5.0.1 Interfaces




Interface

Description

BufferedImageOp

Describes single-input/single-output operations performed on BufferedImage objects. Implemented by AffineTransformOp, ConvolveOp, RescaleOp, and ThresholdOp.

ImagingLib

Defines an interface for accessing platform-specific imaging code.

RasterImageConsumer

Interface for objects expressing interest in image data through the ImageProducer interfaces. Implemented by BufferedImageFilter.

RasterOp

Defines single-input/single-output operations performed on Raster objects. Implemented by AffineTransformOp, ConvolveOp, and LookupOp.

RenderedImage

Defines a common protocol for objects that contain or can produce image data in the form of Rasters.

WriteableRenderedImage

Extends: RenderedImage

Defines a common protocol for objects that contain or can produce image data that can be modified.

TileChangeListener

Defines a protocol for objects that want to be notified when the modification state of a WriteableRenderedImage changes.


5.0.2 Image Data Classes




Class

Description

BufferedImage

Extends: Image

Implements: WriteableRenderedImage

An image with an accessible data buffer. A BufferedImage has a ColorModel and a Raster of image data.

ByteLookupTable

Extends: LookupTable

A lookup table that contains byte data for one or more rasters or image components.

DataBuffer

Wraps one or more data arrays. Each data array is called a bank.

DataBufferByte

Extends: DataBuffer

A data buffer that stores bytes of data.

DataBufferInt

Extends: DataBuffer

A data buffer that stores integer data.

DataBufferShort

Extends: DataBuffer

A data buffer that stores short data.

Kernel

A Kernel is a matrix that describes how a particular pixel and its surrounding pixels affect the value of the pixel specified in a filtering operation.

LookupTable

Extends: Object

A lookup table maps values from one or more channels of raster values to color components.

Raster

A rectangular array of pixels from which you can retrieve image data. A Raster contains a DataBuffer and a SampleModel.

ShortLookupTable

Extends: LookupTable

A lookup table that contains short data for one or more rasters or image components.

WriteableRaster

Extends: Raster

A Raster that you can modify.

TileChangeMulticaster

A convenience class that manages the details of implementing the TileChangeListener protocol.


5.0.3 Image Filter Classes




Class

Description

AreaAveragingScaleFilter

Extends: ReplicateScaleFilter

JDK1.1 class. An ImageFilter for scaling images using a simple area averaging algorithm. This algorithm produces smoother results than the nearest-neighbor algorithm.

BufferedImageFilter

Extends: ImageFilter

An ImageFilter that provides a simple means of using a BufferedImageOp (a single-source/single-destination image operator) to filter a BufferedImage or Raster.

CropImageFilter

Extends: ImageFilter

JDK1.1 class. An ImageFilter class for cropping images.

ImageFilter

Implements: ImageConsumer

JDK1.1 class. An ImageFilter is used in conjunction with a FilteredImageSource object to produce a filtered version of an existing image. This base class implements a filter for the set of interface methods that are used to deliver data from an ImageProducer to an ImageConsumer.

ReplicateScaleFilter

Extends: ImageFilter

JDK1.1 class. An ImageFilter class for scaling images. Implements the simplest scaling algorithm.

RGBImageFilter

Extends: ImageFilter

JDK1.1 class. An abstract class that provides an easy way to create an ImageFilter that modifies the pixels of an image in the default RGB ColorModel.


5.0.4 Image Operation Classes




Class

Description

AffineTransformOp

Implements: BufferedImageOp, RasterOp

An abstract class that defines the protocol for using an affine transform to perform a linear mapping from 2D coordinates in a source Image or Raster to 2D coordinates in the destination image or Raster. Subclasses define what kind of interpolation is done when the image is transformed.

BandCombineOp

Implements: RasterOp

Using a specified matrix, this operation performs an arbitrary linear combination of bands in a Raster.

BilinearAffineTransformOp

Extends: AffineTransformOp

Transforms an Image or Raster using an affine transform with bilinear interpolation.

ColorConvertOp

Implements: BufferedImageOp, RasterOp

Performs a pixel-by-pixel color conversion of the data in the source image.

ConvolveOp

Uses a Kernel to perform a convolution on the source image. A convolution is a spatial operation where the pixels surrounding the input pixel are multiplied by a kernel value to generate the value of the output pixel. The Kernel mathematically defines the relationship between the pixels in the immediate neighborhood of the input pixel and the output pixel.

LookupOp

Implements: BufferedImageOp, RasterOp

Performs a lookup operation from the source to the destination. For Rasters, the lookup operates on channel elements. For BufferedImages, the lookup operates on color and alpha components.

NearestNeighborAffineTransformOp

Extends: AffineTransformOp

Transforms an Image or Raster using an affine transform with nearest neighbor interpolation.

RescaleOp

Implements: BufferedImageOp, RasterOp

Performs a pixel-by-pixel rescaling of the data in the source image by multiplying each pixel value by a scale factor and then adding an offset.

ThresholdOp

Implements: BufferedImageOp, RasterOp

Performs thresholding on the source Image or Raster by mapping the value of each image component or channel element that falls between the specified minimum and maximum to a constant.

An Image with an IndexColorModel cannot be thresholded.


5.0.5 Sample Model Classes




Class

Description

BandedSampleModel

Extends: SampleModel

Provides a more efficient mechanism for accessing image data from Images that store sample data for each band in a separate bank of the DataBuffer.

ComponentSampleModel

Extends: SampleModel

Provides a more efficient mechanism for accessing image data from Images that store sample data in separate data array elements that reside in the first bank of a DataBuffer. Each sample occupies one data array element.

MultiPixelPackedSampleModel

Extends: SampleModel

Provides a more efficient mechanism for accessing image data from one-banded Images. Multiple one-sample pixels can be packed into a single data element.

SampleModel

An abstract class that defines a mechanism for extracting sample data from an image without knowing how the underlying data is stored in a DataBuffer.

SinglePixelPackedSampleModel

Extends: SampleModel

Provides a more efficient mechanism for accessing image data from Images that pack the N samples that make up a pixel in one data array element. All data array elements reside in the first bank of a DataBuffer.


5.0.6 JPEG Conversion Classes




Class

Description

JPEGHuffmanTable

java.awt.image.codec package

Encapsulates a JPEG Huffman table.

JPEGImageDecoder

java.awt.image.codec package

Converts a JPEG InputStream into a Raster or a BufferedImage

JPEGImageEncoder

java.awt.image.codec package

Converts an image into a JPEG data stream (OutputStream).

JPEGParam

java.awt.image.codec package

Encapsulates the tables and options needed for encoding and decoding JPEG images.

JPEGQTable

java.awt.image.codec package

Encapsulates the JPEG quantization tables.


5.0.7 Color Model Classes


Class

Description

ColorModel

Implements: Transparency

JDK1.1 class. An abstract class defines methods for translating from image pixel values to color components such as red, green, and blue.

ComponentColorModel

Extends: ColorModel

A ColorModel that can handle an arbitrary ColorSpace and an array of color components to match the ColorSpace. This class can be used to represent most color models on most types of GraphicsDevices.

DirectColorModel

Extends: PackedColorModel

JDK1.1 class. A ColorModel that represents pixel values that have RGB color components embedded directly in the bits of the pixel. This color model is similar to an X11 TrueColor visual. The default RGB ColorModel returned by ColorModel.getRGBdefault is a DirectColorModel.

IndexColorModel

Extends: ColorModel

JDK1.1 class. A ColorModel that represents pixel values that are indices into a fixed color map in the ColorModel's ColorSpace.

PackedColorModel

Extends: ColorModel

An abstract ColorModel that represents pixel values that have color components embedded directly in the bits of an integer pixel. DirectColorModel extends PackedColorModel to support pixels that contain RGB color components.



CONTENTS | PREV | NEXT
Copyright © 1997-1998 Sun Microsystems, Inc. All Rights Reserved.