Plugins for Krita
Cyrille Berger
cyb at lepi.org
Tue Feb 10 14:33:42 CET 2004
Hello,
> 1) Use of value 255. Use QUANTUM_MAX. Krita is not restricted to 8 bit
> color channels.
ok I made the change.
> 2) Assumption of 3 primary color channels. Again, Krita is not limited to
> RGB, pretty much any color model can be adopted with a corresponding color
> strategy, see core/color_strategy.
yep that's true. I see two ways to implement this :
1) I check the color model, and I must implement my algorithm for each model
2) I made a general algorithm, but I need to know the number of color channels
and if there is an alpha channel. But I didn't see any information about
channels in core/color_strategy, maybe we need to add such information in a
const array in kis_global.h. Maybe it already exists and I didn't find it.
> 3) Not checking for events. Until we have a pipeline where you a simply
> queuing concrete commands to a worker thread. The application will look
> frozen when this is going on. Not much of a problem on small image, but on
> a moderate size one, Krita will just hang there while this executes.
How can I check for events ?
> Even with a worker thread, this would need to access the data on a tile
> boundary so that you can lock the tiles you are working on right now.
I am not quite sure I have understood this very well, do you mean that two
process may want to access to the image at the same time ?
> Avoid the use of malloc/free in a C++ program. Here, the array is not
> necessary, but if it we're, you could have easily done...
>
> std::vector<QUANTUM> buffer;
>
> buffer.resize(w * h * d * sizeof(QUANTUM));
ok I made the change.
> See KisPainter::fillRect() for a simple example. You have to access the
> data on a tile boundary.
for this filter, it won't have any effect on the performance, as I only need
the value of the pixel I am modifying, but most of filters need to access to
more than one pixel. And I think it will cause problem on the border of a
tile.
> > In an ideal world, it would be best, if I could point the current data
> > into the undo stack, and then draw on the image. Is there a way to do
> > this ?
>
> Yes, this is what the drawing operations do in KisPainter.
ok, I will have a closer look at the code of KisPainter.
But as far as I have seen and understood, KisPainter works tile by tile, maybe
we should add function to be able to do this for the entire image in one
global time.
> I look forward to seeing your code in Krita.
so do I ;)
--
--- Cyrille Berger ---
More information about the kimageshop
mailing list