Solved

glColor3d distorts colors

Posted on 2003-10-25
4
442 Views
Last Modified: 2013-12-06
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)
0
Comment
Question by:tigrine_smiltpele
4 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9685980
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?
0
 

Accepted Solution

by:
tigrine_smiltpele earned 0 total points
ID: 9686267
i've found a solution myself. the problem was that bitmap is holding colors not rgb, but bgr.
when i switched the colors to  glColor3d(melyna, zhalia, raudona); it worked fine
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question