+ unsigned char *
+ pAlpha = (unsigned char *)(bHasAlpha ? image->GetAlpha() : NULL);
+ int iHeight = image->GetHeight();
+ int iWidth = image->GetWidth();
+
+ unsigned char uchMaskRed = 0, uchMaskGreen = 0, uchMaskBlue = 0;
+
+ if ( bHasMask )
+ {
+ uchMaskRed = image->GetMaskRed();
+ uchMaskGreen = image->GetMaskGreen();
+ uchMaskBlue = image->GetMaskBlue();
+ }
+
+ unsigned char *pColors = image->GetData();
+
+ for (int y = 0; y != iHeight; ++y)