Class FilterComposite

java.lang.Object
org.jdesktop.swingx.graphics.FilterComposite
All Implemented Interfaces:
Composite

public class FilterComposite extends Object implements Composite
A FilterComposite allows the inclusion of arbitrary image filters during the paint processing of Graphics2D events. By adding a filter composite, the src and destination images are render using a delegated Composite, then post-processed with the filters before returning the result back to the graphics context. This process adds overhead to the painting both is terms of time (the actual processing time) and memory (as a temporary raster must be created to store the intermediate state). Since it is possible to delegate to a filter composite from a filter composite, this may result slow or unresponsive painting. If you are attempting to render with many different filters, it may be better to have one filter composite with many filters (using a compound filter).

It was decided to use BufferedImageOp as the filter because many of these filters already exist. This gives high reusability to code.

See Also:
  • Field Details

  • Constructor Details

    • FilterComposite

      public FilterComposite(Composite composite)
      Creates an empty filter composite for the specified composite.
      Parameters:
      composite - the composite operation to perform prior to filtering
      Throws:
      NullPointerException - if composite is null
    • FilterComposite

      public FilterComposite(Composite composite, BufferedImageOp filter)
      Creates a filter for the specified composite.
      Parameters:
      composite - the composite operation to perform prior to filtering
      filter - the filter to apply to the composite result
      Throws:
      NullPointerException - if composite is null
  • Method Details