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
August 2007

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

2007.08.17 19:00 "How to write a planar tiff file", by Christian Henning
2007.08.17 19:03 "Re: How to write a planar tiff file", by Toby Thain
2007.08.17 19:10 "How to write a planar tiff file", by Christian Henning
2007.08.17 19:57 "Re: How to write a planar tiff file", by Kai-uwe Behrmann

2007.08.17 19:57 "Re: How to write a planar tiff file", by Kai-uwe Behrmann

Can you set the photometric tag and post a small sample? 
The data type should point to integer automatically.

Am 17.08.07, 15:10 -0400 schrieb Christian Henning:

> ---------- Forwarded message ----------
> From: Christian Henning <chhenning@gmail.com>
> Date: Aug 17, 2007 3:09 PM
> Subject: Re: [Tiff] How to write a planar tiff file
> To: Toby Thain <toby@smartgames.ca>
> 
> 
> On 8/17/07, Toby Thain <toby@smartgames.ca> wrote:
> >
> > On 17-Aug-07, at 4:00 PM, Christian Henning wrote:
> >
> > > Hi there, I'm having problems writing a planar image file. Can
> > > somebody spot the problem in the following code. It's the most basic
> > > writer I can think of.
> >
> > What kind of problem are you having?
> 
> No reader can open the file. Though, I think it's my fault.
> 
> >
> > --Toby
> >
> >
> > >
> > > int main()
> > > {
> > >    TIFF* file = TIFFOpen( "write_test.tif", "w" );
> > >
> > >    TIFFSetField( file, TIFFTAG_IMAGEWIDTH  , 100 );
> > >    TIFFSetField( file, TIFFTAG_IMAGELENGTH , 100 );
> > >    TIFFSetField( file, TIFFTAG_COMPRESSION, COMPRESSION_LZW );
> > >    TIFFSetField( file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE );
> > >    TIFFSetField( file, TIFFTAG_BITSPERSAMPLE  , 8 );
> > >    TIFFSetField( file, TIFFTAG_SAMPLESPERPIXEL, 3 );
> > >
> > >
> > >    std::vector< unsigned char > row( 100 );
> > >
> > >    for( int c = 0; c < 3; ++c )
> > >    {
> > >       for( int y = 0; y < 100; ++y )
> > >       {
> > >          int size = TIFFWriteScanline( file
> > >                                      , &row.front()
> > >                                      , y
> > >                                      , c           );
> > >
> > >          io_error_if( size == -1, "Write error." );
> > >       }
> > >    }
> > >
> > >    TIFFClose( file );
> > > }
> > >
> > >
> > > Thanks ahead,
> > > Christian
> > > _______________________________________________
> > > Tiff mailing list: Tiff@lists.maptools.org
> > > http://lists.maptools.org/mailman/listinfo/tiff
> > > http://www.remotesensing.org/libtiff/
> >
> >
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
> 

Mit freundlichen Grüßen
Kai-Uwe Behrmann
--
Programmierung für Farbmanagement
www.behrmann.name + www.oyranos.org + www.cinepaint.org