The 2D API comes complete with a handful of useful image operators. These are implementations of the BufferedImageOp interface. Table 10-1 summarizes the image operator classes that are defined in java.awt.image. I'll talk about each type of operator in the coming sections. The "In Place?" column indicates whether the operator is capable of in-place processing, where the source and destination image are the same.
|Class Name||Supporting Classes||Effect||In Place?|
|ConvolveOp||Kernel||blurring, sharpening, edge detection||no|
|LookupOp||LookupTable, ByteLookupTable, ShortLookupTable||posterizing, inversion||yes|
|ColorConvertOp||java.awt.color.ColorSpace||color space conversion||yes|
ConvolveOp is one of the most versatile image operators in the 2D API. It represents a spatial convolution, which is a fancy mathematical term that means that the color of each destination pixel is determined by combining the colors of the corresponding source pixel and its neighbors. A convolution operator can be used to blur or sharpen an image, among other things.
The convolution operator uses a kernel to specify how a source pixel and its neighbors are combined. A kernel is simply a matrix, where the center of the matrix represents the source pixel and the other elements correspond ...