Commit f9d965d3 authored by Mike Kremer's avatar Mike Kremer
Browse files

Adapted stereo settings context menu to directly change values when changing the sliders.

Added option entries for philips stereo mode.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7568 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a8be68eb
...@@ -139,6 +139,18 @@ static std::vector<float> anaglyphRightEyeColors_ = std::vector<float> (9, 0.0); ...@@ -139,6 +139,18 @@ static std::vector<float> anaglyphRightEyeColors_ = std::vector<float> (9, 0.0);
/// mouse cursor depth picking in stereo mode /// mouse cursor depth picking in stereo mode
static bool stereoMousePick_ = true; static bool stereoMousePick_ = true;
/// philips stereo header content type
static int stereoPhilipsContentType_ = 3; // Game
/// philips stereo header factor
static int stereoPhilipsFactor_ = 64;
/// philips stereo header offset
static int stereoPhilipsOffset_ = 128;
/// philips stereo header select
static int stereoPhilipsSelect_ = 0; // Display's defaults
/// Store the synchronization mode /// Store the synchronization mode
static bool synchronization_ = false; static bool synchronization_ = false;
...@@ -346,7 +358,7 @@ QString pluginDirStr() { return pluginDir_.absolutePath(); } ...@@ -346,7 +358,7 @@ QString pluginDirStr() { return pluginDir_.absolutePath(); }
QString shaderDirStr() { return shaderDir_.absolutePath(); } QString shaderDirStr() { return shaderDir_.absolutePath(); }
QString textureDirStr() { return textureDir_.absolutePath(); } QString textureDirStr() { return textureDir_.absolutePath(); }
QString licenseDirStr() { return licenseDir_.absolutePath(); } QString licenseDirStr() { return licenseDir_.absolutePath(); }
QString scriptDirStr() { return scriptDir_.absolutePath(); } QString scriptDirStr() { return scriptDir_.absolutePath(); }
QString iconDirStr() { return iconDir_.absolutePath(); } QString iconDirStr() { return iconDir_.absolutePath(); }
QString translationsDirStr() { return translationsDir_.absolutePath(); } QString translationsDirStr() { return translationsDir_.absolutePath(); }
QString fontsDirStr() { return fontsDir_.absolutePath(); } QString fontsDirStr() { return fontsDir_.absolutePath(); }
...@@ -639,6 +651,54 @@ bool stereoMousePick( ) { ...@@ -639,6 +651,54 @@ bool stereoMousePick( ) {
return stereoMousePick_; return stereoMousePick_;
} }
/// Store philips stereo header content type
void stereoPhilipsContent( int _content )
{
stereoPhilipsContentType_ = _content;
}
/// get philips stereo header content type
int stereoPhilipsContent( )
{
return stereoPhilipsContentType_;
}
/// Store philips stereo header factor
void stereoPhilipsFactor( int _factor )
{
stereoPhilipsFactor_ = _factor;
}
/// get philips stereo header factor
int stereoPhilipsFactor( )
{
return stereoPhilipsFactor_;
}
/// Store philips stereo header offset
void stereoPhilipsOffset( int _offset )
{
stereoPhilipsOffset_ = _offset;
}
/// get philips stereo header offset
int stereoPhilipsOffset( )
{
return stereoPhilipsOffset_;
}
/// Store philips stereo header select
void stereoPhilipsSelect( int _select )
{
stereoPhilipsSelect_ = _select;
}
/// get philips stereo header select
int stereoPhilipsSelect( )
{
return stereoPhilipsSelect_;
}
/// Store synchronization mode setting /// Store synchronization mode setting
void synchronization( bool _synchronization ) { void synchronization( bool _synchronization ) {
synchronization_ = _synchronization; synchronization_ = _synchronization;
......
...@@ -496,6 +496,38 @@ bool dataDir(QString _dir); ...@@ -496,6 +496,38 @@ bool dataDir(QString _dir);
DLLEXPORT DLLEXPORT
bool stereoMousePick( ); bool stereoMousePick( );
/// Store philips stereo header content type
DLLEXPORT
void stereoPhilipsContent( int _content );
/// get philips stereo header content type
DLLEXPORT
int stereoPhilipsContent( );
/// Store philips stereo header factor
DLLEXPORT
void stereoPhilipsFactor( int _factor );
/// get philips stereo header factor
DLLEXPORT
int stereoPhilipsFactor( );
/// Store philips stereo header offset cc
DLLEXPORT
void stereoPhilipsOffset( int _offset );
/// get philips stereo header offset cc
DLLEXPORT
int stereoPhilipsOffset( );
/// Store philips stereo header select
DLLEXPORT
void stereoPhilipsSelect( int _select );
/// get philips stereo header select
DLLEXPORT
int stereoPhilipsSelect( );
/// Store synchronization setting /// Store synchronization setting
DLLEXPORT DLLEXPORT
void synchronization( bool _synchronization ); void synchronization( bool _synchronization );
......
...@@ -526,9 +526,33 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -526,9 +526,33 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
stereoSettingsWidget_ = new StereoSettingsWidget(this); stereoSettingsWidget_ = new StereoSettingsWidget(this);
// Make it look like a dialog // Make it look like a dialog
stereoSettingsWidget_->setWindowFlags(Qt::Popup); stereoSettingsWidget_->setWindowFlags(Qt::Popup);
// Connect Ok button to local slot // Connect combo boxes and sliders to local slots
connect(stereoSettingsWidget_->confirmButton, SIGNAL(pressed()), connect(stereoSettingsWidget_->stereoOpengl, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings())); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->stereoAnaglyph, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->stereoCustomAnaglyph, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->stereoPhilips, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->focalDistance, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerContentType, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerFactor, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerSelect, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
// Close button
connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()),
stereoSettingsWidget_, SLOT(hide()));
} }
......
...@@ -811,7 +811,9 @@ public: ...@@ -811,7 +811,9 @@ public:
void stereoButtonContextMenu(const QPoint& _pos); void stereoButtonContextMenu(const QPoint& _pos);
/// Is called if the user has changed stereo settings /// Is called if the user has changed stereo settings
void slotApplyStereoSettings(); /// Note: The parameter just makes sure, we can connect
/// all necessary signals to this slot. It has no use for now.
void slotApplyStereoSettings(int _tmpParam = 0);
private: private:
......
...@@ -346,31 +346,69 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) { ...@@ -346,31 +346,69 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
stereoSettingsWidget_->eyeDistance->setValue(OpenFlipper::Options::eyeDistance()); stereoSettingsWidget_->eyeDistance->setValue(OpenFlipper::Options::eyeDistance());
stereoSettingsWidget_->focalDistance->setValue(OpenFlipper::Options::focalDistance() * 1000); stereoSettingsWidget_->focalDistance->setValue(OpenFlipper::Options::focalDistance() * 1000);
// Philips stereo mode part
stereoSettingsWidget_->headerContentType->setCurrentIndex(OpenFlipper::Options::stereoPhilipsContent());
stereoSettingsWidget_->headerFactor->setValue(OpenFlipper::Options::stereoPhilipsFactor());
stereoSettingsWidget_->headerOffsetCC->setValue(OpenFlipper::Options::stereoPhilipsOffset());
stereoSettingsWidget_->factorCounter->setNum(OpenFlipper::Options::stereoPhilipsFactor());
stereoSettingsWidget_->offsetCounter->setNum(OpenFlipper::Options::stereoPhilipsOffset());
stereoSettingsWidget_->headerSelect->setCurrentIndex(OpenFlipper::Options::stereoPhilipsSelect());
// Default values are strange...
/*
std::cerr << "Content type: " << OpenFlipper::Options::stereoPhilipsContent() << std::endl;
std::cerr << "Factor: " << OpenFlipper::Options::stereoPhilipsFactor() << std::endl;
std::cerr << "Offset: " << OpenFlipper::Options::stereoPhilipsOffset() << std::endl;
std::cerr << "Select: " << OpenFlipper::Options::stereoPhilipsSelect() << std::endl;
*/
// Show right stacked widget
if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
stereoSettingsWidget_->stackedWidget->setCurrentIndex(1);
} else {
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
}
// Move widget to the position of the cursor // Move widget to the position of the cursor
stereoSettingsWidget_->move(stereoButton_->mapToGlobal(_pos)); stereoSettingsWidget_->move(stereoButton_->mapToGlobal(_pos) - QPoint((int)(stereoSettingsWidget_->width()/2), 0));
// Show widget // Show widget
stereoSettingsWidget_->show(); stereoSettingsWidget_->show();
} }
void CoreWidget::slotApplyStereoSettings() { void CoreWidget::slotApplyStereoSettings(int /*_tmpParam*/) {
// Hide widget
stereoSettingsWidget_->hide();
// Update values // Update values
if (stereoSettingsWidget_->stereoCustomAnaglyph->isChecked()) { if (stereoSettingsWidget_->stereoCustomAnaglyph->isChecked()) {
// Update option entry
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom); OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom);
// Show right stacked widget
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
} else if (stereoSettingsWidget_->stereoAnaglyph->isChecked()) { } else if (stereoSettingsWidget_->stereoAnaglyph->isChecked()) {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan); OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
} else if (stereoSettingsWidget_->stereoPhilips->isChecked()) { } else if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips); OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(1);
} else { } else {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL); OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
} }
OpenFlipper::Options::eyeDistance(stereoSettingsWidget_->eyeDistance->value()); if(stereoSettingsWidget_->stackedWidget->currentIndex() == 0) {
OpenFlipper::Options::focalDistance( OpenFlipper::Options::eyeDistance(stereoSettingsWidget_->eyeDistance->value());
(float)stereoSettingsWidget_->focalDistance->value() / 1000); OpenFlipper::Options::focalDistance(
(float)stereoSettingsWidget_->focalDistance->value() / 1000);
} else {
// Update labels that display the current values
stereoSettingsWidget_->factorCounter->setNum(stereoSettingsWidget_->headerFactor->value());
stereoSettingsWidget_->offsetCounter->setNum(stereoSettingsWidget_->headerOffsetCC->value());
// Set option entries
OpenFlipper::Options::stereoPhilipsContent(stereoSettingsWidget_->headerContentType->currentIndex());
OpenFlipper::Options::stereoPhilipsFactor(stereoSettingsWidget_->headerFactor->value());
OpenFlipper::Options::stereoPhilipsOffset(stereoSettingsWidget_->headerOffsetCC->value());
OpenFlipper::Options::stereoPhilipsSelect(stereoSettingsWidget_->headerSelect->currentIndex());
}
// Update all views // Update all views
for (unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i) { for (unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i) {
......
...@@ -160,10 +160,10 @@ glViewer::drawScene_glStereo() ...@@ -160,10 +160,10 @@ glViewer::drawScene_glStereo()
void void
glViewer::drawScenePhilipsStereo() glViewer::drawScenePhilipsStereo()
{ {
int vp_l, vp_b, vp_w, vp_h; int vp_l, vp_b, vp_w, vp_h;
glstate_->get_viewport (vp_l, vp_b, vp_w, vp_h); glstate_->get_viewport (vp_l, vp_b, vp_w, vp_h);
// ====================================================================================================== // ======================================================================================================
// creating a color texture // creating a color texture
// ====================================================================================================== // ======================================================================================================
...@@ -176,13 +176,13 @@ glViewer::drawScenePhilipsStereo() ...@@ -176,13 +176,13 @@ glViewer::drawScenePhilipsStereo()
GLenum texType = GL_UNSIGNED_BYTE; GLenum texType = GL_UNSIGNED_BYTE;
GLenum texFilterMode = GL_NEAREST; GLenum texFilterMode = GL_NEAREST;
glTexImage2D(texTarget, 0, texInternalFormat, vp_w, vp_h, 0, texFormat, texType, NULL); glTexImage2D(texTarget, 0, texInternalFormat, vp_w, vp_h, 0, texFormat, texType, NULL);
glTexParameterf(texTarget, GL_TEXTURE_MIN_FILTER, texFilterMode); glTexParameterf(texTarget, GL_TEXTURE_MIN_FILTER, texFilterMode);
glTexParameterf(texTarget, GL_TEXTURE_MAG_FILTER, texFilterMode); glTexParameterf(texTarget, GL_TEXTURE_MAG_FILTER, texFilterMode);
glTexParameterf(texTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(texTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(texTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameterf(texTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(texTarget, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); glTexParameteri(texTarget, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);
// ====================================================================================================== // ======================================================================================================
// creating an 24-bit depth + 8-bit stencil texture // creating an 24-bit depth + 8-bit stencil texture
// ====================================================================================================== // ======================================================================================================
...@@ -207,28 +207,28 @@ glViewer::drawScenePhilipsStereo() ...@@ -207,28 +207,28 @@ glViewer::drawScenePhilipsStereo()
// ====================================================================================================== // ======================================================================================================
depthStencilTexture.disable(); depthStencilTexture.disable();
colorTexture.disable(); colorTexture.disable();
// ====================================================================================================== // ======================================================================================================
// Render the scene // Render the scene
// ====================================================================================================== // ======================================================================================================
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
drawScene_mono(); drawScene_mono();
// ====================================================================================================== // ======================================================================================================
// Copy Scene to Textures // Copy Scene to Textures
// ====================================================================================================== // ======================================================================================================
colorTexture.enable(); colorTexture.enable();
colorTexture.bind(); colorTexture.bind();
glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, vp_l, vp_b, vp_w, vp_h); glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, vp_l, vp_b, vp_w, vp_h);
colorTexture.disable(); colorTexture.disable();
depthStencilTexture.enable(); depthStencilTexture.enable();
depthStencilTexture.bind(); depthStencilTexture.bind();
glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, vp_l, vp_b, vp_w, vp_h); glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, vp_l, vp_b, vp_w, vp_h);
depthStencilTexture.disable(); depthStencilTexture.disable();
// ====================================================================================================== // ======================================================================================================
...@@ -237,22 +237,22 @@ glViewer::drawScenePhilipsStereo() ...@@ -237,22 +237,22 @@ glViewer::drawScenePhilipsStereo()
GLSL::PtrVertexShader vertexShader; GLSL::PtrVertexShader vertexShader;
GLSL::PtrFragmentShader fragmentShader; GLSL::PtrFragmentShader fragmentShader;
GLSL::PtrProgram program; GLSL::PtrProgram program;
QString vshaderFile = OpenFlipper::Options::shaderDirStr() + QDir::separator() + "Philips/Vertex.glsl"; QString vshaderFile = OpenFlipper::Options::shaderDirStr() + QDir::separator() + "Philips/Vertex.glsl";
QString fshaderFile = OpenFlipper::Options::shaderDirStr() + QDir::separator() + "Philips/Fragment42.glsl"; QString fshaderFile = OpenFlipper::Options::shaderDirStr() + QDir::separator() + "Philips/Fragment42.glsl";
//// ////
vertexShader = GLSL::loadVertexShader( vshaderFile.toStdString().c_str() ); vertexShader = GLSL::loadVertexShader( vshaderFile.toStdString().c_str() );
fragmentShader = GLSL::loadFragmentShader( fshaderFile.toStdString().c_str() ); fragmentShader = GLSL::loadFragmentShader( fshaderFile.toStdString().c_str() );
program = GLSL::PtrProgram(new GLSL::Program()); program = GLSL::PtrProgram(new GLSL::Program());
if ( (vertexShader == 0) || if ( (vertexShader == 0) ||
(fragmentShader == 0) || (fragmentShader == 0) ||
(program == 0) ) { (program == 0) ) {
std::cerr << "Unable to load shaders for philips display rendering!"; std::cerr << "Unable to load shaders for philips display rendering!";
return; return;
} }
program->attach(vertexShader); program->attach(vertexShader);
program->attach(fragmentShader); program->attach(fragmentShader);
program->link(); program->link();
...@@ -262,26 +262,26 @@ glViewer::drawScenePhilipsStereo() ...@@ -262,26 +262,26 @@ glViewer::drawScenePhilipsStereo()
// Bind textures to different texture units and tell shader where to find them // Bind textures to different texture units and tell shader where to find them
// ====================================================================================================== // ======================================================================================================
glActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB);
colorTexture.enable(); colorTexture.enable();
colorTexture.bind(); colorTexture.bind();
glActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB);
depthStencilTexture.enable(); depthStencilTexture.enable();
depthStencilTexture.bind(); depthStencilTexture.bind();
program->setUniform("ColorTexture",0); program->setUniform("ColorTexture",0);
program->setUniform("DepthStencil",1); program->setUniform("DepthStencil",1);
// ====================================================================================================== // ======================================================================================================
// Render plain textured // Render plain textured
// ====================================================================================================== // ======================================================================================================
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL); glDisable(GL_COLOR_MATERIAL);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
// ====================================================================================================== // ======================================================================================================
// Setup orthogonal projection // Setup orthogonal projection
// ====================================================================================================== // ======================================================================================================
...@@ -298,7 +298,7 @@ glViewer::drawScenePhilipsStereo() ...@@ -298,7 +298,7 @@ glViewer::drawScenePhilipsStereo()
// Bind textures to different texture units and tell shader where to find them // Bind textures to different texture units and tell shader where to find them
// ====================================================================================================== // ======================================================================================================
glColor3f(1.0,1.0,1.0); glColor3f(1.0,1.0,1.0);
// ====================================================================================================== // ======================================================================================================
// Clear buffers // Clear buffers
// ====================================================================================================== // ======================================================================================================
...@@ -314,13 +314,13 @@ glViewer::drawScenePhilipsStereo() ...@@ -314,13 +314,13 @@ glViewer::drawScenePhilipsStereo()
glTexCoord2f(1.0f, 0.0f); glVertex2i( vp_w, 0); glTexCoord2f(1.0f, 0.0f); glVertex2i( vp_w, 0);
glTexCoord2f(0.0f, 0.0f); glVertex2i( 0, 0); glTexCoord2f(0.0f, 0.0f); glVertex2i( 0, 0);
glEnd(); glEnd();
program->disable(); program->disable();
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);
// ====================================================================================================== // ======================================================================================================
// Cleanup (color and depth textures) // Cleanup (color and depth textures)
// ====================================================================================================== // ======================================================================================================
depthStencilTexture.del(); depthStencilTexture.del();
colorTexture.del(); colorTexture.del();
...@@ -333,7 +333,7 @@ glViewer::drawScenePhilipsStereo() ...@@ -333,7 +333,7 @@ glViewer::drawScenePhilipsStereo()
// Header ID // Header ID
// Basic identifier used by the display to verify the header // Basic identifier used by the display to verify the header
header[0] = 241; // Header_ID1 = 11110001 header[0] = 241; // Header_ID1 = 11110001
// Header content type // Header content type
// This entry controls the displays internal rendering based on the input data specified here. // This entry controls the displays internal rendering based on the input data specified here.
// There is no info about how this changes the rendering // There is no info about how this changes the rendering
...@@ -344,8 +344,8 @@ glViewer::drawScenePhilipsStereo() ...@@ -344,8 +344,8 @@ glViewer::drawScenePhilipsStereo()
// 3 Game // 3 Game
// 4 CGI // 4 CGI
// 5 Still // 5 Still
header[1] = 3; // Hdr_Content_type (Game) = 00000011 (Gaming Mode) header[1] = OpenFlipper::Options::stereoPhilipsContent(); // Hdr_Content_type (Game) = 00000011 (Gaming Mode)
// Header Factor // Header Factor
// Each 3D Display has a 'Display recommended depth value', which corresponds to an // 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 // acceptable maximum depth factor value for that specific type of display. This value strongly
...@@ -355,8 +355,8 @@ glViewer::drawScenePhilipsStereo() ...@@ -355,8 +355,8 @@ glViewer::drawScenePhilipsStereo()
// works on a linear scale and is multiplied with the factor controlled by the user in the Display // works on a linear scale and is multiplied with the factor controlled by the user in the Display
// Control Tool. // Control Tool.
// Value range: 0-255 (default 64) // Value range: 0-255 (default 64)
header[2] = 64; // Hdr_Factor header[2] = OpenFlipper::Options::stereoPhilipsFactor(); // Hdr_Factor
// Header Offset CC // Header Offset CC
// Values in the Depth map equal to the header-offset value will be located on the plane of the // 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. All values in the disparity map with a higher value will de displayed in front of the
...@@ -364,8 +364,8 @@ glViewer::drawScenePhilipsStereo() ...@@ -364,8 +364,8 @@ glViewer::drawScenePhilipsStereo()
// Offset_CC is the offset controlled by the Content Creator. In the system there is also an // 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. // Offset_user present, which is controlled by the user using the Display Control Tool.
// Value Range: 0-255 (default 128) // Value Range: 0-255 (default 128)
header[3] = 128; // Hdr_Offset_CC header[3] = OpenFlipper::Options::stereoPhilipsOffset(); // Hdr_Offset_CC
// Header select // Header select
// When all select signals are low the rendering settings are set to optimal settings for the content // 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 // type denoted by Hdr_content_type. By making select signals high the settings for Factor and
...@@ -375,8 +375,8 @@ glViewer::drawScenePhilipsStereo() ...@@ -375,8 +375,8 @@ glViewer::drawScenePhilipsStereo()
// 1 Use Header provided factor // 1 Use Header provided factor
// 2 Use Header provided offset // 2 Use Header provided offset
// 3 Use both factor and offset // 3 Use both factor and offset
header[4] = 0; // Hdr_Factor_select(1) + Hdr_Offset_select(1) + reserved(6) header[4] = OpenFlipper::Options::stereoPhilipsSelect(); // Hdr_Factor_select(1) + Hdr_Offset_select(1) + reserved(6)
// Unused Header entry (leave at 0 !) // Unused Header entry (leave at 0 !)
header[5] = 0; // Reserved header[5] = 0; // Reserved
...@@ -392,14 +392,14 @@ glViewer::drawScenePhilipsStereo() ...@@ -392,14 +392,14 @@ glViewer::drawScenePhilipsStereo()
// For all bytes of the header // For all bytes of the header
for (int i = 0; i < 6; i++) { 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 ) { for ( int j = 7 ; j >= 0 ; --j ) {
// Red and Green component have to be 0 // Red and Green component have to be 0
bitVector.push_back(0); bitVector.push_back(0);
bitVector.push_back(0); bitVector.push_back(0);