tigrine_smiltpele
asked on
glColor3d distorts colors
i have an array:
int pixelmap[500][500][3]
of pixels (it's a picture) and display it this way:
raudona = (double) pixelmap[i][j][0]/255;
zhalia = (double) pixelmap[i][j][1]/255;
melyna = (double) pixelmap[i][j][2]/255;
glColor3d(raudona, zhalia, melyna);
glVertex2f(movei-1, movej-1);
the displayed result is http://www.mif.vu.lt/~tost1285/after.jpg
the original file http://www.mif.vu.lt/~tost1285/before.jpg
is there more effective way to display pixelmap array?
p.s. i can't just load a texture - i have to work with an array (not necessary integer)
int pixelmap[500][500][3]
of pixels (it's a picture) and display it this way:
raudona = (double) pixelmap[i][j][0]/255;
zhalia = (double) pixelmap[i][j][1]/255;
melyna = (double) pixelmap[i][j][2]/255;
glColor3d(raudona, zhalia, melyna);
glVertex2f(movei-1, movej-1);
the displayed result is http://www.mif.vu.lt/~tost1285/after.jpg
the original file http://www.mif.vu.lt/~tost1285/before.jpg
is there more effective way to display pixelmap array?
p.s. i can't just load a texture - i have to work with an array (not necessary integer)
looks like you are modifying the rgb values before you diplay the picture and then complaining about color distortion .. in this case, you are bound to get some distortion... If you do not want distortions then why not render the picture as it is? Or may be I am missing a poiint?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.