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.07 17:42 "create simple tiff", by Kavallieratou Ergina
2010.01.07 18:05 "Re: create simple tiff", by Bob Friesenhahn
2010.01.07 18:25 "Re: create simple tiff", by Kavallieratou Ergina
2010.01.07 19:47 "Re: create simple tiff", by Bob Friesenhahn
2010.01.07 23:51 "Re: create simple tiff", by Kavallieratou Ergina
2010.01.08 00:13 "can please anybody help?", by Kavallieratou Ergina
2010.01.08 00:39 "Re: can please anybody help?", by Brad Hards

2010.01.07 19:47 "Re: create simple tiff", by Bob Friesenhahn

On Thu, 7 Jan 2010, Kavallieratou Ergina wrote:

> Thank you Bob for the fast answer. I appreciate it.
>
> You did not say what format the data accessed via imagen->data[] is.
> I am sorry it is unsigned char ** data.
>
> The data needs to be packed the same as TIFF, with each 8-bit byte
> representing 8 pixels.
> How can I do that, please? could you give me a sign?

I can not write your code for you, but you are free to look at 
GraphicsMagick for some examples.

One generic approach is my "bit stream" interface which supports 
marshalling an arbitrary (1-32) bits in big-endian order:

   http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/magick/bit_stream.h?rev=1.12.4.1;content-type=text%2Fx-cvsweb-markup
   http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/magick/bit_stream.c?rev=1.1.2.1;content-type=text%2Fx-cvsweb-markup

More specific and efficient algorithms may be found in the 
ExportViewPixelArea() function in this source module:

   http://cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/magick/constitute.c?rev=1.389;content-type=text%2Fx-cvsweb-markup

Look at the 'GrayQuantum' case.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/