Here's a shortened version of the code I'm proposing to use to process the data at raw_image
#define RAW(row,col) \
Rawdata.raw_image[(row)*S.raw_width+(col)]
BOOL littleEndian = htons(0x55aa) != 0x55aa;
if (!m_bColorRAW)
{
// This is a regular RAW file, so we should have the "raw" 16-bit greyscale
// pixel array hung off RawData.raw_image.
ZASSERT(NULL != RawData.raw_image);
// stuff omitted
// Convert raw data to big-endian
if littleEndian
_swab(
(char*)(RawData.raw_image),
(char*)(RawData.raw_image),
S.raw_height*S.raw_pitch); // Use number of rows times row width in BYTES!!
for (int row = 0; row < S.height; row++)
{
// Write raw pixel data into our private bitmap format
pFiller->Write(RAW(raw, S.left_margin), sizeof(ushort), S.width);
}
Thanks yet again,
Here's a shortened version of the code I'm proposing to use to process the data at raw_image
Does that make sense? Is it correct?
Thanks