Patch for speeding up the painting of the autobrush

Boudewijn Rempt boud at valdyas.org
Tue Feb 2 16:45:04 CET 2010


On Tue, 2 Feb 2010, Dmitry Kazakov wrote:

> Maybe, there is some bug in the interpolation code?

That's possible.


> Btw, all the brushes are center-symmetrical. And the brushes before rotation
> are axis-symmetrical.
> So this ca be generalized for all the brushes:
> 
> axis-symmetrical (1/4 of the brush):
> 0<i<width/2; 0<j<height/2;
> pixelAt(i,j) -> pixelAt(width-i, height-j)
> pixelAt(i,j) -> pixelAt(width-i, j)
> pixelAt(i,j) -> pixelAt(i, height-j)
> 
> center-symmetrical (1/2 of the brush):
> 0<i<width/2; 0<j<height;
> pixelAt(i,j) -> pixelAt(width-i, height-j)

Yes, that's on Lukas' todo.

> I think you need to get the maths equation for the valueAt, or approximate
> your own first. This can ease the following optimizations much.
> E.g. you will be able to build n-dimensional spline for this function, that
> will be much more efficient than a lookup table, or use tan(angle) instead
> of angle.

I think it would be nice if you could expand on this with some example code?

> Isn't rotation included into valueAt? If not, i think it's bad. Constructing
> the spline will take care for all the sin/cos calls as well.

It is, and if the mask generation is efficient enough, I think this won't be needed.

> > o if that's not enough mip mapping (like we do in gbr brush)
> >
> 
> As a last resort only. It is quite expensive as well.

Yes.

Boudewijn



More information about the kimageshop mailing list