From kde-kimageshop Tue Oct 28 22:50:35 2003 From: Patrick Julien Date: Tue, 28 Oct 2003 22:50:35 +0000 To: kde-kimageshop Subject: Re: core/color_strategy X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=106738145429130 > > > Yes, it would, for only 8 bit channels, it's only 65000 values, but I'm > > afraid I don't really understand what you are saying to me here tho. > > Well, going by the Gof book, one could imagine that the image data in a > tile would be stored not as the actual RGB or whatever values, but as > pointers to KoColor objects; for every possible colour a KoColor, but the > same KoColor references many times. No, that was not the intent of this flyweight, here, I would not want to do this for speed considerations. In this case here, flyweight is really for the color strategies, not because we have a lot of them but because their construction is really going to be expensive. Look at it, we a TILE_SIZE * 4 X TILE_SIZE * 4 memory buffer that is being allocated already, we will have the pre-multiplied alpha which will be at least USHRT_MAX colors too. Also, we want to skip on all those multiplies and divides that we would need for rendering otherwise. _______________________________________________ kimageshop mailing list kimageshop@mail.kde.org http://mail.kde.org/mailman/listinfo/kimageshop