[info-performer] Framebuffer and RGB Color Values

Date view Thread view Subject view Author view

From: faculaganymede (faculaganymede++at++yahoo.com)
Date: 06/04/2004 14:30:05


pfExperts,

I need to find out how RGB color values are stored in
a Framebuffer.

This is what I am doing in my program:

1. I set my framebuffer to have the following
configuration:
        static int FBAttrs[] = {
                PFFB_RGBA,
                PFFB_DOUBLEBUFFER,1,
                PFFB_RED_SIZE, 12,
                PFFB_GREEN_SIZE, 12,
                PFFB_BLUE_SIZE, 12,
                PFFB_ALPHA_SIZE, 12,
                PFFB_DEPTH_SIZE, 32,
                NULL,
        };

2. Allocate a 3D data array of type unsigned short:
      unsigned short image[512][512][3];

3. Assign values to the 3D data array, so each
dimension represents a color component:
        image[i][j][0]; //red component
        image[i][j][1]; //green component
        image[i][j][2]; //blue component

4. Use "glDrawPixels(width, height, GL_RGB, GL_SHORT,
image);" to write image data to framebuffer.

5. Send data from framebuffer to the DVP (Digital
Video Port, DDO2) channel, where the video format of
the DVP channel is configured so the pixel format is
12-bit RGB.

6. Read the RBA color values from the output signal of
the DVP channel as 12-bit data.

So in summary, I am writing 16-bit RGB data to a
framebuffer that is configured to 12-bit RGB, then try
to read the values of each color component from the
DVP channel as 12-bit data per pixel.

My questions are:
1. Does the 16-bit RGB data get truncated to 12-bit
RGB data before it is stored in the framebuffer?

2. Or, does the 16-bit RGB data get converted to
floating point color values from 0.0 to 1.0, which
gets converted to 12-bit data, and then stored into
the framebuffer?

3. In the framebuffer, are the 12-bit RGB values
stored as integers from 0 to 4095 ?

4. If the framebuffer does store the 12-bit RGB values
as integers from 0 to 4095, is there any data
manipulation done between the framebuffer and what
gets output to the DVP channel?

Please advise.

=====
Thanks,
faculaganymede

        
                
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jun 04 2004 - 14:33:05 PDT