Received: from mailgate011.isp.belgacom.be (mailgate011.isp.belgacom.be [195.238.6.4])
	by maildelivery003.isp.belgacom.be (Postfix) with ESMTP id BC9C01D8014
	for <joris.at.lebbeke@skynet.be>; Mon, 14 Jan 2008 13:26:46 +0100 (CET)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 14 Jan 2008 13:26:45 +0100
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m0EC2WWO024065;
	Mon, 14 Jan 2008 07:03:25 -0500
Received: from web15309.mail.cnb.yahoo.com (web15309.mail.cnb.yahoo.com
	[203.209.230.39])
	by duke.maptools.org (8.12.11/8.12.10) with SMTP id m0EC2AaJ024060
	for <tiff@lists.maptools.org>; Mon, 14 Jan 2008 07:02:11 -0500
Received: (qmail 64521 invoked by uid 60001); 14 Jan 2008 12:02:01 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.cn;
	h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
	b=DopTHWAxwu03axwCgX2GCwsHw9A7W0ufyh4n63zqN6kLiXmhlC0jiLYkdJwuN1/l0aYCFZYOv/LxWE+wEZro5AOs+5N+hfALMAtyZ0L+DqSxuqhYk3pKhJNywrgbX4SsiV7NyBXgxrsIpkCSijCp+9m5TpKbF8tpEGm8WZjJFH4=;
X-YMail-OSG: VQliYtgVM1kkSljCYzWWdvdUeht7v.vxePw7TBRAL2E_o.Bp_EZ8rmRYa0AJBilzauehPXauTyd50vQvluw4zNk3xtkJt6u9A.pNDou50ris19f7w.4-
Received: from [58.172.76.148] by web15309.mail.cnb.yahoo.com via HTTP;
	Mon, 14 Jan 2008 20:02:00 CST
Date: Mon, 14 Jan 2008 20:02:00 +0800 (CST)
From: gis geo <gis3600@yahoo.com.cn>
Subject: =?gb2312?q?=BB=D8=B8=B4=A3=BA=20RE:=20[Tiff]=20TIFFWriteScanline=20-=20wr?=
	=?gb2312?q?ite=20band=20orders?=
To: tiff@lists.maptools.org
In-Reply-To: <C2F34B4088C6514E86F06DA928A2D21803039F99@OVL-EXBE01.ocevenlo.oce.net>
MIME-Version: 1.0
Message-ID: <432142.63981.qm@web15309.mail.cnb.yahoo.com>
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0956050521=="
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.000029ea
X-MSP-STORE: Mon, 14 Jan 2008 13:26:46 +0100
Status:   

--===============0956050521==
Content-Type: multipart/alternative; boundary="0-1490657258-1200312120=:63981"
Content-Transfer-Encoding: 7bit

--0-1490657258-1200312120=:63981
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: quoted-printable

Thanks Rob.

Basically in the filter output, I wish to copy the same buffer from the 2=
nd row (j=3D1) to the 1st row (j=3D0), and copy the buffer from the last =
second row (j=3Dheight-2) to the last row (j=3Dheight-1). During the data=
 read, I used this

for (j =3D 1; j < height-1;    j++)
{
...
}

to omit the read of the first row (j=3D0) and the last row (j=3Dheight-1)=
, using other buffer variables. From this loop, j will never reach j=3Dhe=
ight-1.

I feel the code I included in the post does make a complete buffer write,=
 from j=3D0 to j=3Dheight-1.

TIM



"Tillaart, Rob van den" <rob.vandentillaart@oce.com> =D0=B4=B5=C0=A3=BA  =
   Hi
 Think the error is in the line=20
        if (j =3D=3Dheight-2  )
 =20
   It should be=20
     if (j =3D=3D height-1)
 as otherwise the last line (j=3D=3Dheight) isn't wriiten. =20
 =20
 give it a try
 rob
 =20
=20
=20

      =20
---------------------------------
   From: tiff-bounces@lists.maptools.org    [mailto:tiff-bounces@lists.ma=
ptools.org] On Behalf Of gis    geo
Sent: maandag 14 januari 2008 7:33
To:    tiff@lists.maptools.org
Subject: [Tiff] TIFFWriteScanline - write    band orders


  =20
   Hi All,
   =20
   I am learning and testing TIFF Lib, and have experienced the following=
    problem:
   =20
   I wish to write a 16-bit RGB imagery with separate planes, using the  =
  following codes
   =20
   ...
     TIFFSetField(out, TIFFTAG_IMAGEWIDTH,    width); =20
  TIFFSetField(out, TIFFTAG_IMAGELENGTH,    height);
     TIFFSetField(out, TIFFTAG_BITSPERSAMPLE,    16);
  TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL,    3);
  TIFFSetField(out, TIFFTAG_PLANARCONFIG,    2);
  TIFFSetField(out, TIFFTAG_PHOTOMETRIC,    2);
  TIFFSetField(out, TIFFTAG_COMPRESSION,    COMPRESSION_NONE);=20
     TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,    TIFFDefaultStripSize(out,=
 1));=20
  =20
    for (j =3D 0; j < height;    j++)
      {
    ...
       TIFFWriteScanline(out, buf_r, j,    0);
    TIFFWriteScanline(out, buf_g, j,    1);
    TIFFWriteScanline(out, buf_b, j,    2);
  }=20
=20
   The output is fine and works. I can verify that.
   =20
   But, after I have applied a 3*3 filter analysis, and I wish to output =
the    same row-by-row data in this form, and the output tiff file is wro=
ng:
   =20
      for (j =3D 1; j < height-1;    j++)
   {
    ...
  =20
   if (j =3D=3D1    )
   {
    TIFFWriteScanline(out, buf_r,    j-1, 0);
    TIFFWriteScanline(out, buf_g, j-1,    1);
    TIFFWriteScanline(out, buf_b, j-1,    2);
   }
   =20
       TIFFWriteScanline(out, buf_r, j,    0);
    TIFFWriteScanline(out, buf_g, j,    1);
    TIFFWriteScanline(out, buf_b, j,    2);
=20
   if (j =3D=3Dheight-2    )
   {
    TIFFWriteScanline(out, buf_r,    j+1, 0);
    TIFFWriteScanline(out, buf_g, j+1,    1);
    TIFFWriteScanline(out, buf_b, j+1,    2);
   }
     }
   =20
   I could not figure out why. This might to related to TIFFWriteScanline=
()    and some expectation from the Tiff Lib that I did not specify.
   =20
   THANK you in advance.
   =20
   =20
  =20
=20
   =20
   =20
     =20

---------------------------------
   =D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=
=D0=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1 =20
 This message and attachment(s) are intended solely for use by the addres=
see and may contain information that is privileged, confidential or other=
wise exempt from disclosure under applicable law.    If you are not the i=
ntended recipient or agent thereof responsible for delivering this messag=
e to the intended recipient, you are hereby notified that any disseminati=
on, distribution or copying of this communication is strictly prohibited.=
   If you have received this communication in error, please notify the se=
nder immediately by telephone and with a 'reply' message.    Thank you fo=
r your co-operation.=20

      =20
---------------------------------
=D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=D0=
=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1=20
--0-1490657258-1200312120=:63981
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: quoted-printable

Thanks Rob.<br><br>Basically in the filter output, I wish to copy the sam=
e buffer from the 2nd row (j=3D1) to the 1st row (j=3D0), and copy the bu=
ffer from the last second row (j=3Dheight-2) to the last row (j=3Dheight-=
1). During the data read, I used this<br><br>for (j =3D 1; j &lt; height-=
1;    j++)<br>{<br>...<br>}<br><br>to omit the read of the first row (j=3D=
0) and the last row (j=3Dheight-1), using other buffer variables. From th=
is loop, j will never reach j=3Dheight-1.<br><br>I feel the code I includ=
ed in the post does make a complete buffer write, from j=3D0 to j=3Dheigh=
t-1.<br><br>TIM<br><br><br><br><b><i>"Tillaart, Rob van den" &lt;rob.vand=
entillaart@oce.com&gt;</i></b> =D0=B4=B5=C0=A3=BA<blockquote class=3D"rep=
lbq" style=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; =
padding-left: 5px;">   <meta http-equiv=3D"Content-Type" content=3D"text/=
html; charset=3Dgb2312"> <meta content=3D"MSHTML 6.00.2800.1605" name=3D"=
GENERATOR"> <div dir=3D"ltr" align=3D"left"><font color=3D"#0000ff" face=3D=
"Arial"
 size=3D"2"><span class=3D"304522107-14012008">Hi</span></font></div> <di=
