Mipmapping for canvas. Ideas and comments.

C. Boemann cbo at boemann.dk
Tue Jul 21 13:26:21 CEST 2009

On Tuesday 21 July 2009 12:43:12 Dmitry Kazakov wrote:
> I think the  second variant is better. At least  for the beginning. So
I do too :)

> There are some points where i'm in doubt now:
> 1)  Should we  use KisProjectionCache  for storing  original  image?
> I  guess not,  because  it  could  be used  much  in
> drawScaledImage much.
well we should store the basic non scaled version in the pyramid too.

> 2) Which  zoom-levels should  be stored inside  m_pyramid? I  saw that
> when you  press Ctrl+'+'/'-' Krita switches across  some finite number
> of levels. Which part of Krita/Koffice decides, which levels to use? I
> guess, these levels and levels in m_pyramid should agree :)
Ko zoomcontroller action (whatever it's called now). It used to be in gui 

> 3) KisPresceledProjection::Private::prescaledQImage vs
>   KisPresceledProjection::Private::prescaledQPixmap?
> What is the difference and where are they mostly used?
Pixmaps reside on the xserver and are fast to paint over and over again
Images reside on the client and are good if you need to poke at the pixels or 
change it every time you display it

An image will be converted to a pixmap internally before being drawn on 
your screen, and this conversion is usually quite expensive.

As to the levels and scaleX/scaleY. I think that the pyramid should just 
scale with a factor of 2 (in both x and y) for each step. You should then take 
the closest image and apply the scaleX/scaleY.

Good work so far :)

More information about the kimageshop mailing list