CONTENTS | PREV | NEXT Java 2D API


5.1 Interfaces and Classes

The immediate mode imaging APIs in the Java 2DTM API can be grouped into six categories: interfaces, image data classes, image operation classes, sample model classes, color model classes, and exceptions.


5.1.1 Imaging Interfaces




Interface

Description

BufferedImageOp

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

RasterOp

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

RenderedImage

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

WritableRenderedImage

Extends: RenderedImage

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

TileObserver

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


5.1.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 LookupTable that contains byte data.

DataBuffer

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

DataBufferByte

Extends: DataBuffer (Final)

A data buffer that stores bytes of data. (Used in Java Advanced Imaging API)

DataBufferInt

Extends: DataBuffer (Final))

A data buffer that stores integer data.(Used in Java Advanced Imaging API)

DataBufferShort

Extends: DataBuffer (Final)

A data buffer that stores short data.(Used in Java Advanced Imaging API)

DataBufferUShort

Extends: DataBuffer (Final)

A data buffer that stores unsigned short data.

Kernel

A matrix that describes how an input pixel and its surrounding pixels affect the value of an output pixel in a ConvolveOp filtering operation.

LookupTable

Extends: Object

A table that maps values from single-banded pixel data to color values.

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.

WritableRaster

Extends: Raster

A Raster that you can modify.


5.1.3 Image Operation Classes




Class

Description

AffineTransformOp

Implements: BufferedImageOp, RasterOp

A class that defines 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. This class can perform either bilinear or nearest neighbor affine transform operations.

BandCombineOp

Implements: RasterOp

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

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.

ColorConvertOp

Implements: BufferedImageOp, RasterOp

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

ConvolveOp

Implements: BufferedImageOp, RasterOp

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 sample values. For BufferedImages, the lookup operates on color and alpha components.

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.


5.1.4 Sample Model Classes




Class

Description

BandedSampleModel

Extends: ComponentSampleModel (Final)

Provides access to image data stored with like samples stored as bands in separate banks of a DataBuffer. A pixel consists of one sample from each band.

ComponentSampleModel

Extends: SampleModel

Provides access to image data stored with each sample of a pixel residing in a separate element of a DataBuffer. Different types of pixel interleaving are supported.

MultiPixelPackedSampleModel

Extends: SampleModel

Provides access to image data stored with multiple one-sample pixels packed into one element of a DataBuffer.

PixelInterleavedSampleModel

Extends: ComponentSampleModel

Provides access to image data stored with the sample data for each pixel in adjacent elements of the data array, and all elements in a single bank of a DataBuffer.

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 access to image data stored with all the samples belonging to an individual pixel packed into one element of a DataBuffer.


5.1.5 Color Model Classes




Class

Description

ColorModel

Implements: Transparency

JDK1.1 class. An abstract class that 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 sRGB ColorSpace.

PackedColorModel

Extends: ColorModel

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


5.1.6 Exception Classes




Class

Description

ImagingOpException

Extends: RuntimeException

Thrown if one of the BufferedImageOp or RasterOp filter methods can't process the image.

RasterFormatException

Extends: RuntimeException

Thrown if there is invalid layout information in the Raster.



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