[Kde-graphics-devel] Status update
dan.duley at verizon.net
Tue Jan 18 16:54:20 CET 2005
Hi, all. Just thought I'd give you all a status update on MImage in case your
First off I decided to implement shared images ala Qt. I wasn't going to
implement this initially but decided it would be a good idea. I was worried
that people would do things like return references to images, which is done
all the time in things like KImageEffect. With QImage this returned a shallow
copy but without shared images this returned a deep copy. Not good.
This is complete and the behavior is similiar to Qt. Creating images with
another image in the constructor or assigning images with the "=" operator
creates shallow copies. You can detach images with the detach() method. In
addition you can detach comments and image data separately. Since metadata
like JPEG EXIF info is stored as comments this is pretty useful. It allows
you to use one set of metadata on multiple images without deep copying it.
The thing I am working on now is dithering. There are lots of examples of this
I could use including ImageMagick, NetPBM, and Imlib2. I decided to go with
Imlib2 in this case. It not only handles a lot of different pixel encodings,
(much more so than other implementations), it's already MMX optimized.
It's also a lot more complex... Unlike the Imlib2 smoothscale I'm doing a
total rewrite of this thing. I plan to use this for both file and display
dithering, although I may allow different algorithms to be used for each. For
example, if reducing to 16bpp you may want to use the Imlib-based dithering
for files and simple truncation for display, etc...
As usual, if you want to discuss anything mentioned here or share early code
feel free to email me.
More information about the Kde-graphics-devel