5 #ifndef BALL_VIEW_RENDERING_RENDERTARGET_H 6 #define BALL_VIEW_RENDERING_RENDERTARGET_H 13 #include <boost/smart_ptr.hpp> 14 #include <boost/shared_array.hpp> 59 pitch(width * pixelFormat.computeByteSize()),
60 pixelFormat(pixelFormat)
69 pixelFormat(pixelFormat)
76 return width==format.width
78 && pitch==format.pitch
79 && pixelFormat==format.pixelFormat;
84 return !(*
this == format);
109 void setPitch(
unsigned int pitch) { this->pitch = pitch; }
117 this->pixelFormat = pixelFormat;
126 return isValid() ? (getPitch() * getHeight()) : 0;
132 this->
width = newWidth;
204 void setData(
void *data) { this->data = data; }
239 virtual FrameBufferPtr getBuffer() = 0;
249 virtual void releaseBuffer(FrameBufferPtr buffer) = 0;
253 virtual bool init() = 0;
257 virtual bool resize(
const unsigned int width,
const unsigned int height) = 0;
261 virtual void refresh() = 0;
265 virtual void prepareRendering() = 0;
277 virtual bool doNotResize()
const = 0;
284 #endif // BALL_VIEW_RENDERING_RENDERTARGET_H void setHeight(unsigned int height)
FrameBufferFormat(Size width, Size height, Size pitch, const PixelFormat &pixelFormat)
unsigned int computeByteSize() const
bool operator==(const FrameBufferFormat &format) const
FrameBufferFormat(Size width, Size height, const PixelFormat &pixelFormat)
void resize(Size newWidth, Size newHeight)
unsigned int getWidth() const
Resolution(Size width, Size height)
unsigned int getPitch() const
void setPixelFormat(const PixelFormat &pixelFormat)
FrameBuffer(void *data, const FrameBufferFormat &format)
void setWidth(unsigned int width)
const FrameBufferFormat resized(Size newWidth, Size newHeight) const
std::ostream & operator<<(std::ostream &o, const PixelFormat &f)
const void * getData() const
const PixelFormat & getPixelFormat() const
void setFormat(const FrameBufferFormat &format)
size_t computeSize() const
void setPitch(unsigned int pitch)
const FrameBufferFormat & getFormat() const
std::vector< FrameBufferFormat > BufferFormatList
virtual void setupStereo(float, float)
bool operator!=(const FrameBufferFormat &format) const
boost::shared_ptr< FrameBuffer > FrameBufferPtr
unsigned int getHeight() const