Solved

glColor3d distorts colors

Posted on 2003-10-25
4
443 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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