Q_UINT8 and Pixel

Casper Boemann cbr at boemann.dk
Fri Mar 10 16:36:36 CET 2006


From: "Leonardo Giordani" <leonardo.giordani at treuropa.com>
>I was looking at LMS color space:
>
> kis_lms_f32_colorspace.cc:66
>
> void KisLmsF32ColorSpace::setPixel(Q_UINT8 *dst, float longWave, float
> middleWave, float shortWave, float alpha) const
> {
>    Pixel *dstPixel = reinterpret_cast<Pixel *>(dst);
>
> Why are we using Q_UINT8 * externally, casting it to Pixel * inside?
> Asked in a better way: why are we using Q_UINT8 instead of Pixel?
>
Because outside of colorspaces a pixel is just bytes.

Only when inside the colorspace object does the bytes have meaning. And 
Pixel is a locally defined object inside the colopspace.

in rgb it contains r, g, b and alpha
in cmyk it contains c, m, y, k and alpha

Hope this explains it

best regards
Casper 




More information about the kimageshop mailing list