[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Alpha channel support
From:       Antonio Larrosa <antlarr () arrakis ! es>
Date:       2000-10-27 16:56:24
[Download RAW message or body]

Rik Hemsley escribi=F3:
> =

> On Wed, 25 Oct 2000 13:02:37 -0700
> Kurt Granroth <granroth@suse.com> wrote:
> =

> > Rik Hemsley wrote:
> > > I've hacked KIconLoader, KImageEffect and kicker to allow showing i=
cons
> > > with alpha blending. It's not the perfect way to implement this, so=

>                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^=

> > > I'll not check in the code, but I would like us to do it sometime.
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > The results are IMO impressive:
> > >
> > > http://www.geoid.clara.net/kicker_alpha_test.png
> > >
> > > BTW, it's damn fast but I suppose it would be configurable.
> >
> > So when is this going to be committed?
> =

> ... I'd rather wait for a while and use a decent backend implementation=
,
> while also trying to see if there's a better way to put the support int=
o
> kdelibs. With the method I used, apps have to load icons using
> KIconLoader::loadIconImage() instead of loadIcon() or the shortcuts
> (BarIcon, SmallIcon etc). Then they have to call the blending function
> themselves, having created a QImage from their background, for the
> blending function to use. They also have to take care of updating
> themselves when the background changes, and there is no caching of
> images, blended or otherwise.
> =

> So, as you can see, it's not suitable for putting into kdelibs just yet=
=2E
> =

> If anyone would like to chat with me on a way to change the icon loadin=
g/
> displaying design so that we can do this in a more efficient, easy-to-u=
se
> way, please get in touch. It's not top of my TODO list so without help =
it's
> not going to get done very soon.
> =


I'd like to work on that.

I don't think we can do anything about using different methods, those
icons need a special handling as you have to get your background already
prepared when loading those icons an you have to reload the icons
whenever the background changes.

To workaround about this, we can do something like this:
<(maybe) absurd idea>
implement a KTIcon class that you create for each icon passing to the
constructor the icon name and the QWidget object over which you'll
paint the icon. This way, instead of using QPainter::drawPixmap
to draw icons, we should use KTIcon::draw(QPainter &p);
which automatically would get the background of the widget, blend
the transparency, generate a cache index using QPixmap::serialNumber
on the background portion over which the icon is painted, and
paint the icon.
</(not so) absurd idea > :)

If you send me the code you already wrote I can continue
your work on it, if you have other things on your TODO.

Greetings,

--
Antonio Larrosa Jimenez
KDE core developer
antlarr@arrakis.es        larrosa@kde.org
http://www.arrakis.es/~rlarrosa
KDE - The development framework of the future, today.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic