PTLib  Version 2.10.11
PSynonymColour Class Reference

Define synonym colour format converter. More...

#include <vconvert.h>

Inheritance diagram for PSynonymColour:
PColourConverter PObject

Public Member Functions

 PSynonymColour (const PVideoFrameInfo &src, const PVideoFrameInfo &dst)
 
virtual PBoolean Convert (const BYTE *, BYTE *, PINDEX *=NULL)
 Convert from one colour format to another. More...
 
virtual PBoolean Convert (const BYTE *, BYTE *, unsigned int, PINDEX *=NULL)
 
- Public Member Functions inherited from PColourConverter
 PColourConverter (const PString &srcColourFormat, const PString &dstColourFormat, unsigned width, unsigned height)
 Create a new converter. More...
 
 PColourConverter (const PVideoFrameInfo &src, const PVideoFrameInfo &dst)
 
virtual void PrintOn (ostream &strm) const
 Print description of converter. More...
 
PBoolean GetVFlipState ()
 Get the video conversion vertical flip state. More...
 
void SetVFlipState (PBoolean vFlipState)
 Set the video conversion vertical flip state. More...
 
virtual PBoolean SetFrameSize (unsigned width, unsigned height)
 Set the frame size to be used. More...
 
virtual PBoolean SetSrcFrameInfo (const PVideoFrameInfo &info)
 Set the source frame info to be used. More...
 
virtual PBoolean SetDstFrameInfo (const PVideoFrameInfo &info)
 Set the destination frame info to be used. More...
 
virtual void GetSrcFrameInfo (PVideoFrameInfo &info)
 Get the source frame info to be used. More...
 
virtual void GetDstFrameInfo (PVideoFrameInfo &info)
 Get the destination frame info to be used. More...
 
virtual PBoolean SetSrcFrameSize (unsigned width, unsigned height)
 Set the source frame size to be used. More...
 
virtual PBoolean SetDstFrameSize (unsigned width, unsigned height)
 Set the destination frame size to be used. More...
 
virtual PBoolean SetDstFrameSize (unsigned width, unsigned height, PBoolean bScale)
 
const PStringGetSrcColourFormat ()
 Get the source colour format. More...
 
const PStringGetDstColourFormat ()
 Get the destination colour format. More...
 
PINDEX GetMaxSrcFrameBytes ()
 Get the maximum frame size in bytes for source frames. More...
 
PINDEX GetMaxDstFrameBytes ()
 Get the maximum frame size in bytes for destination frames. More...
 
virtual PBoolean ConvertInPlace (BYTE *frameBuffer, PINDEX *bytesReturned=NULL, PBoolean noIntermediateFrame=false)
 Convert from one colour format to another. More...
 
PBoolean GetDstFrameSize (unsigned &width, unsigned &height) const
 Get the output frame size. More...
 
PBoolean GetSrcFrameSize (unsigned &width, unsigned &height) const
 Get the input frame size. More...
 
unsigned GetSrcFrameWidth () const
 
unsigned GetSrcFrameHeight () const
 
unsigned GetDstFrameWidth () const
 
unsigned GetDstFrameHeight () const
 
void SetResizeMode (PVideoFrameInfo::ResizeMode mode)
 Set the resize mode to be used. More...
 
PVideoFrameInfo::ResizeMode GetResizeMode () const
 Get the resize mode to be used. More...
 
- Public Member Functions inherited from PObject
virtual ~PObject ()
 
virtual PObjectClone () const
 Create a copy of the class on the heap. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual const char * GetClass (unsigned ancestor=0) const
 Get the current dynamic type of the object instance. More...
 
PBoolean IsClass (const char *cls) const
 
virtual PBoolean InternalIsDescendant (const char *clsName) const
 Determine if the dynamic type of the current instance is a descendent of the specified class. More...
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank. More...
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream. More...
 

Additional Inherited Members

- Public Types inherited from PObject
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
 Result of the comparison operation performed by the Compare() function. More...
 
- Static Public Member Functions inherited from PColourConverter
static PColourConverterCreate (const PVideoFrameInfo &src, const PVideoFrameInfo &dst)
 Create an instance of a colour conversion function. More...
 
static PColourConverterCreate (const PString &srcColourFormat, const PString &destColourFormat, unsigned width, unsigned height)
 
static void RGBtoYUV (unsigned r, unsigned g, unsigned b, unsigned &y, unsigned &u, unsigned &v)
 Convert RGB to YUV. More...
 
static void RGBtoYUV (unsigned r, unsigned g, unsigned b, BYTE &y, BYTE &u, BYTE &v)
 
static bool CopyYUV420P (unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight, unsigned srcFrameWidth, unsigned srcFrameHeight, const BYTE *srcYUV, unsigned dstX, unsigned dstY, unsigned dstWidth, unsigned dstHeight, unsigned dstFrameWidth, unsigned dstFrameHeight, BYTE *dstYUV, PVideoFrameInfo::ResizeMode resizeMode)
 Copy a section of the source frame to a section of the destination frame with scaling/cropping as required. More...
 
static bool FillYUV420P (unsigned x, unsigned y, int width, int height, unsigned frameWidth, unsigned frameHeight, BYTE *yuv, unsigned r, unsigned g, unsigned b)
 
- Static Public Member Functions inherited from PObject
static const char * Class ()
 Get the name of the class as a C string. More...
 
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect() More...
 
- Protected Member Functions inherited from PColourConverter
void Construct (const PVideoFrameInfo &src, const PVideoFrameInfo &dst)
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 
- Protected Attributes inherited from PColourConverter
PString srcColourFormat
 
PString dstColourFormat
 
unsigned srcFrameWidth
 
unsigned srcFrameHeight
 
unsigned srcFrameBytes
 
unsigned dstFrameWidth
 
unsigned dstFrameHeight
 
unsigned dstFrameBytes
 
PVideoFrameInfo::ResizeMode resizeMode
 
PBoolean verticalFlip
 
PBYTEArray intermediateFrameStore
 
struct jdec_private * jdec
 

Detailed Description

Define synonym colour format converter.

This is a class that defines for which no conversion is required between the specified colour format names.

Constructor & Destructor Documentation

§ PSynonymColour()

PSynonymColour::PSynonymColour ( const PVideoFrameInfo src,
const PVideoFrameInfo dst 
)
inline

Member Function Documentation

§ Convert() [1/2]

virtual PBoolean PSynonymColour::Convert ( const BYTE *  srcFrameBuffer,
BYTE *  dstFrameBuffer,
PINDEX *  bytesReturned = NULL 
)
virtual

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

Implements PColourConverter.

§ Convert() [2/2]

virtual PBoolean PSynonymColour::Convert ( const BYTE *  ,
BYTE *  ,
unsigned  int,
PINDEX *  = NULL 
)
virtual

Implements PColourConverter.


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