Design ideas about iterators
roger.larsson at norran.net
Wed Mar 3 12:23:23 CET 2004
On Tuesday 02 March 2004 22.18, Boudewijn Rempt wrote:
> On Tuesday 02 March 2004 02:39, Cyrille Berger wrote:
> > Tell what's your opinion about it ?
> I'm not completely convinced that this idea has already fully
> crystallized... One problem I'm currently having is the definition of
> QUANTUM -- having QUANTUM as a typedef and using it all over the place
> makes it terribly hard to have 16 or 32 bits per channel other than as a
> compile option. That's fine for ImageMagick, where it originally came from,
> but for an interactive app, I'd prefer something more flexible. And it's
> doable, I'm sure, because Photogenics (gratis demo for Linux available) can
> do it.
> But making QUANTUM more flexible and hide that flexibility (I'd really hate
> to have a QUANTUM8, QUANTUM16 and QUANTUM32 defined and switch statements
> everywhere), you need to reconsider iterating over quantums.
What is a quantum?
* One color component of a pixel?
* The minimum storage unit?
If it is a color component then we will need QUANTUM16 in the future. But if
it is the minimum storage unit it will never need to change (and we could
remove that flexibility from the definition - QUANTUM_DEPTH)
To store 16 bits use two quantum...
One RGBA pixel four (or eight) quantum.
More information about the kimageshop