类 TIEPass
java.lang.Object
com.tencent.mps.tie.api.TIEPass
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:
- Create a TIEPass object using the constructor.
- (In glThread) Initialize the TIEPass object by calling the
init(int, int)
method. - (In glThread) Perform image enhance rendering on an input opengl texture by calling the
render(int)
method. - 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();
-
构造器概要
-
方法概要
修饰符和类型方法说明boolean
init
(int inputWidth, int inputHeight) Init TIEPass object for image enhance.void
release()
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.
-
构造器详细资料
-
TIEPass
public TIEPass()Creates a TIEPass object for image enhance. This method must be executed afterTSRSdk.init(long, int, TSRSdk.TSRSdkLicenseVerifyResultCallback, TSRLogger)
-
-
方法详细资料
-
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 imageinputHeight
- 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.
-