49
49
unsigned char * pSrcLine = pBmpSrc->getPixels();
50
50
unsigned char * pDestLine = pBmpDest->getPixels();
52
54
unsigned char * pSrcPixel = pSrcLine;
53
55
unsigned char * pDstPixel = pDestLine;
55
57
// For the coefficients used, see http://www.inforamp.net/~poynton/
56
58
// Appoximations curtesy of libpng :-).
57
59
if (PF == R8G8B8A8 || PF == R8G8B8X8 || PF == R8G8B8) {
58
60
*pDstPixel = (unsigned char)((pSrcPixel[REDPOS]*54+
60
62
pSrcPixel[BLUEPOS]*19)/256);
64
66
*pDstPixel = (unsigned char)((pSrcPixel[BLUEPOS]*54+
66
68
pSrcPixel[REDPOS]*19)/256);