Video Effects SDK 2.6.0.118490
AI-powered SDK for real-time video enhancement.
Loading...
Searching...
No Matches
tsvb::IFrameFactory Class Referenceabstract

Creates IFrame instances. More...

#include <vb_sdk/frame_factory.h>

Inheritance diagram for tsvb::IFrameFactory:
[legend]

Public Member Functions

virtual IFrame * createBGRA (void *data, unsigned int bytesPerLine, unsigned int width, unsigned int height, bool makeCopy)=0
 Creates IFrame from raw BGRA data.
virtual IFrame * createNV12 (void *yData, unsigned int yBytesPerLine, void *uvData, unsigned int uvBytesPerLine, unsigned int width, unsigned int height, bool makeCopy)=0
 Creates IFrame from raw NV12 data.
virtual IFrame * loadImage (const char *utf8FilePath)=0
 Loads an image file and creates IFrame in BGRA format.
virtual IFrame * loadImageWithData (const void *data, size_t dataLength)=0
 Decodes an image from memory and creates IFrame in BGRA format.
virtual void * getInterface (InterfaceTypeID interfaceTypeID)=0
 Returns a platform-specific interface.
Public Member Functions inherited from tsvb::IRelease
virtual void release ()=0
 Releases the memory that was allocated for the object.

Detailed Description

Creates IFrame instances.

Created by ISDKFactory::createFrameFactory().

Member Function Documentation

◆ createBGRA()

virtual IFrame * tsvb::IFrameFactory::createBGRA ( void * data,
unsigned int bytesPerLine,
unsigned int width,
unsigned int height,
bool makeCopy )
pure virtual

Creates IFrame from raw BGRA data.

Parameters
dataPointer to BGRA data.
bytesPerLineNumber of bytes per line of the frame.
widthNumber of pixels in horizontal direction.
heightNumber of pixels in vertical direction.
makeCopyIf true, IFrame copies the data. Otherwise IFrame keeps the pointer to the data: keep the data until the IFrame is released. IRelease::release() may block for a while if the frame is in use at the time, such as read as the background by IPipeline::process().
Returns
An instance of IFrame, or nullptr on failure.
Warning
On Apple platforms, don't release a frame created with makeCopy false from a handler added with addCompletedHandler: or addScheduledHandler: of an MTLCommandBuffer: the release may wait for a pipeline's GPU work, and Metal may run the handlers of all command queues one at a time.

◆ createNV12()

virtual IFrame * tsvb::IFrameFactory::createNV12 ( void * yData,
unsigned int yBytesPerLine,
void * uvData,
unsigned int uvBytesPerLine,
unsigned int width,
unsigned int height,
bool makeCopy )
pure virtual

Creates IFrame from raw NV12 data.

Taken to be video range and BT.601; see IFrame::setColorRange() and IFrame::setColorMatrix() for other data.

Parameters
yDataPointer to Y component data.
yBytesPerLineNumber of bytes in one line of the Y component.
uvDataPointer to UV component data.
uvBytesPerLineNumber of bytes in one line of the UV component.
widthNumber of pixels in horizontal direction, must be even.
heightNumber of pixels in vertical direction, must be even.
makeCopyThe same behavior as for createBGRA().
Returns
An instance of IFrame, or nullptr on failure.
Warning
The same as for createBGRA().

◆ getInterface()

virtual void * tsvb::IFrameFactory::getInterface ( InterfaceTypeID interfaceTypeID)
pure virtual

Returns a platform-specific interface.

IFrameFactory supports IAppleCompatFrameFactory on Apple platforms, pass InterfaceTypeID::appleCompatFrameFactory to get it. Cast the returned pointer with reinterpret_cast. The returned object is owned by the factory, don't release it.

Parameters
interfaceTypeIDSee InterfaceTypeID.
Returns
Pointer to the interface, or nullptr if it is not supported.

◆ loadImage()

virtual IFrame * tsvb::IFrameFactory::loadImage ( const char * utf8FilePath)
pure virtual

Loads an image file and creates IFrame in BGRA format.

Parameters
utf8FilePathPath to the image file in UTF-8.
Returns
An instance of IFrame, or nullptr if the image can't be loaded.

◆ loadImageWithData()

virtual IFrame * tsvb::IFrameFactory::loadImageWithData ( const void * data,
size_t dataLength )
pure virtual

Decodes an image from memory and creates IFrame in BGRA format.

Parameters
dataPointer to the encoded image data, the same content as an image file.
dataLengthSize of the data in bytes.
Returns
An instance of IFrame, or nullptr if the image can't be decoded.

The documentation for this class was generated from the following file: