2007.07.12 09:05 "Re: [Tiff] how to handle pixel vs. byte-boundary", by Andy Cave
You've hit the nail on the head - this is exactly what you have to do - shift/shuffle the bits all long. This is the sort of thing that anyone dealing with 1 bit images does all the time (such as in RIPs). It's known as a "bitblt".
Rather than code it up yourself, you can get windows/macos to do it using built in functions. On the Mac you'd use something like CopyBits, on Windows you'd use something like (funny enough) BitBlt.
----- Original Message -----
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 (=don'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.