]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pixelformat.cpp
Drop Id tags and copyright notices from files
[libs/gl.git] / source / pixelformat.cpp
index 27a814e21e1c30b946c24cf2fad6287dc073a664..4744ebbdfbad3a61c209be9085a01e15c8e4b1bc 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "except.h"
 #include "pixelformat.h"
 
@@ -65,5 +58,25 @@ PixelFormat pixelformat_from_graphics(Graphics::PixelFormat pf)
        }
 }
 
+PixelFormat get_base_pixelformat(PixelFormat pf)
+{
+       switch(pf)
+       {
+       case RGB8:
+       case RGB16F:
+       case RGB32F: return RGB;
+       case RGBA8:
+       case RGBA16F:
+       case RGBA32F: return RGBA;
+       case LUMINANCE8:
+       case LUMINANCE16F:
+       case LUMINANCE32F: return LUMINANCE;
+       case LUMINANCE_ALPHA8:
+       case LUMINANCE_ALPHA16F:
+       case LUMINANCE_ALPHA32F: return LUMINANCE_ALPHA;
+       default: return pf;
+       }
+}
+
 } // namespace GL
 } // namespace Msp