类 TIEPass

java.lang.Object
com.tencent.mps.tie.api.TIEPass

public class TIEPass extends Object
TIEPass is a class responsible for performing image enhance rendering on input images. The class creates a TIEPass object and provides methods for initialization, rendering, and releasing resources.

Usage:

  1. Create a TIEPass object using the constructor.
  2. (In glThread) Initialize the TIEPass object by calling the init(int, int) method.
  3. (In glThread) Perform image enhance rendering on an input opengl texture by calling the render(int) method.
  4. Release resources when the TIEPass object is no longer needed by calling the release() method.

Example:

 // Create a TIEPass object using the constructor.
 TIEPass tiePass = new TIEPass();

 // The code below must be executed in glThread.
 //----------------------GL Thread---------------------//

 // Init TIEPass
 tiePass.init(inputWidth, inputHeight);
 // If the type of inputTexture is TextureOES, you must transform it to Texture2D.
 int outputTextureId = tiePass.render(inputTextureId);

 //----------------------GL Thread---------------------//

 // Release resources when the TIEPass object is no longer needed.
 tiePass.release();
 
  • 构造器概要

    构造器
    构造器
    说明
    Creates a TIEPass object for image enhance.
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    init(int inputWidth, int inputHeight)
    Init TIEPass object for image enhance.
    void
    Releases the resources.
    int
    render(int textureId)
    Performs the image enhance rendering operation on the input image.
    int
    render(int textureId, float[] transformMatrix)
    Performs the image enhance rendering operation on the input image with a specified transform matrix.

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

  • 方法详细资料

    • init

      public boolean init(int inputWidth, int inputHeight)
      Init TIEPass object for image enhance. This method must be called in the GLThread.
      参数:
      inputWidth - The width of the input image
      inputHeight - The height of the input image
      返回:
      true if the initialization is successful, false if the opengl es version is lower than 3.1
    • render

      public int render(int textureId)
      Performs the image enhance rendering operation on the input image. This method must be performed in the GLThread.
      This method applies the image enhance rendering process to the input image, improving its quality. The processed image is rendered onto a texture within the TIEPass object. And the return is the texture's id.

      NOTE: The type of the texture corresponding to the textureId you pass in must be texture2D.
      参数:
      textureId - The OpenGL textureId of the input image that needs to be processed for image enhance. The corresponding texture is a texture2D texture.
      返回:
      The textureId of the texture2D after image enhance rendering, which is stored inside the TIEPass object. The size of the output texture is (inputWidth, inputHeight).
    • render

      public int render(int textureId, float[] transformMatrix)
      Performs the image enhance rendering operation on the input image with a specified transform matrix. This method must be performed in the GLThread.

      This method applies the image enhance rendering process to the input image, improving its quality, and uses the given transform matrix to manipulate the image during the rendering process. The processed image is rendered onto a texture within the TIEPass object. And the return is the texture's id.

      NOTE: The type of the texture corresponding to the textureId you pass in must be texture2D.

      参数:
      textureId - The OpenGL textureId of the input image that needs to be processed for image enhance. The corresponding texture is a texture2D texture.
      transformMatrix - A float array representing the transform matrix to be applied to the input image during the rendering process. The matrix should be in column-major order and of size 16.
      返回:
      The textureId of the texture2D after image enhance rendering and applying the transform matrix, which is stored inside the TIEPass object. The size of the output texture is (inputWidth, inputHeight).
    • release

      public void release()
      Releases the resources.
      This method should be called when the TIEPass object is no longer needed, to free up the memory and other resources.