v dir=3D"ltr" align=3D"left"><span class=3D"304522107-14012008"><font col=
or=3D"#0000ff" face=3D"Arial" size=3D"2">Think the error is in the line <=
/font></span></div> <div dir=3D"ltr" align=3D"left"><span class=3D"304522=
107-14012008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2"><font col=
or=3D"#000000" size=3D"3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (j=
 =3D=3Dheight-2  )</font></font></span></div> <div><span class=3D"3045221=
07-14012008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2"><font colo=
r=3D"#000000" size=3D"3"></font></font></span>&nbsp;</div> <div><span cla=
ss=3D"304522107-14012008"> <div dir=3D"ltr" align=3D"left"><span class=3D=
"304522107-14012008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2">&n=
bsp;It should be </font></span></div> <div dir=3D"ltr" align=3D"left"><sp=
an class=3D"304522107-14012008">&nbsp;&nbsp;&nbsp; <font color=3D"#0000ff=
" face=3D"Arial" size=3D"2">if (j =3D=3D height-1)</font></span></div> <d=
iv dir=3D"ltr" align=3D"left"><span
 class=3D"304522107-14012008"><font color=3D"#0000ff" face=3D"Arial" size=
=3D"2">as otherwise the last line (j=3D=3Dheight) isn't wriiten.  </font>=
</span></div> <div dir=3D"ltr" align=3D"left"><span class=3D"304522107-14=
012008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2"></font></span>&=
nbsp;</div> <div dir=3D"ltr" align=3D"left"><span class=3D"304522107-1401=
2008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2">give it a try</fo=
nt></span></div> <div dir=3D"ltr" align=3D"left"><span class=3D"304522107=
-14012008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2">rob</font></=
span></div> <div dir=3D"ltr" align=3D"left"><span class=3D"304522107-1401=
2008"><font color=3D"#0000ff" face=3D"Arial" size=3D"2"></font></span>&nb=
sp;</div> <div dir=3D"ltr" align=3D"left"><br>&nbsp;</div></span></div> <=
blockquote style=3D"border-left: 2px solid rgb(0, 0, 255); padding-left: =
5px; margin-left: 5px; margin-right: 0px;">   <div class=3D"OutlookMessag=
eHeader" dir=3D"ltr" align=3D"left" lang=3D"en-us">   <hr tabindex=3D"-1"=
>   <font face=3D"Tahoma"
 size=3D"2"><b>From:</b> tiff-bounces@lists.maptools.org    [mailto:tiff-=
bounces@lists.maptools.org] <b>On Behalf Of </b>gis    geo<br><b>Sent:</b=
> maandag 14 januari 2008 7:33<br><b>To:</b>    tiff@lists.maptools.org<b=
r><b>Subject:</b> [Tiff] TIFFWriteScanline - write    band orders<br></fo=
nt><br></div>   <div></div>   <div>Hi All,</div>   <div>&nbsp;</div>   <d=
iv>I am learning and testing TIFF Lib, and have experienced the following=
    problem:</div>   <div>&nbsp;</div>   <div>I wish to write a 16-bit RG=
B imagery with separate planes, using the    following codes</div>   <div=
>&nbsp;</div>   <div>...</div>   <div>&nbsp;&nbsp;TIFFSetField(out, TIFFT=
AG_IMAGEWIDTH,    width);&nbsp;&nbsp;<br>&nbsp;&nbsp;TIFFSetField(out, TI=
FFTAG_IMAGELENGTH,    height);</div>   <div>&nbsp;&nbsp;TIFFSetField(out,=
 TIFFTAG_BITSPERSAMPLE,    16);<br>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_=
SAMPLESPERPIXEL,    3);<br>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_PLANARCO=
NFIG,  =20
 2);<br>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_PHOTOMETRIC,    2);<br>&nbs=
p;&nbsp;TIFFSetField(out, TIFFTAG_COMPRESSION,    COMPRESSION_NONE);&nbsp=
;</div>   <div>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,    TIF=
FDefaultStripSize(out, 1));&nbsp;</div>   <div><br>&nbsp;&nbsp;&nbsp;&nbs=
p;for (j =3D 0; j &lt; height;    j++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;{<br>&nbsp;&nbsp;&nbsp; ...</div>   <div>&nbsp;&nbsp;&nbsp; TIFFWrit=
eScanline(out, buf_r, j,    0);<br>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(o=
ut, buf_g, j,    1);<br>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_b, =
j,    2);<br>&nbsp;&nbsp;}&nbsp;<br>&nbsp;</div>   <div>The output is fin=
e and works. I can verify that.</div>   <div>&nbsp;</div>   <div>But, aft=
er I have applied a 3*3 filter analysis, and I wish to output the    same=
 row-by-row data in this form, and the output tiff file is wrong:</div>  =
 <div>&nbsp;</div>   <div>&nbsp;&nbsp;&nbsp;for (j =3D 1; j &lt; height-1=
;  =20
 j++)<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp; ...</div>   <div><br>&=
nbsp;&nbsp;&nbsp;if (j =3D=3D1    )<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp=
;&nbsp; TIFFWriteScanline(out, buf_r,    j-1, 0);<br>&nbsp;&nbsp;&nbsp; T=
IFFWriteScanline(out, buf_g, j-1,    1);<br>&nbsp;&nbsp;&nbsp; TIFFWriteS=
canline(out, buf_b, j-1,    2);<br>&nbsp;&nbsp;&nbsp;}</div>   <div>&nbsp=
;</div>   <div>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_r, j,    0);=
<br>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_g, j,    1);<br>&nbsp;&=
nbsp;&nbsp; TIFFWriteScanline(out, buf_b, j,    2);<br>&nbsp;<br>&nbsp;&n=
bsp;&nbsp;if (j =3D=3Dheight-2    )<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp=
;&nbsp; TIFFWriteScanline(out, buf_r,    j+1, 0);<br>&nbsp;&nbsp;&nbsp; T=
IFFWriteScanline(out, buf_g, j+1,    1);<br>&nbsp;&nbsp;&nbsp; TIFFWriteS=
canline(out, buf_b, j+1,    2);<br>&nbsp;&nbsp;&nbsp;}</div>   <div>&nbsp=
;&nbsp;}</div>   <div>&nbsp;</div>   <div>I could not figure out why. Thi=
s might to related to TIFFWriteScanline()  =20
 and some&nbsp;expectation from the Tiff Lib that I did not specify.</div=
>   <div>&nbsp;</div>   <div>THANK you in advance.</div>   <div>&nbsp;</d=
iv>   <div>&nbsp;</div>   <div><br>&nbsp;</div>   <div>&nbsp;</div>   <di=
v>&nbsp;</div>   <div>   </div><hr size=3D"1">   <a href=3D"http://cn.mai=
l.yahoo.com/gc/index.html?entry=3D5&amp;souce=3Dmail_mailletter_tagline">=
=D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=D0=
=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1</a>  </blockquote><br clear=3D"al=
l"> This message and attachment(s) are intended solely for use by the add=
ressee and may contain information that is privileged, confidential or ot=
herwise exempt from disclosure under applicable law.    If you are not th=
e intended recipient or agent thereof responsible for delivering this mes=
sage to the intended recipient, you are hereby notified that any dissemin=
ation, distribution or copying of this communication is strictly prohibit=
ed.   If you have received this communication in error, please notify the=
 sender immediately by telephone and with a
 'reply' message.    Thank you for your co-operation. </blockquote><br><p=
>&#32;


      <hr size=3D1><a href=3D"http://cn.mail.yahoo.com/gc/index.html?entr=
y=3D5&souce=3Dmail_mailletter_tagline">=D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=
=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=D0=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=
=A1</a>=20
--0-1490657258-1200312120=:63981--

--===============0956050521==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============0956050521==--
