O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required