Go to the source code of this file.
Classes | |
class | PColourConverterRegistration |
class | PColourConverter |
class | PSynonymColour |
class | PSynonymColourRegistration |
Defines | |
#define | PCOLOUR_CONVERTER2(cls, ancestor, src, dst) |
#define | PCOLOUR_CONVERTER(cls, src, dst) PCOLOUR_CONVERTER2(cls,PColourConverter,src,dst) |
#define | PSYNONYM_COLOUR_CONVERTER(from, to) static PSynonymColourRegistration p_##from##_##to##_registration_instance(#from,#to) |
#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, | |||||
src, | |||||
dst | ) |
Value:
class cls : public ancestor { \ public: \ cls(const PString & srcFmt, const PString & dstFmt, unsigned w, unsigned h) \ : ancestor(srcFmt, dstFmt, w, h) { } \ virtual BOOL Convert(const BYTE *, BYTE *, PINDEX * = NULL); \ virtual BOOL Convert(const BYTE *, BYTE *, unsigned int , PINDEX * = NULL); \ }; \ static class cls##_Registration : public PColourConverterRegistration { \ public: \ cls##_Registration() \ : PColourConverterRegistration(src,dst) { } \ virtual PColourConverter * Create(unsigned w, unsigned h) const; \ } p_##cls##_registration_instance; \ PColourConverter * cls##_Registration::Create(unsigned w, unsigned h) const \ { PINDEX tab = Find('\t'); return new cls(Left(tab), Mid(tab+1), w, h); } \ BOOL cls::Convert(const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, unsigned int __srcFrameBytes, PINDEX * bytesReturned) \ { srcFrameBytes = __srcFrameBytes;return Convert(srcFrameBuffer, dstFrameBuffer, bytesReturned); } \ BOOL cls::Convert(const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, PINDEX * bytesReturned)
#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.