On Sat, 2005-12-17 at 18:27 +0900, Carsten Haitzler wrote: > technically - yes. it's a bug. it's due to the fact that the routines dont > have > a special case for multiple when alpha doesnt contain sensible data (filling > it > in with an assumed 0xff) :)
I argued this on mplayer-dev, and provided a trivial patch to change swscaler to fill alpha channel with 0xff for conversions to (RGB|BGR)32. My argument was basically what you just said: that 0xff is a more sensible default. http://itdp.fh-biergarten.de/~itdp/html/mplayer-dev-eng/2005-05/msg00398.html Ultimately my patch was never merged. Instead they suggested that the library I was working with (evas) should have a way to ignore the alpha channel. I knew that it had (evas_object_image_alpha_set), but it didn't work properly when alpha < 255. I didn't want to mention that fact, because once I indicated there was a problem with the library I was using, they'd just ignore me. :) Well, they ignored me anyway ... However, I've also noticed the same behavior in xine's yuv2rgb scaling/conversion code. Also, my ultimate goal is to get mplayer's swscaler into xine as an optional shared library, and when my application uses that, I'd simply be back to square one. So it'd be nice to fix the issue within evas. I suspect this won't really be a simple change. It's not really acceptable to add has_alpha==false comparisons in the inner blending loops, so really what you're looking at is a separate code path for the case where has_alpha==false that simply doesn't multiply with the image's alpha channel. The blending code would be _almost_ the same as the existing routines (a bit simpler) but that's a lot of extra code. That could possibly be mitigated with macros, but that always uglifies things. :) Anyway, I haven't actually looked at the code yet, so I'm just making educated guesses. I first wanted to see if such a patch would be accepted, or perhaps if someone else who's far more familiar with evas was motivated to do it. :) Cheers, Jason.
signature.asc
Description: This is a digitally signed message part
