All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vconvert.h File Reference
`#include <ptbuildopts.h>`
`#include <ptlib/videoio.h>`

Go to the source code of this file.

## Classes

class | PColourConverterRegistration
| This class registers a colour conversion class. More...
class | PColourConverter
| This class defines a means to convert an image from one colour format to another. More...
class | PSynonymColour
| Define synonym colour format converter. More...
class | PSynonymColourRegistration
| Define synonym colour format registration. More...

## Macros

#define | PCOLOUR_CONVERTER2(cls, ancestor, srcFmt, dstFmt)
| Declare a colour converter class with Convert() function. More...
#define | PCOLOUR_CONVERTER(cls, src, dst) PCOLOUR_CONVERTER2(cls,PColourConverter,src,dst)
| Declare a colour converter class with Convert() function. More...
#define | PSYNONYM_COLOUR_CONVERTER(from, to) static PSynonymColourRegistration p_##from##_##to##_registration_instance(#from,#to)
| Define synonym colour format. More...

## Macro Definition Documentation

#define PCOLOUR_CONVERTER | ( |  | cls,
|  |  | src,
|  |  | dst
| ) |  | PCOLOUR_CONVERTER2(cls,PColourConverter,src,dst)

Declare a colour converter class with Convert() function.

This should only be used once and at the global scope level for each converter. It declares everything needs so only the body of the Convert() function need be added.

#define PCOLOUR_CONVERTER2 | ( |  | cls,
|  |  | ancestor,
|  |  | srcFmt,
|  |  | dstFmt
| ) |  |

Value:
class cls : public ancestor { \
public: \
cls(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) \
: ancestor(src, dst) { } \
virtual PBoolean Convert(const BYTE *, BYTE *, PINDEX * = NULL); \
virtual PBoolean Convert(const BYTE *, BYTE *, unsigned int , PINDEX * = NULL); \
}; \
static class cls##_Registration : public PColourConverterRegistration { \
public: cls##_Registration() \
: PColourConverterRegistration(srcFmt,dstFmt) { } \
protected: virtual PColourConverter * Create(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) const; \
} p_##cls##_registration_instance; \
PColourConverter * cls##_Registration::Create(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) const \
{ return new cls(src, dst); } \
PBoolean cls::Convert(const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, unsigned int p_srcFrameBytes, PINDEX * bytesReturned) \
{ srcFrameBytes = p_srcFrameBytes;return Convert(srcFrameBuffer, dstFrameBuffer, bytesReturned); } \
PBoolean cls::Convert(const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, PINDEX * bytesReturned)
PBoolean
BOOL PBoolean
Definition: object.h:102
PVideoFrameInfo
Definition: videoio.h:49
PColourConverterRegistration::Create
virtual PColourConverter * Create(const PVideoFrameInfo &src, const PVideoFrameInfo &dst) const =0
PColourConverterRegistration::PColourConverterRegistration
PColourConverterRegistration(const PString &srcColourFormat, const PString &destColourFormat)
PColourConverterRegistration
This class registers a colour conversion class.
Definition: vconvert.h:56
PColourConverter
This class defines a means to convert an image from one colour format to another. ...
Definition: vconvert.h:80

Declare a colour converter class with Convert() function.

This should only be used once and at the global scope level for each converter. It declares everything needs so only the body of the Convert() function need be added.

#define PSYNONYM_COLOUR_CONVERTER | ( |  | from,
|  |  | to
| ) |  | static PSynonymColourRegistration p_##from##_##to##_registration_instance(#from,#to)

Define synonym colour format.

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