2 #include "pixelformat.h"
9 istream &operator>>(istream &in, PixelFormat &fmt)
14 if(word=="COLOR_INDEX")
16 else if(word=="STENCIL_INDEX")
18 else if(word=="DEPTH_COMPONENT")
19 fmt = DEPTH_COMPONENT;
22 else if(word=="GREEN")
26 else if(word=="ALPHA")
36 else if(word=="LUMINANCE")
38 else if(word=="LUMINANCE_ALPHA")
39 fmt = LUMINANCE_ALPHA;
41 in.setstate(ios_base::failbit);
46 PixelFormat pixelformat_from_graphics(Graphics::PixelFormat pf)
50 case Graphics::COLOR_INDEX: return COLOR_INDEX;
51 case Graphics::LUMINANCE: return LUMINANCE;
52 case Graphics::LUMINANCE_ALPHA: return LUMINANCE_ALPHA;
53 case Graphics::RGB: return RGB;
54 case Graphics::RGBA: return RGBA;
55 case Graphics::BGR: return BGR;
56 case Graphics::BGRA: return BGRA;
57 default: throw InvalidParameterValue("Unknown Graphics::PixelFormat");
61 PixelFormat get_base_pixelformat(PixelFormat pf)
67 case RGB32F: return RGB;
70 case RGBA32F: return RGBA;
73 case LUMINANCE32F: return LUMINANCE;
74 case LUMINANCE_ALPHA8:
75 case LUMINANCE_ALPHA16F:
76 case LUMINANCE_ALPHA32F: return LUMINANCE_ALPHA;