Creates IFrame instances.
More...
#include <vb_sdk/frame_factory.h>
|
| 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.
|
| virtual void | release ()=0 |
| | Releases the memory that was allocated for the object.
|
◆ 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
-
| data | Pointer to BGRA data. |
| bytesPerLine | Number of bytes per line of the frame. |
| width | Number of pixels in horizontal direction. |
| height | Number of pixels in vertical direction. |
| makeCopy | If 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
-
| yData | Pointer to Y component data. |
| yBytesPerLine | Number of bytes in one line of the Y component. |
| uvData | Pointer to UV component data. |
| uvBytesPerLine | Number of bytes in one line of the UV component. |
| width | Number of pixels in horizontal direction, must be even. |
| height | Number of pixels in vertical direction, must be even. |
| makeCopy | The 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 |
◆ loadImage()
| virtual IFrame * tsvb::IFrameFactory::loadImage |
( |
const char * | utf8FilePath | ) |
|
|
pure virtual |
Loads an image file and creates IFrame in BGRA format.
- Parameters
-
| utf8FilePath | Path 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
-
| data | Pointer to the encoded image data, the same content as an image file. |
| dataLength | Size 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: