Return-Path: owner-tiff@olympiakos.com
Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id g1L4PseE022128
	for <dron@localhost>; Thu, 21 Feb 2002 07:25:54 +0300
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.9.0)
	for dron@localhost (single-drop); Thu, 21 Feb 2002 07:25:54 +0300 (MSK)
Received: from gate7.olympiakos.com ([64.32.199.150]) by shared1-mail.whowhere.com; Wed Feb 20 16:31:23 2002
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id TAA09866;
	Wed, 20 Feb 2002 19:10:12 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 20 Feb 2002 19:09:40 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id TAA09837
	for tiff-outgoing; Wed, 20 Feb 2002 19:09:40 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from gate8 (olynthos.olympiakos.com [192.168.1.3])
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id TAA09834;
	Wed, 20 Feb 2002 19:09:39 -0500
From: "Kiriakos Georgiou" <kg@gate7.olympiakos.com>
To: "Clint Tevlin" <actevlin@orokaiva.com>, <tiff@olympiakos.com>
Subject: RE: TIFFWriteScanline query...
Date: Wed, 20 Feb 2002 19:06:05 -0500
Message-ID: <NEBBKGKODKADAPBMOEALOEOOHHAA.kg@gate7.olympiakos.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <000901c1ba14$18ebbfa0$0200a8c0@athlon>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 2133
Lines: 63

This should help.  -K

void tiff::write(const char *filename){

        TIFF *tif_out;
        tsize_t x;
        tsize_t len;

        if (NULL == (tif_out = TIFFOpen (filename, "w")))
                exit (1); /* could not open tif image, simply exit */

        TIFFSetField(tif_out, TIFFTAG_IMAGELENGTH, len=this->len());
        TIFFSetField(tif_out, TIFFTAG_IMAGEWIDTH, this->wid());
        TIFFSetField(tif_out, TIFFTAG_PHOTOMETRIC, this->pho());
        TIFFSetField(tif_out, TIFFTAG_PLANARCONFIG, this->planarconf());
        TIFFSetField(tif_out, TIFFTAG_SAMPLESPERPIXEL, this->samplespp());
        TIFFSetField(tif_out, TIFFTAG_BITSPERSAMPLE, this->bitsps());
        TIFFSetField(tif_out, TIFFTAG_COMPRESSION, this->compr());
        TIFFSetField(tif_out, TIFFTAG_FILLORDER, this->fillord());
        TIFFSetField(tif_out, TIFFTAG_ROWSPERSTRIP, this->rowsps());
        TIFFSetField(tif_out, TIFFTAG_XRESOLUTION, this->xres());
        TIFFSetField(tif_out, TIFFTAG_YRESOLUTION, this->yres());
        TIFFSetField(tif_out, TIFFTAG_SOFTWARE, "libtiff++,
kg@olympiakos.com");

        for (x=0; x < len; x++)
                TIFFWriteScanline (tif_out, this->buf + this->scanlinewidth
* x, x, 0);

        TIFFClose (tif_out);
}

-----Original Message-----
From: owner-tiff@olympiakos.com [mailto:owner-tiff@olympiakos.com]On
Behalf Of Clint Tevlin
Sent: Wednesday, February 20, 2002 8:40 AM
To: tiff@olympiakos.com
Subject: TIFFWriteScanline query...


My application reads fax scanlines, processes them and
writes some of them to a new file.

I'm able to TIFFReadScanline from a fax image ( bi-level
with 1 sample per bit with 1 bit per sample) to a buffer
without any problems.

I check the image width is 216 bytes (=1728bits /8 bits per
byte)

How do I write the scanline to a new file?

Cheers,

Clint


To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org


To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

