Solved

glColor3d distorts colors

Posted on 2003-10-25
4
447 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

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 …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

630 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