Go to the documentation of this file.
5 #ifndef BALL_VIEW_RENDERING_PIXELFORMAT_H
6 #define BALL_VIEW_RENDERING_PIXELFORMAT_H
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
void setFlags(unsigned int f)
PixelFormat(const ChannelFormat &c0, const ChannelFormat &c1, const ChannelFormat &c2, unsigned int flags=0)
PixelFormat(const ChannelFormat &c0, const ChannelFormat &c1, const ChannelFormat &c2, const ChannelFormat &c3, unsigned int flags=0)
const ChannelFormat & operator[](unsigned int i) const
ChannelFormat & getChannel(unsigned int i)
static const PixelFormat RGB_32
ChannelFormat & operator[](unsigned int i)
ChannelFormat(ChannelID id, ChannelType type, unsigned int bitSize)
static const PixelFormat RGBA_32
PixelFormat & operator=(const PixelFormat &f)
unsigned int computeBitSize() const
unsigned int computeByteSize() const
static const PixelFormat BGR_24
static const PixelFormat RGB_24
static const PixelFormat BGRA_32
const ChannelFormat & getChannel(unsigned int i) const
PixelFormat(const ChannelFormat &c0, const ChannelFormat &c1, unsigned int flags=0)
unsigned int getNumChannels() const
unsigned int getFlags() const
PixelFormat(const ChannelFormat &c0, unsigned int flags=0)
#define _RTSG_FB_SETCH(i, v)
bool operator!=(const PixelFormat &f) const
static const PixelFormat BGR_32
bool operator==(const PixelFormat &f) const
void print(std::ostream &o) const
std::ostream & operator<<(std::ostream &o, const PixelFormat &f)
bool operator==(const ChannelFormat &f) const
bool operator!=(const ChannelFormat &f) const
static const PixelFormat RGBF_96
static const PixelFormat RGB_3_2_2