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.9.3/8.9.3) with ESMTP id TAA09753
	for <dron@localhost>; Tue, 20 Feb 2001 19:55:28 +0300
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.6.0)
	for dron@localhost (single-drop); Tue, 20 Feb 2001 19:55:28 +0300 (MSK)
Received: from gate7.olympiakos.com ([207.176.88.85]) by shared1-mail.whowhere.com; Tue Feb 20 08:34:02 2001
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id LAA21029;
	Tue, 20 Feb 2001 11:19:34 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Tue, 20 Feb 2001 11:08:49 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id LAA20898
	for tiff-outgoing; Tue, 20 Feb 2001 11:08:48 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from cse.unl.edu (root@cse.unl.edu [129.93.33.1])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id LAA20895
	for <tiff@olympiakos.com>; Tue, 20 Feb 2001 11:08:46 -0500
Received: from localhost (cterlapu@localhost)
	by cse.unl.edu (8.11.2/8.9.1) with ESMTP id f1KG8S96347224
	for <tiff@olympiakos.com>; Tue, 20 Feb 2001 10:08:28 -0600 (CST)
Date: Tue, 20 Feb 2001 10:08:28 -0600
From: Chakravarthy Terlapu <cterlapu@cse.unl.edu>
To: tiff@olympiakos.com
Subject: need help  
Message-ID: <Pine.SGI.4.05.10102201007460.6133913-100000@cse.unl.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-tiff@olympiakos.com
Status: RO
Content-Length: 1871
Lines: 87

Hi,

I have a image called street.tif and 2 boxes whose coordinates are for
example as follows;

//Box1
frc[i].lx = x1;   //left x-coordinate        
frc[i].ly = y1;   //left y-coordinate   
frc[i].tx = x2;   //top x-coordinate   
frc[i].ty = y2;   //top y-coordinate   
frc[i].rx = x3;   //right x-coordinate   
frc[i].ry = y3;   //right y-coordinate 
frc[i].bx = x4;   //bottom x-coordinate 
frc[i].by = y4;   //bottom y-coordinate 

//Box2
frc[i].lx = x11; 
frc[i].ly = y11; 
frc[i].tx = x22; 
frc[i].ty = y22; 
frc[i].rx = x33; 
frc[i].ry = y33; 
frc[i].bx = x44;
frc[i].by = y44;   

I need to create a new image say street1.tif which contains 
street.tif - boxes i.e I have to erase all pixels within the
box1 and box2.

It would be great if anyone could help me. 

THanks
Chakravarthy Terlapu



 #include "tiffio.h"
 #include <stdio.h>

main()
{ 
  int i,j,k;
  unsigned short t;
  int linebytes, outbytes;
  uint32 w,h;
  uint32 row;
  unsigned char *inbuf,*outbuf;
 
  TIFF* in;
  TIFF* out;
 
  in=TIFFOpen("street.tif","r");
  out=TIFFOpen("street1.tif","w");
 
  TIFFGetField(in, TIFFTAG_IMAGELENGTH, &h);
  TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &w);

  TIFFSetField(out, TIFFTAG_IMAGELENGTH, h);
  TIFFSetField(out, TIFFTAG_IMAGEWIDTH, w);
  TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1);
  TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1);
  TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
  TIFFSetField(out, TIFFTAG_ORIENTATION, 1);

  linebytes=TIFFScanlineSize(in);
  outbytes=TIFFScanlineSize(out);

  inbuf=_TIFFmalloc(linebytes);
  outbuf=_TIFFmalloc(outbytes);

   for(row=0; row<h; i++)
   {
     TIFFReadScanline(in, inbuf, row, 0);

     //Here how can I do the processing of removing the pixels within the box




     TIFFWriteScanline(out, inbuf, row, 0 ); 
   }
  TIFFClose(in);
  TIFFClose(out);

  free(inbuf);
  free(outbuf);
}

