5 #ifndef BALL_VIEW_RENDERING_PIXELFORMAT_H
6 #define BALL_VIEW_RENDERING_PIXELFORMAT_H
47 id(id), type(type), bitSize(bitSize)
75 #define _RTSG_FB_SETCH(i,v) \
76 this->channels[(i)] = v; \
77 if (v.id != ChannelFormat::NO_CHANNEL) \
82 unsigned int flags = 0) :
83 numChannels(0), flags(flags)
90 unsigned int flags = 0) :
91 numChannels(0), flags(flags)
100 unsigned int flags = 0) :
101 numChannels(0), flags(flags)
112 unsigned int flags = 0) :
113 numChannels(0), flags(flags)
121 #undef _RTSG_FB_SETCH
150 unsigned int bitSize = 0;
151 for (
unsigned int i = 0; i < numChannels; i++) {
152 bitSize += channels[i].
bitSize;
159 return (bitSize / 8) + ((bitSize % 8) > 0 ? 1 : 0) ;
164 numChannels = f.numChannels;
166 for (
unsigned int i = 0; i < numChannels; i++) {
167 channels[i] = f.channels[i];
174 if (numChannels != f.numChannels || flags != f.flags)
176 for (
unsigned int i = 0; i < numChannels; i++) {
177 if (channels[i] != f.channels[i])
184 return !(*
this == f);
187 void print(std::ostream &o)
const;
205 unsigned int numChannels;
219 #endif //BALL_VIEW_RENDERING_PIXELFORMAT_H
std::ostream & operator<<(std::ostream &o, const PixelFormat &f)