Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Fix for updated version #1

Open
seichter opened this issue Sep 26, 2012 · 0 comments
Open

Fix for updated version #1

seichter opened this issue Sep 26, 2012 · 0 comments
Assignees

Comments

@seichter
Copy link
Collaborator

diff --git a/applications/osgartviewer/osgartviewer.cpp b/applications/osgartviewer/osgartviewer.cpp
index 92ddbac..0a53e64 100644
--- a/applications/osgartviewer/osgartviewer.cpp
+++ b/applications/osgartviewer/osgartviewer.cpp
@@ -21,6 +21,10 @@
*/

  • /* usage: --config exampleconfig.cfg _/

/_ An example osgartviewer.cfg file:

diff --git a/src/osgART/Tracker/ARToolKit/ARToolKitTracker.cpp b/src/osgART/Tracker/ARToolKit/ARToolKitTracker.cpp
index 61a77ff..7fbb027 100644
--- a/src/osgART/Tracker/ARToolKit/ARToolKitTracker.cpp
+++ b/src/osgART/Tracker/ARToolKit/ARToolKitTracker.cpp
@@ -497,11 +497,16 @@ namespace osgART {

    // update internal modified count
    _modifiedCount = _imagesource->getModifiedCount();
  •   int inputPixelFormat = getARPixelFormatForImage(*_imagesource.get());
    
  •   // \TODO: hse25: check here for the moment, the function needs to be extended
    
  •   if (AR_DEFAULT_PIXEL_FORMAT != getARPixelFormatForImage(*_imagesource.get()))
    
  •   // @todo hse25: check here for the moment, the function needs to be extended
    
  •   if (AR_DEFAULT_PIXEL_FORMAT != inputPixelFormat)
    {
    
  •       osg::notify(osg::WARN) << "ARToolKitTracker::update() Incompatible pixelformat!" << std::endl;
    
  •       osg::notify(osg::WARN) << 
    
  •           "ARToolKitTracker::update() Incompatible pixelformat! " 
    
  •               << inputPixelFormat << " need " << AR_DEFAULT_PIXEL_FORMAT
    
  •               << std::endl;
        return;
    }
    

@@ -676,8 +681,8 @@ namespace osgART {

inline int ARToolKitTracker::getARPixelFormatForImage(const osg::Image& _image) const
{

- int format = 0, size = 0;

  •   int format = -1, size = 0;
    
  • if (_image.valid()) {
        switch (_image.getPixelFormat()) {
            case GL_RGBA:
    
    @@ -697,17 +702,17 @@ namespace osgART {
    format = AR_PIXEL_FORMAT_BGRA;
    size = 4;
    }
  • #ifdef AR_BIG_ENDIAN
  •               else if (_image.getDataType() == GL_UNSIGNED_INT_8_8_8_8_REV) {
    
  •                   format = AR_PIXEL_FORMAT_ARGB;
    
  •                   size = 4;
    
  •               }
    
  • #else
  •               else if (_image.getDataType() == GL_UNSIGNED_INT_8_8_8_8) {
    
  •                   format = AR_PIXEL_FORMAT_ARGB;
    
  •                   size = 4;
    
  •               }
    
  • #endif
  • // #ifdef AR_BIG_ENDIAN
  • // else if (_image.getDataType() == GL_UNSIGNED_INT_8_8_8_8_REV) {
  • // format = AR_PIXEL_FORMAT_ARGB;
  • // size = 4;
  • // }
  • // #else
  • // else if (_image.getDataType() == GL_UNSIGNED_INT_8_8_8_8) {
  • // format = AR_PIXEL_FORMAT_ARGB;
  • // size = 4;
  • // }
  • // #endif
    break;
    case GL_RGB:
    if (_image.getDataType() == GL_UNSIGNED_BYTE) {
@ghost ghost assigned seichter Sep 28, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant