diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index a7fb0d28a..a0bd0d465 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -137,6 +137,26 @@ struct ProcessRow case(GL_RGBA): RGBA_to_RGBA(num, source, dest); break; } break; + case(GL_BGR): + switch(dest_pixelFormat) + { + case(GL_LUMINANCE): + case(GL_ALPHA): BGR_to_A(num, source, dest); break; + case(GL_LUMINANCE_ALPHA): BGR_to_LA(num, source, dest); break; + case(GL_RGB): BGR_to_RGB(num, source, dest); break; + case(GL_RGBA): BGR_to_RGBA(num, source, dest); break; + } + break; + case(GL_BGRA): + switch(dest_pixelFormat) + { + case(GL_LUMINANCE): + case(GL_ALPHA): BGRA_to_A(num, source, dest); break; + case(GL_LUMINANCE_ALPHA): BGRA_to_LA(num, source, dest); break; + case(GL_RGB): BGRA_to_RGB(num, source, dest); break; + case(GL_RGBA): BGRA_to_RGBA(num, source, dest); break; + } + break; } } @@ -310,6 +330,109 @@ struct ProcessRow *dest++ = *source++; } } + + /////////////////////////////////////////////////////////////////////////////// + // BGR sources.. + virtual void BGR_to_A(unsigned int num, unsigned char* source, unsigned char* dest) const + { + for(unsigned int i=0;ir(), (image_3d->r() - curr_dest_r));