git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5387
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool hasmask = FALSE;
unsigned char *ptr = image->GetData();
bool hasmask = FALSE;
unsigned char *ptr = image->GetData();
uint32 pos = 0;
for (uint32 i = 0; i < h; i++)
{
uint32 pos = 0;
for (uint32 i = 0; i < h; i++)
{
- for (uint32 j = 0; w < h; j++)
+ for (uint32 j = 0; j < h; j++)
- unsigned char alpha = (unsigned char)(raster[pos] >> 24);
+ unsigned char alpha = (unsigned char)TIFFGetA(raster[pos]);
if (alpha < 127)
{
hasmask = TRUE;
if (alpha < 127)
{
hasmask = TRUE;
- ptr[0] = (unsigned char)(raster[pos] >> 16);
+ ptr[0] = (unsigned char)TIFFGetR(raster[pos]);
- ptr[0] = (unsigned char)(raster[pos] >> 8);
+ ptr[0] = (unsigned char)TIFFGetG(raster[pos]);
- ptr[0] = (unsigned char)(raster[pos]);
+ ptr[0] = (unsigned char)TIFFGetB(raster[pos]);
+ ptr -= 2*w*3; // subtract line we just added plus one line