#include <vconvert.h>
Inheritance diagram for PColourConverter:
Public Member Functions | |
PColourConverter (const PString &srcColourFormat, const PString &dstColourFormat, unsigned width, unsigned height) | |
BOOL | GetVFlipState () |
void | SetVFlipState (BOOL vFlipState) |
virtual BOOL | SetFrameSize (unsigned width, unsigned height) |
virtual BOOL | SetSrcFrameSize (unsigned width, unsigned height) |
virtual BOOL | SetDstFrameSize (unsigned width, unsigned height, BOOL bScale) |
const PString & | GetSrcColourFormat () |
const PString & | GetDstColourFormat () |
PINDEX | GetMaxSrcFrameBytes () |
PINDEX | GetMaxDstFrameBytes () |
virtual BOOL | Convert (const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, PINDEX *bytesReturned=NULL)=0 |
virtual BOOL | ConvertInPlace (BYTE *frameBuffer, PINDEX *bytesReturned=NULL, BOOL noIntermediateFrame=FALSE) |
BOOL | GetDstFrameSize (unsigned &width, unsigned &height) const |
BOOL | GetSrcFrameSize (unsigned &width, unsigned &height) const |
Static Public Member Functions | |
static PColourConverter * | Create (const PString &srcColourFormat, const PString &dstColourFormat, unsigned width, unsigned height) |
Protected Attributes | |
PString | srcColourFormat |
PString | dstColourFormat |
unsigned | srcFrameWidth |
unsigned | srcFrameHeight |
unsigned | srcFrameBytes |
unsigned | dstFrameBytes |
unsigned | dstFrameWidth |
unsigned | dstFrameHeight |
BOOL | scaleNotCrop |
BOOL | doVFlip |
PBYTEArray | intermediateFrameStore |
Friends | |
class | PColourConverterRegistration |
|
Create a new converter.
|
|
Convert from one colour format to another. This version will copy the data from one frame buffer to another. An implementation of this function should allow for the case of where srcFrameBuffer and dstFrameBuffer are the same, if the conversion algorithm allows for that to occur without an intermediate frame store. The function should return FALSE if srcFrameBuffer and dstFrameBuffer are the same and that form pf conversion is not allowed
Implemented in PSynonymColour. |
|
Convert from one colour format to another. This version will copy the data from one frame buffer to the same frame buffer. Not all conversions can do this so an intermediate store and copy may be required. If the noIntermediateFrame parameter is TRUE and the conversion cannot be done in place then the function returns FALSE. If the in place conversion can be done then that parameter is ignored. Note that the frame should be large enough to take the destination pixels. Default behaviour calls Convert() from the frameBuffer to itself, and if that returns FALSE then calls it again (provided noIntermediateFrame is FALSE) using an intermediate store, copying the intermediate store back to the original frame store.
|
|
Create an instance of a colour conversion function. Returns NULL if there is no registered colour converter between the two named formats.
|
|
Get the destination colour format. |
|
Get the output frame size.
|
|
Get the maximum frame size in bytes for destination frames. Note a particular device may be able to provide variable length frames (eg motion JPEG) so will be the maximum size of all frames. |
|
Get the maximum frame size in bytes for source frames. Note a particular device may be able to provide variable length frames (eg motion JPEG) so will be the maximum size of all frames. |
|
Get the source colour format. |
|
Get the input frame size.
|
|
Get the video conversion vertical flip state |
|
Set the destination frame size to be used. Default behaviour sets the dstFrameWidth and dstFrameHeight variables, and the scale / crop preference. It then recalculates the frame buffer size in bytes then returns TRUE if the size was calculated correctly.
|
|
Set the frame size to be used. Default behaviour calls SetSrcFrameSize() and SetDstFrameSize().
|
|
Set the source frame size to be used. Default behaviour sets the srcFrameWidth and srcFrameHeight variables and recalculates the frame buffer size in bytes then returns TRUE if the size was calculated correctly.
|
|
Set the video conversion vertical flip state |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|