Color adjustment filters

Casper Boemann cbr at boemann.dk
Thu Aug 11 18:38:21 CEST 2005


On Thursday 11 August 2005 18:32, Boudewijn Rempt wrote:
> I'm trying to find out where exactly we're making unwarranted assumptions
> about color models and so -- and I've found the following bit of code in
> void KisColorAdjustmentFilter::process(...):
>
>                 KisQuantum d = srcIt[ configPC->channel( i ) ];
>                 Q_INT32 s = configPC->valueFor( i );
>                 if( d < -s  )
> 			dstData[ configPC->channel( i ) ] = 0;
>                 else if( d > QUANTUM_MAX - s)
> 			dstData[ configPC->channel( i ) ] = QUANTUM_MAX;
>                 else
> 			dstData[ configPC->channel( i ) ] = d + s;
>
>
> So, this should be changed in a function that applies a correction to a
> certain channel (and the filter should be changed to loop over the color
> channels, not just the depth of the pixel).
>
> What shall we call this function, and what would be the best type for the
> adjustment? It's an int now, is that okay?
>
> (I'm working on a proposal to make the colormodels a little more svelte and
> at the same time the set of pixel methods they implement extensible and
> flexible. I got a little angry after all.)
please refer to the way I have done brightnessContrast
first alloc an adjustment from the colorspace
then call cs->applyAdjustment(adj)

-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list