[futurebasic] Re: [FB] Re:mask pixels/Alpha channel

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Thu, 15 Feb 2001 18:04:16 +0100

Robert Covington wrote:

> <snip>
> >> Note the 4 in the here ... 16, 32, 4 <--- Some Alpha/ Transparency flag?
> <snip>
> >> My question...what is this info?
> >
> >Hi Robert,
> >
> >A wild guess is that it is the value stored in the cmpCount field of the
> >PixMapHandle here is what my old Think Ref says about that field:
> >
> >cmpCount: Color components per pixel
> >
> >With indexed pixels, each pixel is a single value representing an index in a
> >color table, and therefore the cmpCount field of a pixel map record is 1 - the
> >index is the single component. With direct pixels, each pixel contains three
> >components, one integer each for the intensities of red, green, and blue, so
> >cmpCount is 3. Other values are undefined (sic).
> >
> >so I believe the following sequence: 32,4,8 means:
> >32 bits per pixel, 4 components per pixel (red, green, blue and alpha), each
> >component is described with 8 bits.
>
> Alain, that would explain a lot.
>
> CopyMask and CopyDeepMask are not recorded when a picture is open, only
> Copybits works, so that isn't the path. Must be some poking that needs to
> be going on with the resulting handle.
>
> Now, how to go about doing that. At least a direction is clear. Thanks.
>
> In the Toolbox standard include there is a pixmap record, and cmpCount is
> one of the fields there. But how/when to poke the info?
> My futile attempts thus far change nothing.

Did you try one of the following:

pixmapH..cmpCount = 4
or
% [pixmapH] + 34,4

Generally, Toolbox calls are provided to modify structure fields and we don't have
to poke manually the values (moreover it is most often not recommended), but I
can't seem to find a Toolbox call for that purpose. To tell the truth I'm unable
to understand all the subtleties of QuickDraw imaging.
My poor understanding is that the values for the pixels are stored in sequence (r,
g, b, and a), so I think I would try then to poke the alpha channel values at
src.3`` and watch the mess after that.

IHNIITWH
--

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------