33 #ifndef PTLIB_CONVERT_H
34 #define PTLIB_CONVERT_H
59 const PString & srcColourFormat,
60 const PString & destColourFormat
85 const PString & srcColourFormat,
86 const PString & dstColourFormat,
223 const BYTE * srcFrameBuffer,
224 BYTE * dstFrameBuffer,
225 PINDEX * bytesReturned = NULL
246 PINDEX * bytesReturned = NULL,
247 PBoolean noIntermediateFrame =
false
260 const PString & srcColourFormat,
261 const PString & destColourFormat,
288 PVideoFrameInfo::ResizeMode mode
289 ) {
if (mode < PVideoFrameInfo::eMaxResizeMode)
m_resizeMode = mode; }
298 unsigned r,
unsigned g,
unsigned b,
299 unsigned & y,
unsigned & u,
unsigned & v
302 unsigned r,
unsigned g,
unsigned b,
303 BYTE & y, BYTE & u, BYTE & v
310 unsigned srcX,
unsigned srcY,
unsigned srcWidth,
unsigned srcHeight,
311 unsigned srcFrameWidth,
unsigned srcFrameHeight,
const BYTE * srcYUV,
312 unsigned dstX,
unsigned dstY,
unsigned dstWidth,
unsigned dstHeight,
313 unsigned dstFrameWidth,
unsigned dstFrameHeight, BYTE * dstYUV,
314 PVideoFrameInfo::ResizeMode resizeMode
324 int angle,
unsigned width,
unsigned height, BYTE * srcYUV, BYTE * dstYUV = NULL
330 unsigned x,
unsigned y,
unsigned width,
unsigned height,
331 unsigned frameWidth,
unsigned frameHeight, BYTE * yuv,
332 unsigned r,
unsigned g,
unsigned b
368 #define PCOLOUR_CONVERTER2(cls,ancestor,srcFmt,dstFmt) \
369 class cls : public ancestor { \
371 cls(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) \
372 : ancestor(src, dst) { } \
373 virtual PBoolean Convert(const BYTE *, BYTE *, PINDEX * = NULL); \
375 static class cls##_Registration : public PColourConverterRegistration { \
376 public: cls##_Registration() \
377 : PColourConverterRegistration(srcFmt,dstFmt) { } \
378 protected: virtual PColourConverter * Create(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) const; \
379 } p_##cls##_registration_instance; \
380 PColourConverter * cls##_Registration::Create(const PVideoFrameInfo & src, const PVideoFrameInfo & dst) const \
381 { return new cls(src, dst); } \
382 PBoolean cls::Convert(const BYTE *srcFrameBuffer, BYTE *dstFrameBuffer, PINDEX * bytesReturned) \
390 #define PCOLOUR_CONVERTER(cls,src,dst) \
391 PCOLOUR_CONVERTER2(cls,PColourConverter,src,dst)
429 #define PSYNONYM_COLOUR_CONVERTER(from,to) \
430 static PSynonymColourRegistration p_##from##_##to##_registration_instance(#from,#to)
446 const BYTE * srcFrameBuffer,
447 BYTE * dstFrameBuffer,
448 PINDEX * bytesReturned = NULL
457 #endif // P_JPEG_DECODER
461 #endif // PTLIB_CONVERT_H