gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gorm source reorganization


From: Jeff Teunissen
Subject: Re: Gorm source reorganization
Date: Mon, 04 Apr 2005 03:46:13 -0400

Fred Kiefer wrote:

> Richard Frith-Macdonald wrote:
> > Now, if only we had transparency working (and better focus handling)
> > on windows, I think it would be almost as good as on gnu/linux.  As it
> > is, I think Gorm is now quite usable on windows!
> 
> This transparency stuff is going to haunt me for ever. I really don't
> have a glue why it isn't working, but then the Windows documentation is
> not very clear here.

Actually, it's pretty clear; you just used the wrong pixel format.

Windows GDI has one pixel format for translucent/transparent bitmaps, 32-bit
BGRA. From MSDN:

"Alpha values per pixel are only supported for 32-bpp BI_RGB. This formula
is defined as:

typedef struct {
  BYTE   Blue;
  BYTE   Green;
  BYTE   Red;
  BYTE   Alpha;
};
"

You can't just pass in a GNUstep image, you have to massage the pixels into
the expected format by swapping the red and blue channels. The
BITMAPV4HEADER doesn't change the requirements; the data MUST be 32-bit
BGRA, period. 16-bit images need to be upconverted and then used as 32-bit
bitmaps.

[snip]

> The only note from the documentation I am still thinking about from time
> to time is that colour values should have their alpha value
> pre-multiplied. Not sure, what this will actually mean in code, as we
> leave it to windows to actually create the bitmaps, so I expect Windows
> should be doing whatever it needs. But perhaps this hint means more to
> you...

GNUstep bitmaps generally are premultiplied.

-- 
| Jeff Teunissen  -=-  Pres., Dusk To Dawn Computing  -=-  deek @ d2dc.net
| GPG: 1024D/9840105A   7102 808A 7733 C2F3 097B  161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project        http://www.quakeforge.net/
| Specializing in Debian GNU/Linux              http://www.d2dc.net/~deek/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]