Class GlRectDrawer


  • public class GlRectDrawer
    extends java.lang.Object
    Helper class to draw an opaque quad on the target viewport location. Rotation, mirror, and cropping is specified using a 4x4 texture coordinate transform matrix. The frame input can either be an OES texture or YUV textures in I420 format. The GL state must be preserved between draw calls, this is intentional to maximize performance. The function release() must be called manually to free the resources held by this object.
    • Constructor Summary

      Constructors 
      Constructor Description
      GlRectDrawer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void drawOes​(int oesTextureId, float[] texMatrix, int frameWidth, int frameHeight, int viewportX, int viewportY, int viewportWidth, int viewportHeight)
      Draw an OES texture frame with specified texture transformation matrix.
      void drawRgb​(int textureId, float[] texMatrix, int frameWidth, int frameHeight, int viewportX, int viewportY, int viewportWidth, int viewportHeight)
      Draw a RGB(A) texture frame with specified texture transformation matrix.
      void drawYuv​(int[] yuvTextures, float[] texMatrix, int frameWidth, int frameHeight, int viewportX, int viewportY, int viewportWidth, int viewportHeight)
      Draw a YUV frame with specified texture transformation matrix.
      void release()
      Release all GLES resources.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GlRectDrawer

        public GlRectDrawer()
    • Method Detail

      • drawOes

        public void drawOes​(int oesTextureId,
                            float[] texMatrix,
                            int frameWidth,
                            int frameHeight,
                            int viewportX,
                            int viewportY,
                            int viewportWidth,
                            int viewportHeight)
        Draw an OES texture frame with specified texture transformation matrix. Required resources are allocated at the first call to this function.
      • drawRgb

        public void drawRgb​(int textureId,
                            float[] texMatrix,
                            int frameWidth,
                            int frameHeight,
                            int viewportX,
                            int viewportY,
                            int viewportWidth,
                            int viewportHeight)
        Draw a RGB(A) texture frame with specified texture transformation matrix. Required resources are allocated at the first call to this function.
      • drawYuv

        public void drawYuv​(int[] yuvTextures,
                            float[] texMatrix,
                            int frameWidth,
                            int frameHeight,
                            int viewportX,
                            int viewportY,
                            int viewportWidth,
                            int viewportHeight)
        Draw a YUV frame with specified texture transformation matrix. Required resources are allocated at the first call to this function.
      • release

        public void release()
        Release all GLES resources. This needs to be done manually, otherwise the resources are leaked.