PDA

View Full Version : Data displayed via color map



bitChanger
23rd October 2006, 19:47
I've written an application that takes in an array of doubles and creates a QImage for the data using setPixel. The QRgb values are taken from another QImage that I created for the colormap.

The colormap has a min val and a max val where min equals index 0 and max equals index numColors.

Keeping track of this index mapping I loop over the data setting each pixel to the QRgb that is returned from my colormap indexing routine.

This is very slow for 512x512x32 images and higher.

What I really need is the ability for the data to be the image, where the point values are lookups into a colormap and the image can be updated by simply changing the colormap not by re setPixel'ing each point.

Any help on this would be great.

Thanks.

For this application I'm running Qt 3.3.2 under Windows XP

bitChanger
23rd October 2006, 20:27
Never mind. I've solved my own problem.

Once rendering a QImage one time with scanline and setting the colormap of that image I should be able to change the colormap based on the integer values assigned in the QImage. I just need to map my double data points to an integer value lookup number of the QImage colormap.

Thanks anyway.

I'll post again if this doesn't work.