Extending RGBImageFilter

RGBImageFilter is an abstract class that defines one abstract method:

int filterRGB(int x, int y, int rgb)

filterRGB() is passed the location of a pixel and an integer representation of the pixel in the default RGB color model. The method is expected to examine the RGB representation of the pixel and return either the same RGB representation or a modified color for the pixel in question. The following discussion assumes that you have a basic understanding of the RGB color model—see “Colors and Fonts”.

Many image filters are only concerned with modifying the colors of the pixels that constitute comprise an image and are therefore suitable candidates for extensions of the RGBImageFilter class.

Furthermore, a certain percentage ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.