MeiCam SDK For iOS  3.10.0
Instance Methods | List of all members
NvsEffectRenderCore Class Reference

Class for special effects rendering. More...

#import <NvsEffectRenderCore.h>

Inheritance diagram for NvsEffectRenderCore:

Instance Methods

(BOOL) - initialize
 Initializes. More...
 
(BOOL) - initializeWithFlags:
 Initializes. More...
 
(void) - cleanUp
 Clears all resources in NvsEffectRenderCore. More...
 
(NvsEffectCoreError- renderEffect:inputTexId:inputVideoResolution:outputTexId:timestamp:flags:
 Rendering effects. More...
 
(NvsEffectCoreError- renderEffect:inputTexId:inputBuddyBuffer:physicalOrientation:inputVideoResolution:outputTexId:timestamp:flags:
 Rendering special effects. More...
 
(NvsEffectCoreError- renderEffects:inputTexId:inputBuddyBuffer:physicalOrientation:inputVideoResolution:outputTexId:timestamp:flags:
 Rendering special effects. More...
 
(NvsEffectCoreError- renderEffects:inputImage:displayRotation:isFlipHorizontally:physicalOrientation:outputTexId:timestamp: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. More...
 
(NvsEffectCoreError- renderEffect:inputImage:displayRotation:isFlipHorizontally:timestamp:flags:outputFrameFormat:outputFrameIsBT601:outputImage:
 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. More...
 
(NvsEffectCoreError- renderEffects:inputImage:displayRotation:isFlipHorizontally:timestamp:flags:outputFrameFormat:outputFrameIsBT601:outputImage:
 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. More...
 
(NvsEffectCoreError- renderEffects:inputImage:outputImage: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. More...
 
(NvsEffectCoreError- renderEffects:inputImage:options:
 Rendering effects [Attention] Overlay the render result onto the input image. More...
 
(NvsEffectCoreError- renderEffect:inputTexIds:inputVideoResolution:outputTexId:timestamp:flags:
 Rendering effects Rendering Multiple input textures effect, the input textures must be same size. More...
 
(NvsEffectCoreError- calcEffectOutputSize:inputTexs:intputTexCount:expectVideoResolution:outputTex:timestamp:flags:
 Calculate the output size of effects. More...
 
(NvsEffectCoreError- renderVariantSizeEffect:inputTexs:intputTexSize:outputTex:timestamp:flags:
 Rendered variable size effects. More...
 
(void) - clearEffectResources:
 Clears OpenGL resources cached in special effects. More...
 
(void) - clearCacheResources
 Clears cached resources. More...
 
(NvsEffectCoreError- uploadPixelBufferToTexture:displayRotation:horizontalFlip:outputTexId:
 Uploading buffer to GPU texture. More...
 
(NvsEffectCoreError- uploadPixelBufferToTexture:horizontalFlip:outputTexId:
 Uploading buffer to GPU texture. More...
 
(NvsEffectCoreError- downloadPixelBufferFromTexture:inputVideoResolution:outputFrameFormat:isBT601:outputFrame:
 Downloading buffer from GPU texture. More...
 

Detailed Description

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! ! !

Method Documentation

◆ calcEffectOutputSize:inputTexs:intputTexCount:expectVideoResolution:outputTex:timestamp:flags:

- (NvsEffectCoreError) calcEffectOutputSize: (NvsEffect *)  effect
inputTexs: (NvsEffectGPUTexture *)  inputTextureArray
intputTexCount: (int)  texArrayCount
expectVideoResolution: (NvsEffectVideoResolution *)  videoResolution
outputTex: (NvsEffectGPUTextureInfo *)  outputTexInfo
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Calculate the output size of effects.

Parameters
effectThe effect object to be rendered
inputTexturesinput texture array
texArrayCountinput texture array count
videoResolutionExpected video resolution output
outputTexOutput texture
timestampTimestamp of current rendering
flagsTemporarily 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

- (void) cleanUp

Clears all resources in NvsEffectRenderCore.

Since
2.14.0

◆ clearCacheResources

- (void) clearCacheResources

Clears cached resources.

Since
2.3.0

◆ clearEffectResources:

- (void) clearEffectResources: (NvsEffect *)  effect

Clears OpenGL resources cached in special effects.

Parameters
effectThe effect object to be cleared.
Since
2.3.0

◆ downloadPixelBufferFromTexture:inputVideoResolution:outputFrameFormat:isBT601:outputFrame:

- (NvsEffectCoreError) downloadPixelBufferFromTexture: (int)  inputTexId
inputVideoResolution: (NvsEffectVideoResolution *)  inputVideoResolution
outputFrameFormat: (NvsEffectVideoFramePixelFormat format
isBT601: (BOOL)  is601
outputFrame: (CVPixelBufferRef *)  frameBuffer 

Downloading buffer from GPU texture.

Parameters
inputTexIdID of input texture
inputVideoResolutionResolution of input texture
outputFrameFormatreturned buffer foramt(BGRA or YUV420 format)
isBT601The color is converted according to BT.601 standard. If the returned buffer format is YUV, this parameter is meaningful.
frameBufferreturned 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

- (BOOL) initialize

Initializes.

Returns
YES means success, while NO means failure.
Since
2.3.0

◆ initializeWithFlags:

- (BOOL) initializeWithFlags: (int)  falgs

Initializes.

Parameters
falgsRefer 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
effectThe effect object to be rendered
inputImageinput image
rotationrotation of input image
isFlipneed flip horizontally
timestampTimestamp of current rendering
flagsTemporarily set to 0
formatoutput image buffer format Refer to NvsEffectVideoFramePixelFormat
is601
ouputImageThe 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:

- (NvsEffectCoreError) renderEffect: (NvsEffect *)  effect
inputTexId: (int)  inputTexId
inputBuddyBuffer: (const NvsEffectVideoFrameInfo *)  inputBuddyBuffer
physicalOrientation: (int)  physicalOrientation
inputVideoResolution: (NvsEffectVideoResolution *)  inputVideoResolution
outputTexId: (int)  outputTexId
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Rendering special effects.

Parameters
effectThe effect object to be rendered
inputTexIdID of input texture
inputBuddyBufferBuddy buffer of the input texture (NV12 or BGRA or YUV420 format).
physicalOrientationPhysical orientation
inputVideoResolutionResolution of input texture
outputTexIdID of output texture
timestampTimestamp of current rendering
flagsTemporarily 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:

- (NvsEffectCoreError) renderEffect: (NvsEffect *)  effect
inputTexId: (int)  inputTexId
inputVideoResolution: (NvsEffectVideoResolution *)  inputVideoResolution
outputTexId: (int)  outputTexId
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Rendering effects.

Parameters
effectThe effect object to be rendered
inputTexIdID of input texture
inputVideoResolutionResolution of input texture
outputTexIdID of output texture
timestampTimestamp of current rendering
flagsTemporarily 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:

- (NvsEffectCoreError) renderEffect: (NvsEffect *)  effect
inputTexIds: (NSArray *)  inputTextures
inputVideoResolution: (NvsEffectVideoResolution *)  inputVideoResolution
outputTexId: (int)  outputTexId
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Rendering effects Rendering Multiple input textures effect, the input textures must be same size.

Parameters
effectThe effect object to be rendered
inputTexturesinput texture array
inputVideoResolutionResolution of input texture
outputTexIdID of output texture
timestampTimestamp of current rendering
flagsTemporarily 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
effectsThe effect object to be rendered
inputImageinput image
displayRotationrotation of input image
isFlipneed flip horizontally
physicalOrientationPhysical orientation
timestampTimestamp of current rendering
flagsTemporarily 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
effectsThe effects object to be rendered
inputImageinput image
rotationrotation of input image
isFlipneed flip horizontally
timestampTimestamp of current rendering
flagsTemporarily set to 0
formatoutput image buffer format Refer to NvsEffectVideoFramePixelFormat
is601
ouputImageThe 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
effectsThe effects object to be rendered
inputImageinput image
optionsRender 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
effectsThe effects object to be rendered
inputImageinput image
ouputImageThe result of rendered
optionsRender 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:inputTexId:inputBuddyBuffer:physicalOrientation:inputVideoResolution:outputTexId:timestamp:flags:

- (NvsEffectCoreError) renderEffects: (NSArray< NvsEffect * > *)  effects
inputTexId: (int)  inputTexId
inputBuddyBuffer: (const NvsEffectVideoFrameInfo *)  inputBuddyBuffer
physicalOrientation: (int)  physicalOrientation
inputVideoResolution: (NvsEffectVideoResolution *)  inputVideoResolution
outputTexId: (int)  outputTexId
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Rendering special effects.

Parameters
effectsThe effect object to be rendered
inputTexIdID of input texture
inputBuddyBufferBuddy buffer of the input texture (NV12 or BGRA or YUV420 format).
physicalOrientationPhysical orientation
inputVideoResolutionResolution of input texture
outputTexIdID of output texture
timestampTimestamp of current rendering
flagsTemporarily 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:

- (NvsEffectCoreError) renderVariantSizeEffect: (NvsEffect *)  effect
inputTexs: (NvsEffectGPUTexture *)  inputTextureArray
intputTexSize: (int)  texArrayCount
outputTex: (NvsEffectGPUTexture *)  outputTex
timestamp: (int64_t)  timestamp
flags: (NvsRenderFlag flags 

Rendered variable size effects.

Parameters
effectThe effect object to be rendered
inputTexturesinput texture array
texArrayCountinput texture array count
outputTexOutput texture
timestampTimestamp of current rendering
flagsTemporarily 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:outputTexId:

- (NvsEffectCoreError) uploadPixelBufferToTexture: (CVPixelBufferRef)  frameBuffer
displayRotation: (int)  rotation
horizontalFlip: (BOOL)  flip
outputTexId: (int)  outputTexId 

Uploading buffer to GPU texture.

Parameters
frameBufferbuffer of the uploding frame (NV12 format).
horizontalFliphrozontal flip
outputTexIdID 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
frameBufferbuffer of the uploding frame (NV12 format).
horizontalFliphrozontal flip
outputTexIdID 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: