Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate007.isp.belgacom.be (mailgate007.isp.belgacom.be [195.238.5.213])
        by maildelivery012.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l6C9Gh5c030245
        for <joris.at.lebbeke@skynet.be>; Thu, 12 Jul 2007 11:16:44 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 12 Jul 2007 11:16:43 +0200
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 l6C95uYv025321;
	Thu, 12 Jul 2007 05:06:11 -0400
Received: from dns2.namehog.net (dns2.namehog.net [213.52.234.203])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l6C95pe2025318
	for <tiff@lists.maptools.org>; Thu, 12 Jul 2007 05:05:51 -0400
Received: from 81-86-57-99.dsl.pipex.com ([81.86.57.99] helo=EKAT)
	by dns2.namehog.net with esmtpa (Exim 4.66)
	(envelope-from <andy.cave@hamillroad.com>)
	id 1I8ucY-0001Ly-NP; Thu, 12 Jul 2007 10:05:58 +0100
Message-ID: <01ab01c7c463$d5fe55d0$da60fea9@EKAT>
From: "Andy Cave" <andy.cave@hamillroad.com>
To: <tiff@lists.maptools.org>, "Oliver Geisen" <oliver.geisen@kreisbote.de>
References: <EDC66D32-6A16-429A-8C68-FEA2A0E5FFCF@kreisbote.de>
Subject: Re: [Tiff] how to handle pixel vs. byte-boundary
Date: Thu, 12 Jul 2007 10:05:45 +0100
Organization: Hamillroad Software
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=response
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-PopBeforeSMTPSenders: acave@hamillroad.com, activation@hamillroad.com,
	news@hamillroad.com, sales@hamillroad.com,
	support@hamillroad.com
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - dns2.namehog.net
X-AntiAbuse: Original Domain - lists.maptools.org
X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12]
X-AntiAbuse: Sender Address Domain - hamillroad.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: Andy Cave <andy.cave@hamillroad.com>
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>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by maildelivery012.isp.belgacom.be id l6C9Gh5c030245
X-UIDL: 000000000023ceae.00002602
X-MSP-STORE: Thu, 12 Jul 2007 11:17:00 +0200
Status: RO

Hi Oliver.

You've hit the nail on the head - this is exactly what you have to do -=20
shift/shuffle the bits all long. This is the sort of thing that anyone=20
dealing with 1 bit images does all the time (such as in RIPs). It's known=
 as=20
a "bitblt".

Rather than code it up yourself, you can get windows/macos to do it using=
=20
built in functions. On the Mac you'd use something like CopyBits, on Wind=
ows=20
you'd use something like (funny enough) BitBlt.

Regards,

Andy.

----- Original Message -----=20
From: "Oliver Geisen" <oliver.geisen@kreisbote.de>
To: <tiff@lists.maptools.org>
Sent: Wednesday, July 11, 2007 4:13 PM
Subject: [Tiff] how to handle pixel vs. byte-boundary


Hello,

as i try to deal with bilevel images, where 1 pixel equals 1 bit, i
ran more and more into problems.

I want to place a bilevel TIFF onto another one (digital mounting).
Therefore i specifiy x,y-offsets in pixels where to place the second
image on the first.
But if the offset-value isn't divideable by 8 without remainder
(=3Ddon't fit into byte-boundary), it seems that i had to shift ALL
bytes in the scanline to fit into the new position.
This is terrible! Aren't there any other solutions to this problem?
I even don't know how to handle a bitwise-shift over approx. 1000
bytes in a scanline! I would have to shift each byte from right to
left, save the bits falling out of the left side, shift it into the
right side of the next byte, and so forth... arg, this sounds slow.

Oliver Geisen
Systemadministrator
_____________________________
Kreisboten Verlag M=FChlfellner KG
82362 Weilheim i. Ob.
Tel. 0881/686-904
Fax 0881/686-74
Sitz Weilheim, AG M=FCnchen, HRA 64016, p.h.G.:
Kreisboten-Verlag Verwaltungsgesellschaft mbH,
Weilheim, AG M=FCnchen, HRB 119773,
Gesch=E4ftsf=FChrer: Dr. Dirk Ippen, Dr. Gerd Waldenmaier




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


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