finalizing the Iterator API
cbr at boemann.dk
Wed Jul 7 11:35:51 CEST 2004
> Oh, good. Now I think we've threshed out most of the design; we've even
> use case. As far as I'm concerned you can start implementing; do not
> the current kis_iterators.h yet, put the pixel iterators in a different
> so they can co-exist for some time so we don't have to break current
yes lets keep the current iterators for a while. Lets even use the new
iterators in other places first. They should be able to coexist
> So, to summarize:
> * PixelIterators return a pointer to Q_UINT8 (not QUANTUM, since that is a
> remnant from the days Krita depended on ImageMagick for its core, besides
> that gives the impression of being interpreted data already.)
> * Iterators use begin() and end() -- they must have as much as possible
> same syntax as Qt's iterators.
> * Colour strategies interpret the data delivered by the iterators, they
> for instance, return a vector of channel values or a KoColor.
> * Colour strategies have a ChannelInfo object (which I'll extend tonight)
> describes the way *Q_UINT8 will be interpreted
> * Ultimately, I want to get rid of much of the machinery in kis_global.h,
> QUANTUM and its ilk, and the PIXEL_XXX definitions that describe the
> in an array of QUANTUMS for each channel.
> Steps to take:
> 1. Do the basic iterators (straight pixel through image or subrect of
> with selection) -- other return structures (kernel) can come later, as can
> iterators that move in devious ways through the image.
> 2. Extend the current colour strategies to interpret the data and return
> something useful for filters and algorithms.
> 3. Refactor kis_painter to use iterators and colour strategies (pass
> to colour strategy for composition).
> 4. When Krita uses the iterators and nothing else, hide the tile manager
> While doing this, I would tremendously appreciate it if existing
> is not broken. In particular: image import, paint tools, layer
> because those are the essentials that allow us to test Krita.
looks like a good plan.
More information about the kimageshop