Class for special effects rendering.
More...
#import <NvsEffectRenderCore.h>
Class for special effects rendering.
This class is the entry of effect rendering module of the entire SDK.
- Warning
- In the NvsEffectRenderCore class, all public APIs must be used in OpenGL threads! ! !
◆ calcEffectOutputSize:inputTexs:intputTexCount:expectVideoResolution:outputTex:timestamp:flags:
Calculate the output size of effects.
- Parameters
-
effect | The effect object to be rendered |
inputTextures | input texture array |
texArrayCount | input texture array count |
videoResolution | Expected video resolution output |
outputTex | Output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.9.1
◆ cleanUp
◆ clearCacheResources
- (void) clearCacheResources |
|
|
|
Clears cached resources.
- Since
- 2.3.0
◆ clearEffectResources:
- (void) clearEffectResources: |
|
(NvsEffect *) |
effect |
|
Clears OpenGL resources cached in special effects.
- Parameters
-
effect | The effect object to be cleared. |
- Since
- 2.3.0
◆ downloadPixelBufferFromTexture:inputVideoResolution:outputFrameFormat:isBT601:outputFrame:
Downloading buffer from GPU texture.
- Parameters
-
inputTexId | ID of input texture |
inputVideoResolution | Resolution of input texture |
outputFrameFormat | returned buffer foramt(BGRA or YUV420 format) |
isBT601 | The color is converted according to BT.601 standard. If the returned buffer format is YUV, this parameter is meaningful. |
frameBuffer | returned buffer of the downloading frame (BGRA or YUV420 format). |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.12.0
◆ initialize
Initializes.
- Returns
- YES means success, while NO means failure.
- Since
- 2.3.0
◆ initializeWithFlags:
- (BOOL) initializeWithFlags: |
|
(int) |
falgs |
|
Initializes.
- Parameters
-
falgs | Refer to the NvsInitializeFlags code definition |
- Returns
- YES means success, while NO means failure.
- Since
- 2.3.0
◆ renderEffect:inputImage:displayRotation:isFlipHorizontally:timestamp:flags:outputFrameFormat:outputFrameIsBT601:outputImage:
- (NvsEffectCoreError) renderEffect: |
|
(NvsEffect *) |
effect |
inputImage: |
|
(CVPixelBufferRef) |
inputImage |
displayRotation: |
|
(int) |
rotation |
isFlipHorizontally: |
|
(BOOL) |
isFlip |
timestamp: |
|
(int64_t) |
timestamp |
flags: |
|
(NvsRenderFlag) |
flags |
outputFrameFormat: |
|
(NvsEffectVideoFramePixelFormat) |
format |
outputFrameIsBT601: |
|
(BOOL) |
is601 |
outputImage: |
|
(CVPixelBufferRef *) |
ouputImage |
|
|
| |
Rendering effects [Attention] Must be used in the same thread as initialize function. If the thread used does not have an OpenGL environment, the call to initializewithflags must have NvsInitializeFlag_CreateGLContextIfNeed.
- Parameters
-
effect | The effect object to be rendered |
inputImage | input image |
rotation | rotation of input image |
isFlip | need flip horizontally |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
format | output image buffer format Refer to NvsEffectVideoFramePixelFormat |
is601 | |
ouputImage | The result of rendered |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.14.0
◆ renderEffect:inputTexId:inputBuddyBuffer:physicalOrientation:inputVideoResolution:outputTexId:timestamp:flags:
Rendering special effects.
- Parameters
-
effect | The effect object to be rendered |
inputTexId | ID of input texture |
inputBuddyBuffer | Buddy buffer of the input texture (NV12 or BGRA or YUV420 format). |
physicalOrientation | Physical orientation |
inputVideoResolution | Resolution of input texture |
outputTexId | ID of output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0. |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.5.0
◆ renderEffect:inputTexId:inputVideoResolution:outputTexId:timestamp:flags:
Rendering effects.
- Parameters
-
effect | The effect object to be rendered |
inputTexId | ID of input texture |
inputVideoResolution | Resolution of input texture |
outputTexId | ID of output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.3.0
◆ renderEffect:inputTexIds:inputVideoResolution:outputTexId:timestamp:flags:
Rendering effects Rendering Multiple input textures effect, the input textures must be same size.
- Parameters
-
effect | The effect object to be rendered |
inputTextures | input texture array |
inputVideoResolution | Resolution of input texture |
outputTexId | ID of output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.14.0
◆ renderEffects:inputImage:displayRotation:isFlipHorizontally:physicalOrientation:outputTexId:timestamp:flags:
- (NvsEffectCoreError) renderEffects: |
|
(NSArray< NvsEffect * > *) |
effects |
inputImage: |
|
(CVPixelBufferRef) |
inputImage |
displayRotation: |
|
(int) |
displayRotation |
isFlipHorizontally: |
|
(BOOL) |
isFlip |
physicalOrientation: |
|
(int) |
physicalOrientation |
outputTexId: |
|
(int) |
outputTexId |
timestamp: |
|
(int64_t) |
timestamp |
flags: |
|
(NvsRenderFlag) |
flags |
|
|
| |
Rendering effects [Attention] Must be used in the same thread as initialize function. If the thread used does not have an OpenGL environment, the call to initializewithflags must have NvsInitializeFlag_CreateGLContextIfNeed.
- Parameters
-
effects | The effect object to be rendered |
inputImage | input image |
displayRotation | rotation of input image |
isFlip | need flip horizontally |
physicalOrientation | Physical orientation |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.7.1
◆ renderEffects:inputImage:displayRotation:isFlipHorizontally:timestamp:flags:outputFrameFormat:outputFrameIsBT601:outputImage:
- (NvsEffectCoreError) renderEffects: |
|
(NSArray< NvsEffect * > *) |
effects |
inputImage: |
|
(CVPixelBufferRef) |
inputImage |
displayRotation: |
|
(int) |
rotation |
isFlipHorizontally: |
|
(BOOL) |
isFlip |
timestamp: |
|
(int64_t) |
timestamp |
flags: |
|
(NvsRenderFlag) |
flags |
outputFrameFormat: |
|
(NvsEffectVideoFramePixelFormat) |
ouputFrameformat |
outputFrameIsBT601: |
|
(BOOL) |
is601 |
outputImage: |
|
(CVPixelBufferRef *) |
ouputImage |
|
|
| |
Rendering effects [Attention] Must be used in the same thread as initialize function. If the thread used does not have an OpenGL environment, the call to initializewithflags must have NvsInitializeFlag_CreateGLContextIfNeed.
- Parameters
-
effects | The effects object to be rendered |
inputImage | input image |
rotation | rotation of input image |
isFlip | need flip horizontally |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
format | output image buffer format Refer to NvsEffectVideoFramePixelFormat |
is601 | |
ouputImage | The result of rendered |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.14.0
◆ renderEffects:inputImage:options:
- (NvsEffectCoreError) renderEffects: |
|
(NSArray< NvsEffect * > *) |
effects |
inputImage: |
|
(CVPixelBufferRef) |
inputImage |
options: |
|
(NSDictionary *) |
options |
|
|
| |
Rendering effects [Attention] Overlay the render result onto the input image.
- Parameters
-
effects | The effects object to be rendered |
inputImage | input image |
options | Render parameters(RENDER_PARAMETERS) |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.8.1
◆ renderEffects:inputImage:outputImage:options:
- (NvsEffectCoreError) renderEffects: |
|
(NSArray< NvsEffect * > *) |
effects |
inputImage: |
|
(CVPixelBufferRef) |
inputImage |
outputImage: |
|
(CVPixelBufferRef *) |
ouputImage |
options: |
|
(NSDictionary *) |
options |
|
|
| |
Rendering effects [Attention] Must be used in the same thread as initialize function. If the thread used does not have an OpenGL environment, the call to initializewithflags must have NvsInitializeFlag_CreateGLContextIfNeed.
- Parameters
-
effects | The effects object to be rendered |
inputImage | input image |
ouputImage | The result of rendered |
options | Render parameters(RENDER_PARAMETERS) |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.14.0
◆ renderEffects:inputTex:inputBuddyBuffer:physicalOrientation:outputTex:timestamp:flags:
Rendering special effects.
- Parameters
-
effects | The effect object to be rendered |
inputTexId | ID of input texture |
inputBuddyBuffer | Buddy buffer of the input texture (NV12 or BGRA or YUV420 format). |
physicalOrientation | Physical orientation |
inputVideoResolution | Resolution of input texture |
outputTexId | ID of output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0. |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.13.0
◆ renderEffects:inputTexId:inputBuddyBuffer:physicalOrientation:inputVideoResolution:outputTexId:timestamp:flags:
Rendering special effects.
- Parameters
-
effects | The effect object to be rendered |
inputTexId | ID of input texture |
inputBuddyBuffer | Buddy buffer of the input texture (NV12 or BGRA or YUV420 format). |
physicalOrientation | Physical orientation |
inputVideoResolution | Resolution of input texture |
outputTexId | ID of output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0. |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.7.0
◆ renderVariantSizeEffect:inputTexs:intputTexSize:outputTex:timestamp:flags:
Rendered variable size effects.
- Parameters
-
effect | The effect object to be rendered |
inputTextures | input texture array |
texArrayCount | input texture array count |
outputTex | Output texture |
timestamp | Timestamp of current rendering |
flags | Temporarily set to 0 |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.9.1
◆ uploadPixelBufferToTexture:displayRotation:horizontalFlip:outputTex:
- (NvsEffectCoreError) uploadPixelBufferToTexture: |
|
(CVPixelBufferRef) |
frameBuffer |
displayRotation: |
|
(int) |
rotation |
horizontalFlip: |
|
(BOOL) |
flip |
outputTex: |
|
(NvsEffectGPUTexture *) |
outputTex |
|
|
| |
Uploading buffer to GPU texture.
- Parameters
-
frameBuffer | buffer of the uploding frame (NV12 format). |
horizontalFlip | hrozontal flip |
outputTexId | ID of output texture |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 3.13.0
◆ uploadPixelBufferToTexture:displayRotation:horizontalFlip:outputTexId:
- (NvsEffectCoreError) uploadPixelBufferToTexture: |
|
(CVPixelBufferRef) |
frameBuffer |
displayRotation: |
|
(int) |
rotation |
horizontalFlip: |
|
(BOOL) |
flip |
outputTexId: |
|
(int) |
outputTexId |
|
|
| |
Uploading buffer to GPU texture.
- Parameters
-
frameBuffer | buffer of the uploding frame (NV12 format). |
horizontalFlip | hrozontal flip |
outputTexId | ID of output texture |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.12.0
◆ uploadPixelBufferToTexture:horizontalFlip:outputTexId:
- (NvsEffectCoreError) uploadPixelBufferToTexture: |
|
(CVPixelBufferRef) |
frameBuffer |
horizontalFlip: |
|
(BOOL) |
flip |
outputTexId: |
|
(int) |
outputTexId |
|
|
| |
Uploading buffer to GPU texture.
- Parameters
-
frameBuffer | buffer of the uploding frame (NV12 format). |
horizontalFlip | hrozontal flip |
outputTexId | ID of output texture |
- Returns
- "NvsEffectCoreError_NoError" means success, while any other value means failure. Refer to the error code definition.
- Since
- 2.12.0
The documentation for this class was generated from the following file: