| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2010.01.11 09:47 "Re: me again...", by Gerben VosKavallieratou Ergina wrote:
> struct gen
> {
> unsigned char ** data;
> unsigned short int width;
> unsigned short int height;
> unsigned short int bits_per_pixel;
> };
> bits= imagen->data[y*imagen->width];
Actually, maybe it should really still be:
bits= imagen->data[y];
Or maybe it should be (note the '&'):
bits= &imagen->data[y*imagen->width];
It all depends what kind of data imagen->data points to EXACTLY.
Does data point directly to the pixels? Then you should have declared
it as BYTE *, not BYTE **, and you should multiply by the size of the
scanline in bytes (note that in Windows BMPs, that size is rounded up to
a multiple of 4 bytes, but in TIFF to a single byte). Or does it point
to an array of pointers, which each then points to the data of a
scanline? In that case, the multiplication already happened when
you initialized that extra array, so you don't need to do it here.
Gerben.
|
|||||||