Again, histograms

Bart Coppens kde at
Sat Sep 10 16:01:58 CEST 2005

I'll reply a bit to myself then ;-)

On Thursday 08 September 2005 13:47, Bart Coppens wrote:
> 1) The design
The more I think about alternatives, the more I think this isn't such a bad 
idea actually. Most of the things we'll need can be done with not so big 
changes in this design, whereas most other things I come up with either 
suffer from similar problems, or I fear we might run into trouble later on...

>         KisColorSpaceRegistry::instance() -> add(m_ColorSpaceRGBA);
>         KisHistogramProducerFactoryRegistry::instance() -> add(
>                 new
> KisBasicHistogramProducerFactory<KisBasicU8HistogramProducer>
>                     (KisID("RGB8HISTO", "RGB8 Histogram"),
> m_ColorSpaceRGBA) );
> And even though it's only 2 real lines of code a normal colorspace author
> will need to add
Whoops, that's not entirely correct. It's two lines, but the first one is 
already supposed to be there. The _real_ first line is an 
#include <kis_basic_histogram_producers.h>
which isn't so bad...

> 2) Colorspace independence
Casper came with a nice idea for this on IRC: just say the entire possible 
range is 0.0 - 1.0, and specify the zoom with floats or doubles. Then all you 
need is a positionToString(double pos) to display information to the user.
I tried this for the RGBU16 colorspace, and it seems to work flawlessly: I can 
zoom in and move the active range quite intuitively :-)

Bart Coppens

More information about the kimageshop mailing list