Video Effects SDK 2.6.0.118490
AI-powered SDK for real-time video enhancement.
Loading...
Searching...
No Matches
tsvb Namespace Reference

Classes

class  IAppleCompatFrame
 Access to IFrame as CVPixelBuffer on Apple platforms. More...
class  IAppleCompatFrameFactory
 Creates IFrame from CVPixelBuffer on Apple platforms. More...
class  IAuthResult
 Result of authorization. More...
class  IError
 Error description. More...
class  IFrame
 Video frame. More...
class  IFrameFactory
 Creates IFrame instances. More...
class  ILockedFrameData
 Access to the data inside IFrame. More...
class  IPipeline
 Configuration of effects and frame processor. More...
class  IPipelineConfiguration
 Pipeline configuration. More...
class  IRelease
 Base interface of all objects created by the SDK. More...
class  IReplacementController
 Controls the custom background of background replacement. More...
class  ISDKFactory
 The entry point of the SDK. More...

Typedefs

typedef int PipelineError
 Error code of IPipeline, one of PipelineErrorCode values.
typedef void(*) pfnOnAuthCompletedCallback(IAuthResult *result, void *ctx)
 Callback called when asynchronous authorization is completed.
typedef ISDKFactory *(*) pfnCreateSDKFactory()
 Type of the createSDKFactory() function exported from the SDK library.

Enumerations

enum  InterfaceTypeID { appleCompatFrame = 1 , appleCompatFrameFactory = 2 }
 Identifiers of platform-specific interfaces. More...
enum  NativeErrorType : int { none = 0 , nsError = 1 }
 Type of the native error contained in IError. More...
enum  FrameFormat { bgra32 = 1 , rgba32 = 2 , nv12 = 3 }
 Format of frame data representation. More...
enum  FrameLock { read = 1 , write = 2 , readWrite = (read | write) }
 Access mode for IFrame::lock(). More...
enum  Rotation { r0 = 0 , r90cw = 90 , r180 = 180 , r270cw = 270 }
 How the content lies in the frame: turned clockwise from upright. More...
enum  ColorRange : int { colorRangeVideo = 0 , colorRangeFull = 1 }
 Range of the Y'CbCr values of an NV12 frame. More...
enum  ColorMatrix : int { colorMatrixBT601 = 0 , colorMatrixBT709 = 1 }
 Matrix that turns the Y'CbCr of an NV12 frame into R'G'B' and back. More...
enum  PipelineErrorCode {
  ok = 0 , invalidArgument = 1 , noFeaturesEnabled = 2 , engineInitializationError = 3 ,
  resourceAllocationError = 4 , notSupportedByBackend = 5 , enabledUnsupportedFeatures = 6 , invalidUsage = 7
}
 Error codes of IPipeline. More...
enum  ColorCorrectionParam : int {
  colorCorrectionParamAutoMode = 0 , colorCorrectionParamPower = 1 , colorCorrectionParamWhiteBalance = 2 , colorCorrectionParamExposure = 3 ,
  colorCorrectionParamTemperature = 4 , colorCorrectionParamTint = 5 , colorCorrectionParamVibrance = 6 , colorCorrectionParamContrast = 7 ,
  colorCorrectionParamUpdatePeriodMs = 8
}
 Parameters of the color correction effect, addressed by IPipeline::setColorCorrectionParam() and IPipeline::getColorCorrectionParam(). More...
enum  PortraitLightingParam : int { portraitLightingParamLightStrength = 0 , portraitLightingParamBackgroundDarkening = 1 }
 Parameters of the portrait lighting effect, addressed by IPipeline::setPortraitLightingParam() and IPipeline::getPortraitLightingParam(). More...
enum  Backend : int { CPU = 1 , GPU = 2 }
 Backend of the pipeline. More...
enum  SegmentationPreset : int { segmentationPresetQuality = 0 , segmentationPresetBalanced = 1 }
 Combination of quality and speed of segmentation. More...
enum  MLBackend : int { mlBackendCPU = 1 , mlBackendGPU = 2 , mlBackendAppleNeuralEngine = 4 }
 Backends of ML inference for segmentation, combined into a bit mask. More...
