Commit 8c86b44d authored by Jan Möbius's avatar Jan Möbius

Document stereo code for philips displays

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7498 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 206f1bb7
......@@ -330,34 +330,86 @@ glViewer::drawScenePhilipsStereo()
// ======================================================================================================
uchar *header = new uchar[ 6 ];
// Header ID
// Basic identifier used by the display to verify the header
header[0] = 241; // Header_ID1 = 11110001
// Header content type
// This entry controls the displays internal rendering based on the input data specified here.
// There is no info about how this changes the rendering
// Possible values:
// 0 No Depth
// 1 Signage
// 2 Movie
// 3 Game
// 4 CGI
// 5 Still
header[1] = 3; // Hdr_Content_type (Game) = 00000011 (Gaming Mode)
// Header Factor
// Each 3D Display has a 'Display recommended depth value', which corresponds to an
// acceptable maximum depth factor value for that specific type of display. This value strongly
// depends on the lens design. The factor field in the header contains the percentage to be
// used from the display recommended depth value. The value of 64 corresponds with the 100%
// of the display recommended depth value. It is allowed to use values higher than 64. The factor
// works on a linear scale and is multiplied with the factor controlled by the user in the Display
// Control Tool.
// Value range: 0-255 (default 64)
header[2] = 64; // Hdr_Factor
// Header Offset CC
// Values in the Depth map equal to the header-offset value will be located on the plane of the
// display. All values in the disparity map with a higher value will de displayed in front of the
// display.
// Offset_CC is the offset controlled by the Content Creator. In the system there is also an
// Offset_user present, which is controlled by the user using the Display Control Tool.
// Value Range: 0-255 (default 128)
header[3] = 128; // Hdr_Offset_CC
// Header select
// When all select signals are low the rendering settings are set to optimal settings for the content
// type denoted by Hdr_content_type. By making select signals high the settings for Factor and
// Offset_cc can be controlled individually by the header.
// Possible Values:
// 0 Use Displays defaults and automatic optimizations
// 1 Use Header provided factor
// 2 Use Header provided offset
// 3 Use both factor and offset
header[4] = 0; // Hdr_Factor_select(1) + Hdr_Offset_select(1) + reserved(6)
// Unused Header entry (leave at 0 !)
header[5] = 0; // Reserved
//unsigned long has 32bit = 4Byte
// Header checksum.
// The 4-byte EDC field H(6) − H(9) contains an Error Detection Code computed over the first 6
// header bytes. This EDC uses the standard CRC-32 polynomial as defined in IEEE 802.3 and ITU-T
// V.42. The initial value and final XOR value are both 0.
// unsigned long has 32bit = 4Byte
unsigned long checksum = CalcCRC32(&header[0], 6);
// Store the complete header in a bit vector
std::vector< uchar > bitVector;
// For all bytes of the header
for (int i = 0; i < 6; i++) {
// for each bit of a headers byte
// For each bit of a headers byte
for ( int j = 7 ; j >= 0 ; --j ) {
// Red and Green component have to be 0
bitVector.push_back(0);
bitVector.push_back(0);
// If bit is set, the full component will be set to one otherwise zero
// And the order of the bits has to be reversed!
if ( header[i] & (1 << j ) ) {
bitVector.push_back(255);
} else {
bitVector.push_back(0);
}
// Only every second pixel is used for the header
// Skip every odd one by filling in 0 for RGB
bitVector.push_back(0);
bitVector.push_back(0);
bitVector.push_back(0);
......@@ -367,8 +419,10 @@ glViewer::drawScenePhilipsStereo()
}
// Append checksum to header.
// Reversed bit order!
for (int i=31; i >= 0; i--) {
// Red and Green component have to be 0
bitVector.push_back(0);
bitVector.push_back(0);
......@@ -377,13 +431,16 @@ glViewer::drawScenePhilipsStereo()
else
bitVector.push_back( 0 );
// Only every second pixel is used for the header
// Skip every odd one by filling in 0 for RGB
bitVector.push_back(0);
bitVector.push_back(0);
bitVector.push_back(0);
}
//render the header
// Select the top left of the renderbuffer and
// write complete header into these bits
glRasterPos2i (0,glHeight()-1);
glDrawPixels(bitVector.size()/3, 1,GL_RGB ,GL_UNSIGNED_BYTE , &bitVector[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment