realbasic-nug
[Top] [All Lists]

Re: nibbling through data

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: nibbling through data
From: "Hadley, Joshua" <joshua dot hadley at agfamonotype dot com>
Date: Thu, 22 Aug 2002 11:53:40 -0500
Hi John,

Unfortunately, it's "none of the above" (I think). I guess I omitted this
important fact in previous messages, but the data is 16-level/4
bit-per-pixel "greyscale", e.g. no RGB color or alpha channel info. If you
can imagine a series of pixels with levels:
        15, 6, 5, 15, 0, 15, 8
.. . . it would be represented in the data I have as:
        F65F0F80  <--note trailing 0 for padding; max is one-half byte of
padding

There is also some header info containing the number of bytes in a row, and
other sort of dimensional info. It is very similar to Mac BitMap structure,
except it uses 4 bits per pixel instead of one. I was hoping this was the
same format as a grey-scale Mac PixMap, but in working with Bjorn at
Einhugur I've discovered that it's (probably) not . . . PixMap wants to have
rowBytes a multiple of 4 (or at least, "a even number" can't remember
exactly which), and my data is not always going to have that (I can have
even or odd rowBytes).

Notable though that I am looking for a mac-only solution for now. Speed is a
primary concern -- despite Knuth's warnings of premature optimization ;-)

Josh


John Balestrieri wrote:

>How are your pixels packed? Are they:
>
>RGBRGBRGB...
>or RRR...BBB...GGG...
>or RGBARGBARGBA...
>or RRR...GGG...BBB...AAA
>where R = Red, G = Green, B = Blue and A = Alpha.
>
>If they are in either of the last two formats, and you need a 
>mac-only solution, I may be able to help.


<Prev in Thread] Current Thread [Next in Thread>