diff --git a/engine/src/core/com/jme3/post/FilterPostProcessor.java b/engine/src/core/com/jme3/post/FilterPostProcessor.java index d3ffddced..8c9b81ba0 100644 --- a/engine/src/core/com/jme3/post/FilterPostProcessor.java +++ b/engine/src/core/com/jme3/post/FilterPostProcessor.java @@ -43,6 +43,7 @@ import com.jme3.ui.Picture; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -519,4 +520,27 @@ public class FilterPostProcessor implements SceneProcessor, Savable { public Texture2D getFilterTexture() { return filterTexture; } + + /** + * returns the first filter in the list assignable form the given type + * @param + * @param filterType the filter type + * @return a filter assignable form the given type + */ + public T getFilter(Class filterType) { + for (Filter c : filters) { + if (filterType.isAssignableFrom(c.getClass())) { + return (T) c; + } + } + return null; + } + + /** + * returns an unmodifiable version of the filter list. + * @return the filters list + */ + public List getFilterList(){ + return Collections.unmodifiableList(filters); + } }