I have an array 10X10 with values between 1 to 10. Now say I want to give each value a unique color (Say 1 gets blue 2 gets red etc). I'm using qt qimage to represent the image. Here's what I'm doing
read array from disk. store in a[10][10]
generate a hash table in which each value in the array has a corresponding qRGB
for entire array
get value (say a[0][0])
search hashtable, get equivalent qRGB
image.setPixel(coord,qRGB)
Is this the fastest way I can do this? I have a big image, scanning each pixel, searching its value in a hash table, setting pixel is a bit slow. Is there a faster way?