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
77 && height==format.height
78 && pitch==format.pitch
79 && pixelFormat==format.pixelFormat;
84 return !(*
this == format);
87 bool isValid()
const {
return width > 0 && height > 0 && pitch > 0; }
92 unsigned int getWidth()
const {
return width; }
97 void setWidth(
unsigned int width) { this->width = width; }
103 void setHeight(
unsigned int height) { this->height = height; }
109 void setPitch(
unsigned int pitch) { this->pitch = pitch; }
117 this->pixelFormat = pixelFormat;
132 this->width = newWidth;
133 this->height = newHeight;
204 void setData(
void *data) { this->data = data; }
253 virtual
bool init() = 0;
257 virtual
bool resize(const
unsigned int width, const
unsigned int height) = 0;
284 #endif // BALL_VIEW_RENDERING_RENDERTARGET_H
virtual FrameBufferFormat getFormat() const =0
std::vector< FrameBufferFormat > BufferFormatList
const void * getData() const
boost::shared_ptr< FrameBuffer > FrameBufferPtr
virtual void prepareRendering()=0
const FrameBufferFormat & getFormat() const
virtual void releaseBuffer(FrameBufferPtr buffer)=0
FrameBuffer(void *data, const FrameBufferFormat &format)
virtual void setupStereo(float, float)
std::ostream & operator<<(std::ostream &o, const PixelFormat &f)
virtual bool doNotResize() const =0
virtual FrameBufferPtr getBuffer()=0
void setFormat(const FrameBufferFormat &format)
Resolution(Size width, Size height)
virtual bool resize(const unsigned int width, const unsigned int height)=0