How does the BitBlt color mapping really work?

Rudi Bichler chaoshierophant at yahoo.com
Tue Jun 14 22:51:15 UTC 2005


Hi,
 
I am a bit confused about the color mapping of BitBlt, esp. mapping (from 32 bits) to 1 bit (for From >> stencil). Checking the sources (in 3.7) gave me the following "hints"
 
1. From the comment of BitBlt:
... When blitting from a 32 or 16 bit deep Form to one 8 bits or less, the default is truncation...

2. From Color class >> colorMapIfNeededFrom: sourceDepth to: destDepth
... (sourceDepth >= 16) & (destDepth >= 16) ifTrue: [
  "mapping is done in BitBlt by zero-filling or truncating each color component"
  ^ nil].
 
3. Color class >> computeRGBColormapFor: destDepth bitsPerColor: bitsPerColor
... (#(3 4 5) includes: bitsPerColor)
  ifFalse: [self error: 'BitBlt only supports 3, 4, or 5 bits per color component'].

For a simple test I inserted
        depth >= 16 ifTrue: [^nil].
into Color >> maskingMap: depth. And all my stencil tests ran fine.

Can anyone could please give me a hint how the color mapping of BitBlt really works? Thanks a lot
 
Rudi
 
 
 
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050614/89f5b1cb/attachment.htm


More information about the Squeak-dev mailing list