Class AbstractRowwiseFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp
    Direct Known Subclasses:
    CheckeredScreenFilter, StencilFilter

    public abstract class AbstractRowwiseFilter
    extends AbstractImageFilter
    An abstract superclass for filters that work on a row-by-row basis. It is similar to AbstractPixelwiseFilter but it guarantees that an entire row is filtered at a time and it provides the current y-index.
    • Constructor Detail

      • AbstractRowwiseFilter

        public AbstractRowwiseFilter()
    • Method Detail

      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dest)
      • filterPixels

        public abstract void filterPixels​(int y,
                                          int[] argb)
        This method is called with a block of ARGB values to be filtered. Subclasses should override this method to implement the actual filtering algorithm, replacing each pixel in the supplied array with its filtered value.
      • workFactor

        protected float workFactor()
        Returns a factor representing the amount of work performed by this filter relative to a filter that simply copies the source image by reading and writing each pixel. For example, a filter that implemented a 3x3 convolution might return the value 9. The work factor value helps determine when an image should be processed in parallel. (There is significant overhead involved in running a filter in parallel, so it is only worth doing if the image is relatively large or the amount of processing per pixel is relatively high.)

        Note: The work factor may vary depending on the current filter settings.

        Returns:
        the approximate amount of work per pixel, relative to simply copying the pixel values