X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpixelformat.cpp;h=b8180b2fb75e559477c0388eddc53509f35263ba;hp=027ae88c7fe1bb7c5e11290ef5133e3c143b8d05;hb=e37851b98dde5082ee92570354746f2f92e21940;hpb=49758ab622d2e8ed4b3a60d7b9afc4abd741300c diff --git a/source/pixelformat.cpp b/source/pixelformat.cpp index 027ae88c..b8180b2f 100644 --- a/source/pixelformat.cpp +++ b/source/pixelformat.cpp @@ -105,6 +105,22 @@ PixelFormat get_base_pixelformat(PixelFormat pf) } } +PixelFormat get_srgb_pixelformat(PixelFormat pf) +{ + switch(pf) + { + case RGB: return SRGB; + case RGBA: return SRGB_ALPHA; + case RGB8: return SRGB8; + case RGBA8: return SRGB8_ALPHA8; + case LUMINANCE: return SLUMINANCE; + case LUMINANCE8: return SLUMINANCE8; + case LUMINANCE_ALPHA: return SLUMINANCE_ALPHA; + case LUMINANCE_ALPHA8: return SLUMINANCE8_ALPHA8; + default: return pf; + } +} + unsigned get_component_count(PixelFormat pf) { switch(get_base_pixelformat(pf))