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

List:       kde-core-devel
Subject:    Re: alpha icons
From:       Dirk Mueller <mueller () kde ! org>
Date:       2000-10-31 17:01:51
[Download RAW message or body]

On Die, 31 Okt 2000, Antonio Larrosa wrote:

> But wouldn't that mean that it would take "double" space ?

since when do you care about resources? Sorry, but don't you just intend to
do alphablending client-side ? This is as resource-hungry as it can get, it
doesn't count anymore then if you you need twice the memory space then. 

The proper solution would be extending KPixmap and using the XFree 4
extension for it. this would even be accellerated and therefore FAST. 

> QImage img(somefile);
> QPixmap xpm=img;
> QImage img2=xpm.convertToImage();
> 
> to set img2 to the same image than img (which is not the case
> with the default Optimization). I'll try to test if that
> works.

the optimisation of QPixmap makes it easier to bundle the QImage with the
QPixmap. all you need to do is set this in the iconloader and you can access
the QImage for free. 

> Well, _each_ icon you load is loaded as an image and then converted
> to a pixmap except for alpha icons, that, right now are loaded as
> QImages, stored as QImages and converted to QPixmaps at paint
> time (inside QPainter::drawImage).

Ugh. I don't understand why we have to do such nasty stuff, but oh well..

> QPixmaps so that the conversion is only done once for alpha icons
> (after blending) but if your idea about setOptimization works ok,
> I'll rethink about all this and look for a better way to do it.

well, you can use a QPixmapCache on such pixmaps. 

> means that it will take a bit more resources when the user selects
> to use alpha icons.

Well, it does that anyway. BTW, CPU is always more expensive than memory. so
if you do QPixmap -> QImage -> QPixmap or only QImage -> QPixmap, I'd prefer
the latter. 


Dirk

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

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