Interface SingleFrameGlTextureProcessor
-
public interface SingleFrameGlTextureProcessor
Manages a GLSL shader program for processing a frame. Implementations generally copy input pixels into an output frame, with changes to pixels specific to the implementation.Methods must be called in the following order:
- The constructor, for implementation-specific arguments.
initialize(Context, int, int, int)
, to set up graphics initialization.drawFrame(long)
, to process one frame.release()
, upon conclusion of processing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
drawFrame(long presentationTimeUs)
Draws one frame.Size
getOutputSize()
Returns the outputSize
of frames processed throughdrawFrame(long)
.void
initialize(Context context, int inputTexId, int inputWidth, int inputHeight)
Performs all initialization that requires OpenGL, such as, loading and compiling a GLSL shader program.void
release()
Releases all resources.
-
-
-
Method Detail
-
initialize
void initialize(Context context, int inputTexId, int inputWidth, int inputHeight) throws IOException
Performs all initialization that requires OpenGL, such as, loading and compiling a GLSL shader program.This method may only be called if there is a current OpenGL context.
- Parameters:
context
- TheContext
.inputTexId
- Identifier of a 2D OpenGL texture.inputWidth
- The input width, in pixels.inputHeight
- The input height, in pixels.- Throws:
IOException
- If an error occurs while reading resources.
-
getOutputSize
Size getOutputSize()
Returns the outputSize
of frames processed throughdrawFrame(long)
.This method may only be called after the texture processor has been
initialized
.
-
drawFrame
void drawFrame(long presentationTimeUs) throws FrameProcessingException
Draws one frame.This method may only be called after the texture processor has been
initialized
. The caller is responsible for focussing the correct render target before calling this method.A minimal implementation should tell OpenGL to use its shader program, bind the shader program's vertex attributes and uniforms, and issue a drawing command.
- Parameters:
presentationTimeUs
- The presentation timestamp of the current frame, in microseconds.- Throws:
FrameProcessingException
- If an error occurs while processing or drawing the frame.
-
release
void release()
Releases all resources.
-
-