Strange error

Boudewijn Rempt boud at valdyas.org
Tue Jun 28 23:24:53 CEST 2005


On Tue, 28 Jun 2005, Michael Thaler wrote:

> On Tuesday 28 June 2005 22:42, Boudewijn Rempt wrote:
>
> > Because it is declared inside the first if block -- which is not
> > delimited with brackets but one block that as it were is the
> > same as one statement after the if. If you declare a variable
> > inside a block, it ceases to be referencable outside the block.
>
> I am really too tired to continue to work on Krita.

Me, too, at the moment. Spent the night trying to port Karbon's toolbox to
Krita to get some convergence -- and a sensible ordering of tools inside the toolbox.
Tomorrow, tomorrow... Or maybe not -- tomorrow's a busy day, work's busy,
and I still need to write those papers.

> Obviously it is a pretty
> bad idea to declare variables inside a block...

Not always: if that's the scope where you need them, it's excellent
practice. Always keep your variables in the smalles possible scope.

> But I am quite happy that the
> scaling code is over 100% faster now, at least for large images and on my
> computer.

Which is a great win -- I'll try to backport this to 1.4, so the 1.4.1 release
has this incredible improvement in it.

> I have some more ideas how the scaling code can optimized further. Basically,
> the Mitchell filter needs 5 src pixels for every destination pixel and right
> now the scaling code is basically reading each src line five times. If I
> manage to write an algorithm that checks if we already read a line instead of
> reading it from the src image everytime, the Mitchell algorithm should become
> even faster (and all other algorithms for which the filter support is greater
> then one). So have a good night,

Good ideas -- and good night!

Boudewijn


More information about the kimageshop mailing list