PaintDevice/Layer/Mask/Selection/Overlay

Schleimer, Ben bensch128 at yahoo.com
Tue May 15 02:07:52 CEST 2007


Hi Boud, just a few quick comments on the design:

> 
> Paint Layer
> 
> paint device -> overlays -> effect masks -> projection

Whats the difference between overlays and effect masks? It might be worth clarifying...

> 
> Shapes Layer
> 
> shapes -> canvas paint device -> effect masks -> projection

Ok...

> 
> Group Layer
> 
> layers -> composition -> projection 1 -> effect masks -> projection 2

Why do you need two projections? This might be pre-mature optimization.

> 
> Adjustment Layer
> 
> projection of the stack under the adj layer -> filter -> projection

Ok...

> KisLayer {
>	KisPaintDeviceSP projection
>	QList<KisMask> effectMasks
> }
According to this: http://wiki.koffice.org/index.php?title=Krita/SelectionsMasks, effect masks are
single channel paint devices+a KisFilter. Or is that what KisMask is supposed to be?

> KisShapeLayer::KisLayer {
>	KisPaintDevice canvas
>	KoShapeManager shapeManager
> }
Why does the KisShapeLayer need a canvas? I think it would be much simpler to have it render just
shapes and then have the projecting process add canvas via paint layers underneth the shape layer.

> KisAdjustmentLayer::KisLayer {
> 	KisMaskSP mask
> 	KisFilter filter
> }

You could also just make the KisAdjustmentLayer's mask+filter be an effectmask. It seems to be the
same...

> Two complications:
> 
> * KisAdjustmentLayer shouldn't have effect masks, that's silly.
Um, it's probably not worth limiting this possibility useless it interferes with using adjustment
layers. It could be useful for some people... 

> * The optimization where if there's only one layer and no effect masks, that 
> layer is also the projection of the owning group layer should be kept

Premature optimization. If there are no masks, then projection will be O(1).

> 
> Design problem:
> 
> * I want to make this as generic as possible: so, for composition, 
> thumbnailing etc. we should always be able to call KisLayer::projection(), 
Ok...

> for painting we should be able to call KisLayer::canvas() -- which returns 
> the mask in the case of an adj. layer, the canvas in the case of a paint 
> layer and nothing in the case of other layer types.

This is probably bad generalization of a single method. If you want to provide an accessor to the
paint canvas of the KisPaintLayer, then have a KisPaintLayer::canvas method.
If you want to access the adjustment layers effectmask, then have a
KisAdjustmentLayer::effectMask(). I think its bad to have a method return different items
depending on the class. It'll cause bugs later on.

> 
> Selections:
> 
> Right now the selection is part of KisPaintDevice. We have agreed on having 
> more than one selection type per layer: namely one that determines reading 
> and one that determines writing, and one that determines both. That means 
> three KisSelectionSP's on the paint device, unless we go a KisSelection with 
> three channels, of course.

Why do we need a mask for both? Why not just one for reading and one for writing?

Hope this helps your design work. I love the progress...
Ben

PS. I wonder if per-layer selections is wise from the UI POV. How is the user going to know if
he's working with the global selection or layer selection? Is the global selection going to be
overridden by the local selection whether the user switches layers? How/why would the user save
the global selection to the layer?



More information about the kimageshop mailing list