Extending ImageFilter

If an image filter modifies the color value of individual pixels within an image, it is straightforward enough to extend RGBImageFilter, as illustrated in the preceding sections. Filters that extend RGBImageFilter are shielded from the complexities of fulfilling the ImageConsumer interface by their superclass and merely have to deal with one pixel—or color—at a time.

However, more complex image filters, such as those that produce an image whose size differs from that of the original image, cannot be content to modify an image pixel by pixel. As a result, some image filters cannot extend RGBImageFilter but must instead extend the ImageFilter class directly.

Extending ImageFilter is considerably more complicated than extending ...

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.