Interface Filter

All Known Implementing Classes:
GrayScaleMode, InvertedMode, RandomMode

public interface Filter
This interface defines all kind of image filters for the game.
Author:
Dominik Fuchss
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<Filter>
    All filters which was found at init time.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(AbstractImage imageData)
    Apply Filter.
    default RGBAColor
    Apply Filter.
    default boolean
    Indicates whether the internal state of the Filter has been changed.
    static Filter
    get(Class<? extends Filter> filter)
    Search for filter instance by class.
    boolean
    This boolean indicates whether this filter can be applied pixel per pixel (slow).
    boolean
    This boolean indicates whether this filter can be applied pixel per pixel (fast).
  • Field Details

    • ALL_FILTERS

      static final Set<Filter> ALL_FILTERS
      All filters which was found at init time.
  • Method Details

    • get

      static Filter get(Class<? extends Filter> filter)
      Search for filter instance by class.
      Parameters:
      filter - the filter class
      Returns:
      the filter or null if not found
      See Also:
    • isApplyPixel

      boolean isApplyPixel()
      This boolean indicates whether this filter can be applied pixel per pixel (fast).
      Returns:
      true if apply(RGBAColor) shall be used
    • isApplyImage

      boolean isApplyImage()
      This boolean indicates whether this filter can be applied pixel per pixel (slow).
      Returns:
      true if apply(AbstractImage) shall be used
    • changed

      default boolean changed()
      Indicates whether the internal state of the Filter has been changed.
      Returns:
      true if state changed, false otherwise
    • apply

      default RGBAColor apply(RGBAColor color)
      Apply Filter.
      Parameters:
      color - the original color
      Returns:
      the new color
    • apply

      default AbstractImage apply(AbstractImage imageData)
      Apply Filter.
      Parameters:
      imageData - the original data
      Returns:
      the new Data