enum  AuthStatus : int { error = 0 , active = 1 , inactive = 2 , expired = 3 }
 Result of authorization. More...

Functions

ISDKFactory * createSDKFactory ()
 Creates an instance of ISDKFactory. The caller is responsible for releasing it.

Typedef Documentation

◆ pfnCreateSDKFactory

typedef ISDKFactory *(*) tsvb::pfnCreateSDKFactory()

Type of the createSDKFactory() function exported from the SDK library.

◆ pfnOnAuthCompletedCallback

typedef void(*) tsvb::pfnOnAuthCompletedCallback(IAuthResult *result, void *ctx)

Callback called when asynchronous authorization is completed.

Parameters
resultThe result of authorization. Don't call IAuthResult::release() on it, the result is deleted after the callback is finished.
ctxThe context passed to ISDKFactory::auth().

◆ PipelineError

typedef int tsvb::PipelineError

Error code of IPipeline, one of PipelineErrorCode values.

Enumeration Type Documentation

◆ AuthStatus

enum tsvb::AuthStatus : int

Result of authorization.

Enumerator
error 

An error occurred: the web request failed or the key is not valid.

active 

Authorization succeeded and the license is active. The SDK can be used.

inactive 

Authorization failed because the license is deactivated or there is no such license.

expired 

Authorization failed because the license is expired.

◆ Backend

enum tsvb::Backend : int

Backend of the pipeline.

Enumerator
CPU 

CPU-based pipeline.

Deprecated
Obsolete: new effects are not implemented for it. Use GPU.
Note
Beautification, color correction (IPipeline::enableColorCorrection()), low light adjustment, noise suppression and portrait lighting are not available on it: enabling them returns PipelineErrorCode::notSupportedByBackend.
GPU 

GPU-based pipeline.

◆ ColorCorrectionParam

Parameters of the color correction effect, addressed by IPipeline::setColorCorrectionParam() and IPipeline::getColorCorrectionParam().

Enumerator
colorCorrectionParamAutoMode 

Fully automatic correction: the effect analyzes the frame periodically and drives white balance, contrast and exposure itself. With it off only the manual parameters below are applied. 0 is off, anything else is on. Default 1.

colorCorrectionParamPower 

Strength of the automatic correction: exposure, contrast and white balance together. The same value IPipeline::setColorCorrectionPower() sets, so either call moves it. [0, 1], default 1.

colorCorrectionParamWhiteBalance 

Strength of the automatic white balance. 0 turns it off, anything above turns it on. Ignored while autoMode is on, which drives white balance already; with autoMode off it enables auto white balance alone, leaving contrast and exposure untouched. [0, 1], default 0.

colorCorrectionParamExposure 

Manual exposure: negative darkens, positive brightens. Applied only while the automatic correction is not driving exposure. [-1, 1], default 0.

colorCorrectionParamTemperature 

Manual color temperature: negative is cool, positive is warm. [-1, 1], default 0.

colorCorrectionParamTint 

Manual tint. [-1, 1], default 0.

colorCorrectionParamVibrance 

Manual vibrance. [-1, 1], default 0.

colorCorrectionParamContrast 

Manual local contrast. Applied only while the automatic correction is not driving contrast. [-1, 1], default 0.

colorCorrectionParamUpdatePeriodMs 

Shortest interval, in milliseconds, between two automatic analyses of the frame. Larger values cost less but follow scene changes more slowly. Matters only while autoMode or whiteBalance is on. [0, 5000], default 200.

◆ ColorMatrix

enum tsvb::ColorMatrix : int

Matrix that turns the Y'CbCr of an NV12 frame into R'G'B' and back.

Enumerator
colorMatrixBT601 

ITU-R BT.601 (SMPTE 170M): standard definition video, and the default of USB (UVC) cameras.

colorMatrixBT709 

ITU-R BT.709: high definition video.

◆ ColorRange

enum tsvb::ColorRange : int

Range of the Y'CbCr values of an NV12 frame.

