Iterators and memory management

kde at kde at
Mon Apr 5 17:49:00 CEST 2004

Quoting Cyrille Berger <cyb at>: 
> ** Selection tools ** 
> I see two ways to store the shape of the selection : 
>  - either we store it in a 2bits mask, it's easy to modify the selection, 
> it's easy to use for graphical operations, but it's painfull for the drawing 
> Maybe you have an other idea ? 
I think this would be the most flexible and extendable way for selections, 
since working with those broken lines would prove too difficult/cpu-intensive 
with advanced selection techniques such as Select by Colour. But maybe the 
mask could be an 8-bit mask for easier implementation of options as the 
feathering of the selection? 
Another thing that would be easier with a mask is the changing of the cursor 
when hovering over a selected area. Now all there needs to be done is to check 
if value mask beneath the cursur is above some threshold, whereas with the 
border-technique there would need to be quite some checks to see if the cursor 
should be changed or not. 
Some things do require more thought with both techniques, though. For example, 
at the moment, krita handles a selection exactly as it handles a layer. This 
has the advantage that any function that does something nice to a layer also 
does the same to a selection. Krita can mirror and transform (albeit a bit 
buggy still) selections as easily as it does with layers. 
Changing the logic behind the selection would require some adaptions to that 
model, I fear. The same problem applies to the iterators as well. 
Bart Coppens 

More information about the kimageshop mailing list