AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2010

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2010.01.08 23:53 "me again...", by Kavallieratou Ergina
2010.01.09 01:14 "Re: me again...", by Bob Friesenhahn
2010.01.11 09:47 "Re: me again...", by Gerben Vos

2010.01.11 09:47 "Re: me again...", by Gerben Vos

Kavallieratou 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.