[Qt-interest] Using qgradient for palette generation

Marc Ferland marc at mferland.net
Thu Feb 25 15:22:10 CET 2010


Hi,

I'm trying to generate color tables so that I can use them with
QImage (setColorTable()). 

Now my first question is this: can the color table in QImage be any
size? The data I'm trying to color has a range of about 0-64000. Will
the QImage correctly convert the index to the color even if I have
that many color? I'm asking this because I only see a Format_Indexed8
format for indexed colormaps...

And now for the palette generation: Is there any way to generate a
color palette with a QLinearGradient that spans from 0 to 64000? I
tried to do it with a QIMage and a brush/painter but the qimage has a
maximum width/height of ~32768 if using a one dimension rectangle. I
also tried to do it with a qpainterpath zigzagging accross a 2d image
to no avail... the gradient doesn't follow the path..

Any help would be appreciated!

Regards,

Marc



More information about the Qt-interest-old mailing list