Page 2 of 2

[23 Oct 2009] Re: My personal fight against alpha-channel ^_^

Posted: Sat Jun 13, 2020 5:32 pm
by Allanon
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 23 Oct 2009 19:41:51 -0000

I'm workin on the next version of LookHere and I'm implementing a way to have customizable frames around the images, so I've approached this solution: The frame skin is given by an empty frame (with alpha channel if needed, for example to render soft shadows), I load this frame and divide it in nine pieces, like below:

Code: Select all

+-+-+-+
[quote]
[/quote]
+-+-+-+
[quote]
[/quote]
+-+-+-+
[quote]
[/quote]
+-+-+-+
Actually the <E> piece is unused. I render the A, C, G, I frames around the image corners but to fill the borders I've tried using Box with #FILLTEXTURE and the pieces B, D, F and H for each border. It's working fine but if I've an alpha-channel it does not work. If you can implement this feature you will make me very happy :) To be honest I've already written a routine that do the trick but when the user click to see an image I need to show the picture as fast as I can so a native function can save preciuos time :)

Regards

Fabio

[24 Oct 2009] Re: Re: My personal fight against alpha-channel ^_^

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 24 Oct 2009 13:50:26 +0200
It's working fine but if I've an alpha-channel it does not work. If you can implement this feature you will make me very happy :) To be honest I've already written a routine that do the trick but when the user click to see an image I need to show the picture as fast as I can so a native function can save preciuos time :)
Well, the problem is that it would be much work to make #FILLTEXTURE support alpha channels so it's probably not coming very soon :)

BUT, while following this topic, I've seen that there is actually a slight implementation fault in Hollywood because you currently cannot extract the raw color data of an alpha channel image. You can copy the raw alpha channel using #VANILLACOPY but you cannot copy the raw color channels because Hollywood will always apply the alpha channel when drawing using DisplayBrush().

Probably no one noticed this because it led only to a very slight deviation in appearance but the problem was there :) So what I've implemented now, is an extension to the SelectBrush() mode called a combo select mode.

You can enable the combo select mode by specifying the additional argument TRUE, e.g.

Code: Select all

SelectBrush(1, True)
If this is specified, all graphics commands will jam color _AND_ transparency channels into the destination brush. So there's no need to call SelectAlphaChannel() or SelectMask() at all if you want to make vanilla copy of a brush. This should also make things faster in your case because you don't have to use SelectAlphaChannel() any more.