Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
143 user(s) are online (128 user(s) are browsing Forums)

Members: 1
Guests: 142

LiveForIt, more...

Support us!

Headlines

 
  Register To Post  

Composite on transparent bitmap
Just popping in
Just popping in


See User information
Hi,

Since there currently seems to be trojan issues with some browsers on Utilitybase, I'm posting my question here :

I'm having weird results when compositing an ARGB32 bitmap over a transparent one (alpha = 0x00), using the following code:

Quote:

IGraphics->CompositeTags(COMPOSITE_Src_Over_Dest, source, dest,
COMPTAG_SrcX, sourceLeft,
COMPTAG_SrcY, sourceTop,
COMPTAG_SrcWidth, width,
COMPTAG_SrcHeight, height,
COMPTAG_OffsetX, destLeft,
COMPTAG_OffsetY, destTop,
TAG_DONE);



The source bitmap RGB colors seem to be blended with the dest one, which should not happen since the alpha of the dest is 0.
Is there some missing tag here to specify that the destination bitmap alpha should be taken into account ? Or maybe the operator is wrong ?

Go to top
Re: Composite on transparent bitmap
Just popping in
Just popping in


See User information
@centaurz

*bump*

Go to top
Re: Composite on transparent bitmap
Just can't stay away
Just can't stay away


See User information
@centaurz

Why are you using COMPOSITE_Src_Over_Dest instead of COMPOSITE_Src if you don't want to do an alpha blended blit?

Go to top
Re: Composite on transparent bitmap
Just popping in
Just popping in


See User information
@salass00

Er... what makes you think I don't want to do an alpha blend ?

I'd like to blend an arbitrary ARGB32 bitmap (A) over another one (B) of which I can't assume anything since it's the render destination of a docky. Here's why :

When compositing is disabled in the GUI prefs, bitmap B is an opaque background, it is simply blitted over the dock (it is a copy of the area behind the dock, that's how fake transparency is achieved in Amidock since OS4).

When compositing is enabled, bitmap B is totally transparent (colour 0 and alpha 0), it is composited over the dock.

So to handle both cases with the same rendering code, CompositeTags() would be a good candidate, but for some reason the color of bitmap B doesn't seem to be premultiplied by its alpha channel, as stated in the autodoc. So the result is e.g. the smooth borders of a png image are blended with the transparent black of bitmap B. Too bad.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project