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); \
}; \
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, PINDEX * bytesReturned)
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.