Class InterlacedRenderer
- java.lang.Object
-
- com.leia.sdk.views.InterlacedRenderer
-
- All Implemented Interfaces:
com.leia.sdk.views.LeiaGLSurfaceView.Renderer
public class InterlacedRenderer extends Object implements com.leia.sdk.views.LeiaGLSurfaceView.Renderer
-
-
Field Summary
Fields Modifier and Type Field Description static int
EGL_PROTECTED_CONTENT_EXT
In order to render protected content, EGL context and its resources should account for that.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getActCoef()
InterlacedSurfaceViewConfigAccessor
getConfig()
float[]
getRectMatrix()
InputGLBinding.SRGBConfig
getSRGBConfig()
Interlacer
GLThread_getInterlacer()
void
onDrawFrame(GL10 gl10, com.leia.sdk.views.LeiaGLSurfaceView.EglHelper eglHelper)
Called to draw the current frame.void
onSurfaceChanged(GL10 gl10, int width, int height)
Called when the surface changed size.void
onSurfaceCreated(GL10 gl10, EGLConfig eConfig)
Called when the surface is created or recreated.void
setCameraAngles(boolean isLeft, float thetaXFpc, float thetaYFpc, float thetaZFpc)
void
setCameraRectificationParameters(boolean isFront, float deltaThetaX, float deltaThetaY, float deltaThetaZ, float calibrationTargetDistanceMm)
boolean
writeZonePlateResultsToInterlacer(float slant, float pitch, float phc, float dOverN, float n)
-
-
-
Field Detail
-
EGL_PROTECTED_CONTENT_EXT
public static final int EGL_PROTECTED_CONTENT_EXT
In order to render protected content, EGL context and its resources should account for that. At creation time, the corresponding PROTECTED attribute should be set to EGL_TRUE. For more information, see EGL_EXT_protected_content EGL extension.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSRGBConfig
public InputGLBinding.SRGBConfig getSRGBConfig()
-
onSurfaceCreated
public void onSurfaceCreated(GL10 gl10, EGLConfig eConfig)
Description copied from interface:com.leia.sdk.views.LeiaGLSurfaceView.Renderer
Called when the surface is created or recreated.Called when the rendering thread starts and whenever the EGL context is lost. The EGL context will typically be lost when the Android device awakes after going to sleep.
Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be recreated when the EGL context is lost. Textures are an example of a resource that you might want to create here.
Note that when the EGL context is lost, all OpenGL resources associated with that context will be automatically deleted. You do not need to call the corresponding "glDelete" methods such as glDeleteTextures to manually delete these lost resources.
- Specified by:
onSurfaceCreated
in interfacecom.leia.sdk.views.LeiaGLSurfaceView.Renderer
- Parameters:
gl10
- the GL interface. Useinstanceof
to test if the interface supports GL11 or higher interfaces.eConfig
- the EGLConfig of the created surface. Can be used to create matching pbuffers.
-
onSurfaceChanged
public void onSurfaceChanged(GL10 gl10, int width, int height)
Description copied from interface:com.leia.sdk.views.LeiaGLSurfaceView.Renderer
Called when the surface changed size.Called after the surface is created and whenever the OpenGL ES surface size changes.
Typically you will set your viewport here. If your camera is fixed then you could also set your projection matrix here:
void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); // for a fixed camera, set the projection too float ratio = (float) width / height; gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10); }
- Specified by:
onSurfaceChanged
in interfacecom.leia.sdk.views.LeiaGLSurfaceView.Renderer
- Parameters:
gl10
- the GL interface. Useinstanceof
to test if the interface supports GL11 or higher interfaces.
-
onDrawFrame
public void onDrawFrame(GL10 gl10, com.leia.sdk.views.LeiaGLSurfaceView.EglHelper eglHelper)
Description copied from interface:com.leia.sdk.views.LeiaGLSurfaceView.Renderer
Called to draw the current frame.This method is responsible for drawing the current frame.
The implementation of this method typically looks like this:
void onDrawFrame(GL10 gl) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); //... other gl calls to render the scene ... }
- Specified by:
onDrawFrame
in interfacecom.leia.sdk.views.LeiaGLSurfaceView.Renderer
- Parameters:
gl10
- the GL interface. Useinstanceof
to test if the interface supports GL11 or higher interfaces.
-
GLThread_getInterlacer
public Interlacer GLThread_getInterlacer()
-
getRectMatrix
public float[] getRectMatrix()
-
writeZonePlateResultsToInterlacer
public boolean writeZonePlateResultsToInterlacer(float slant, float pitch, float phc, float dOverN, float n)
-
setCameraRectificationParameters
public void setCameraRectificationParameters(boolean isFront, float deltaThetaX, float deltaThetaY, float deltaThetaZ, float calibrationTargetDistanceMm)
-
setCameraAngles
public void setCameraAngles(boolean isLeft, float thetaXFpc, float thetaYFpc, float thetaZFpc)
-
getActCoef
public float getActCoef()
-
getConfig
public InterlacedSurfaceViewConfigAccessor getConfig()
-
-