git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4958
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxPCX_VERERR = 3 // error in pcx version number
};
wxPCX_VERERR = 3 // error in pcx version number
};
// ReadPCX:
// Loads a PCX file into the wxImage object pointed by image.
// Returns wxPCX_OK on success, or an error code otherwise
// ReadPCX:
// Loads a PCX file into the wxImage object pointed by image.
// Returns wxPCX_OK on success, or an error code otherwise
// Get the histogram of the image, and decide whether to save
// as 8 bit or 24 bit, according to the number of colours.
//
// Get the histogram of the image, and decide whether to save
// as 8 bit or 24 bit, according to the number of colours.
//
- ncolours = image->ComputeHistogram(h);
+ ncolours = image->CountColours(257);
+ image->ComputeHistogram(h);
format = wxPCX_8BIT;
nplanes = 1;
}
format = wxPCX_8BIT;
nplanes = 1;
}
key = (r << 16) | (g << 8) | b;
hnode = (wxHNode *) h.Get(key);
key = (r << 16) | (g << 8) | b;
hnode = (wxHNode *) h.Get(key);
- if (!hnode)
- wxLogError("!hnode");
- else
- p[i] = hnode->index;
key = node->GetKeyInteger();
hnode = (wxHNode *) node->GetData();
key = node->GetKeyInteger();
hnode = (wxHNode *) node->GetData();
- if (!hnode)
- wxLogError("!hnode");
- else
- {
- pal[3 * hnode->index] = (unsigned char)(key >> 16);
- pal[3 * hnode->index + 1] = (unsigned char)(key >> 8);
- pal[3 * hnode->index + 2] = (unsigned char)(key);
- delete hnode;
- }
+ pal[3 * hnode->index] = (unsigned char)(key >> 16);
+ pal[3 * hnode->index + 1] = (unsigned char)(key >> 8);
+ pal[3 * hnode->index + 2] = (unsigned char)(key);
+ delete hnode;