X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fpixelformat.cpp;h=6e7621882fef8eae4e595cd07e004a34b8e567bf;hp=2ee5af7de6cf7f2d073fdeaa065a6218b4ac6c51;hb=3efe3bab1c8290bd49a957ebec0ad97e58a35fcf;hpb=8e58fc4da8443cb67fe4cd70d6f68de2be73011d diff --git a/source/core/pixelformat.cpp b/source/core/pixelformat.cpp index 2ee5af7d..6e762188 100644 --- a/source/core/pixelformat.cpp +++ b/source/core/pixelformat.cpp @@ -110,6 +110,10 @@ PixelComponents swizzle_components(PixelComponents comp, ComponentSwizzle swiz) return BGR; else if(comp==RGBA && swiz==RGB_TO_BGR) return BGRA; + else if(comp==RGBA && swiz==RGBA_TO_RGB) + return RGB; + else if(comp==BGRA && swiz==RGBA_TO_RGB) + return BGR; else throw invalid_argument("swizzle_components"); } @@ -126,6 +130,10 @@ PixelComponents unswizzle_components(PixelComponents comp, ComponentSwizzle swiz return RGB; else if(comp==BGRA && swiz==RGB_TO_BGR) return RGBA; + else if(comp==RGB && swiz==RGBA_TO_RGB) + return RGBA; + else if(comp==BGR && swiz==RGBA_TO_RGB) + return BGRA; else throw invalid_argument("swizzle_components"); }