Re: [AD] bug? blit_[to/from]_hdc()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> the only thing that i could find that did not seem right was
> in  /allegro4.1.0/src/win/gdi.c    in method func named
>
> BYTE get_dib(BITMAP * bitmap)
>
> the code for 15bit packed pixel conversion,  and the code for 16bit packed
> pixel conversion looks very similar.
> maybe the shifting is off by one or maybe 2 in this case,  coz isn't the
> green channel a different size for 15bit and 16bit code ?

No, the size is the same. The format of a 16-bit device-independent bitmap
(DIB) in the Win32 API is 5-5-5, so the least significant digit of the
Allegro 6-bit red channel is lost, which probably explains the shift by 4
you experienced.

Your code snippet can be translated as:
    DDB --> DIB -> Allegro bitmap --> DIB --> DDB

It looks like your gfx card/driver supports a 5-6-5 DDB format, like
Allegro. So the DIB format is the bottleneck here.

- Eric



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/