From c403c052db0f2a6c189ce71de6363ad8898da2f6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 27 Oct 2011 08:34:53 +0000 Subject: [PATCH] Added support for American spelling of swap and add supportOptions(..) documentation for the new options. --- src/osgPlugins/vnc/ReaderWriterVNC.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/vnc/ReaderWriterVNC.cpp b/src/osgPlugins/vnc/ReaderWriterVNC.cpp index 7303f6e30..46bd52918 100644 --- a/src/osgPlugins/vnc/ReaderWriterVNC.cpp +++ b/src/osgPlugins/vnc/ReaderWriterVNC.cpp @@ -292,7 +292,7 @@ rfbBool LibVncImage::resizeImage(rfbClient* client) if (!image->_optionString.empty()) { - if (image->_optionString.find("swap")!=std::string::npos) swap = true; + if (image->_optionString.find("swap")!=std::string::npos || image->_optionString.find("swop")!=std::string::npos) swap = true; } GLenum gl_pixelFormat = swap ? GL_BGRA : GL_RGBA; @@ -362,6 +362,13 @@ class ReaderWriterVNC : public osgDB::ReaderWriter ReaderWriterVNC() { supportsExtension("vnc","VNC plugin"); + + supportsOption("swap","Swaps the pixel format order, exchanging the red and blue channels."); + supportsOption("swop","American spelling, same effect as swap."); + supportsOption("RGB","Use RGBA pixel format for the vnc image"); + supportsOption("RGBA","Use RGBA pixel format for the vnc image"); + supportsOption("BGR","Use BGRA pixel format for the vnc image"); + supportsOption("BGRA","Use BGRA pixel format for the vnc image"); } virtual const char* className() const { return "VNC plugin"; }