2009.12.07 16:06 "[Tiff] Problems with multiple strip G4 to single strip G4 tiff.", by Phillip Wiles

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

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/