Enumerator
colorRangeVideo 

Video (limited) range: Y from 16 to 235, Cb and Cr from 16 to 240.

colorRangeFull 

Full range: Y, Cb and Cr from 0 to 255.

◆ FrameFormat

Format of frame data representation.

Enumerator
bgra32 

BGRA, 8 bits per channel (32 bits per pixel).

rgba32 

RGBA, 8 bits per channel (32 bits per pixel).

nv12 

NV12: a Y plane and a plane of interleaved U and V, half as wide and half as high.

◆ FrameLock

Access mode for IFrame::lock().

Enumerator
read 

Read only. Don't change the data.

write 

Write. Changes are applied when ILockedFrameData is released.

readWrite 

Read and write. Changes are applied when ILockedFrameData is released.

◆ InterfaceTypeID

Identifiers of platform-specific interfaces.

Pass to IFrame::getInterface() or IFrameFactory::getInterface() and cast the returned pointer with reinterpret_cast to the requested interface.

Enumerator
appleCompatFrame 

IAppleCompatFrame, supported by IFrame on Apple platforms.

appleCompatFrameFactory 

IAppleCompatFrameFactory, supported by IFrameFactory on Apple platforms.

◆ MLBackend

enum tsvb::MLBackend : int

Backends of ML inference for segmentation, combined into a bit mask.

The mask says what inference is allowed to run on; a platform uses what it supports of it and ignores the rest. On Apple platforms Core ML runs on the CPU in any case, and the other bits add the GPU and the Neural Engine to it: mlBackendCPU alone is the CPU only, with mlBackendGPU the CPU and the GPU, with mlBackendAppleNeuralEngine the CPU and the Neural Engine, with both all three. Elsewhere inference runs on the CPU so far.

Enumerator
mlBackendCPU 

CPU.

mlBackendGPU 

GPU. Has effect on Apple platforms only, so far.

mlBackendAppleNeuralEngine 

Apple Neural Engine. Has effect on Apple platforms only.

◆ NativeErrorType

Type of the native error contained in IError.

Enumerator
none 

No native error contained.

nsError 

Contains an instance of NSError.

◆ PipelineErrorCode

Error codes of IPipeline.

Enumerator
ok 

Success.

invalidArgument 

One or more arguments are incorrect.

noFeaturesEnabled 

No effect is enabled: IPipeline::process() has nothing to do.

engineInitializationError 

Can't initialize the processing engine, the hardware or software is not supported.

resourceAllocationError 

Not enough memory, disk space etc.

notSupportedByBackend 

The effect is not available on the current Backend; another one may have it.

enabledUnsupportedFeatures 

IPipeline::setConfiguration(): an enabled effect is not available on the requested Backend. Disable it first.

invalidUsage 

The call breaks a requirement of the SDK's documentation and is refused.

◆ PortraitLightingParam

Parameters of the portrait lighting effect, addressed by IPipeline::setPortraitLightingParam() and IPipeline::getPortraitLightingParam().

Enumerator
portraitLightingParamLightStrength 

Brightening of the person, strongest away from the edge of the silhouette. [0, 1], default 0.6.

portraitLightingParamBackgroundDarkening 

Darkening of the background, strongest far from the person. Applied only while the background is the frame itself, blurred or not. [0, 1], default 0.4.

◆ Rotation

How the content lies in the frame: turned clockwise from upright.

Enumerator
r0 

Upright.

r90cw 

Turned 90 degrees clockwise.

r180 

Turned 180 degrees.

r270cw 

Turned 270 degrees clockwise (90 degrees counterclockwise).

◆ SegmentationPreset

Combination of quality and speed of segmentation.

Enumerator
segmentationPresetQuality 

Quality is preferred.

segmentationPresetBalanced 

Balanced quality and speed.

Function Documentation

◆ createSDKFactory()

ISDKFactory * tsvb::createSDKFactory ( )

Creates an instance of ISDKFactory. The caller is responsible for releasing it.

For an application linked with the SDK library: libtsvb.dylib on macOS, the tsvb.lib import library on Windows. Returns nullptr on failure.