Hi,
I have a block of data that was saved as either unsigned shorts or
unsigned chars. I want to make a single pointer to it so I don't have
to keep casting.
BYTE *pData; // the original data, could be stored as unsigned
shorts or unsigned chars.
// A generic pointer to the data, which I want to interpret
depending on spp:
void *p = NULL;
// Here interpret it differently?
if (nSamplesPerPixel == 1) {
p = (unsigned short *)pData;
}
else if (nSamplesPerPixel == 3) {
p = (unsigned char *)pData;
}
How can I do that?
Thanks