com.threed.jpct
Interface IPostProcessor

All Known Implementing Classes:
BloomGLProcessor

public interface IPostProcessor

An interface for defining a post processor that can be run on the framebuffer. If such a processor supports both renderers (hard- and software) is up to its implementation. It's not required that it does.
When running a post processor on a hardware renderer's framebuffer, the OpenGL state is ensured to be "clean" but if you are manipulating modelview- or projection matrix (or whatever), it's up to you to restore them to the state they had before.
When running a processor on a software renderer's framebuffer, FrameBuffer.refresh(); is called automatically after the last processor has finished its work.


Method Summary
 void dispose()
          Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected.
 void init(FrameBuffer buffer)
          Initialize the processor.
 boolean isInitialized()
          Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).
 void process()
          Does the actual processing.
 

Method Detail

init

public void init(FrameBuffer buffer)
Initialize the processor. Because it has to work on the framebuffer, it should be bound to it. I.e. you shouldn't write a post processor which can be run on multiple framebuffers at a time albeit it's up the actual implementation to ensure this. All the framework does, is to check if isInitialized() returns true, so this method has to ensure that this is the case to prevent all kinds of strange bugs and multi initialization calls.
This method will be called on the first call of the post processor, not when adding it to a framebuffer.

Parameters:
buffer - the FrameBuffer

process

public void process()
Does the actual processing. It's totally up to the implementation what happens here.


dispose

public void dispose()
Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected. A processor will implicitly be removed from a framebuffer if a renderer gets enabled or disabled on it.


isInitialized

public boolean isInitialized()
Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).

Returns:
boolean is it initialized?