Results 1 to 3 of 3

Thread: Loading Sun Raster images

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2002
    Location
    Virginia Beach, VA USA
    Posts
    7

    Loading Sun Raster images

    I have spent over a week trying to display a Sun Raster image. I have the image read into memory and when I display it on a window using glDrawPixels, I get a black square of the right width and height in the middle of the window. There are some dots of different colors where the image is being displayed but the image is almost entirly black. I can't for the life of me figure out what I am doing wrong. If anyone has any clue, I would be most grateful.

    Thanks
    LEPP

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2002
    Location
    Virginia Beach, VA USA
    Posts
    7

    Re: Loading Sun Raster images

    I changed the Pixel format on the glDrawPixels() function to GL_LUMINANCE and the image appears in black and white. If I change it again to GL_GREEN then the image is black and green. When I change to GL_RGB or GL_RGBA, the image is almost entirely black with a couple of pixels of different colors. Any clue?

    Thanks
    LEPP

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Holland
    Posts
    179

    Re: Loading Sun Raster images

    What is the storage format of the Sun Raster image as you have read it into memory?
    Based on that, you can derive the correct glDrawPixels command. If the formats are not compatible, you will have to convert the image (either in memory or before reading) to a format that IS supported by glDrawpixels.

    When you say it works for GL_LUMINANCE and GL_GREEN, but not GL_RGB, then that suggests that there is just one (1) color component in the Sun Raster image format, and that will most likely not work directly with a GL_RGB drawpixels (that one expects three components per pixel, not one).

    Displaying the image in one (1) self-chosen color can be done by setting the active color with glColor() right before doing the glDrawPixels() with GL_LUMINANCE.

    HTH

    Jean-Marc.

Similar Threads

  1. loading tga images
    By Riuzaki90 in forum OpenGL: Linux
    Replies: 2
    Last Post: 02-18-2012, 10:12 AM
  2. Raster Image Loading
    By rakesh_thp in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-01-2009, 11:36 PM
  3. Replies: 8
    Last Post: 12-01-2003, 08:35 AM
  4. loading images please help
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-07-2002, 02:49 AM
  5. Loading Images
    By Sajjad in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-20-2001, 01:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean