- unsigned char alpha = (unsigned char)TIFFGetA(raster[pos]);
- if (alpha < 127)
- {
- hasmask = true;
- ptr[0] = image->GetMaskRed();
- ptr++;
- ptr[0] = image->GetMaskGreen();
- ptr++;
- ptr[0] = image->GetMaskBlue();
- ptr++;
- }
- else
- {
- ptr[0] = (unsigned char)TIFFGetR(raster[pos]);
- ptr++;
- ptr[0] = (unsigned char)TIFFGetG(raster[pos]);
- ptr++;
- ptr[0] = (unsigned char)TIFFGetB(raster[pos]);
- ptr++;
- }
+ *(ptr++) = (unsigned char)TIFFGetR(raster[pos]);
+ *(ptr++) = (unsigned char)TIFFGetG(raster[pos]);
+ *(ptr++) = (unsigned char)TIFFGetB(raster[pos]);
+ if ( hasAlpha )
+ *(alpha++) = (unsigned char)TIFFGetA(raster[pos]);
+