Equalizer  1.6.1
client/frame.h
1 
2 /* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2011, Daniel Nachbaur <danielnachbaur@gmail.com>
4  * 2010, Cedric Stalder <cedric.stalder@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef EQ_FRAME_H
21 #define EQ_FRAME_H
22 
23 #include <eq/client/api.h>
24 #include <eq/client/types.h>
25 #include <eq/client/zoomFilter.h> // enum
26 #include <eq/fabric/frame.h> // base class
27 
28 namespace eq
29 {
30 namespace detail{ class Frame; }
31 
42  class Frame : public fabric::Frame
43  {
44  public:
46  EQ_API Frame();
47 
49  EQ_API virtual ~Frame();
50 
54  EQ_API const std::string& getName() const;
55 
60  EQ_API const Range& getRange() const;
61 
66  EQ_API const Pixel& getPixel() const;
67 
72  EQ_API const SubPixel& getSubPixel() const;
73 
78  EQ_API uint32_t getPeriod() const;
79 
84  EQ_API uint32_t getPhase() const;
85 
90  EQ_API void setZoomFilter( const ZoomFilter zoomFilter );
91 
96  EQ_API ZoomFilter getZoomFilter() const;
97 
99  EQ_API const Images& getImages() const;
100 
101 #ifndef EQ_2_0_API
102 
103  EQ_API void setData( FrameData* data );
104 
106  EQ_API FrameData* getData();
107 
109  EQ_API const FrameData* getData() const;
110 #endif
111 
112  EQ_API void setFrameData( FrameDataPtr data );
113 
115  EQ_API FrameDataPtr getFrameData();
116 
118  EQ_API ConstFrameDataPtr getFrameData() const;
119 
121  EQ_API uint32_t getBuffers() const;
122 
129  EQ_API void disableBuffer( const Buffer buffer );
130 
132  EQ_API void setAlphaUsage( const bool useAlpha );
133 
135  EQ_API void setQuality( const Frame::Buffer buffer,
136  const float quality );
137 
139  EQ_API void useCompressor( const Frame::Buffer buffer,
140  const uint32_t name );
142 
146  EQ_API void clear();
147 
149  void deleteGLObjects( ObjectManager* om );
150 
160  EQ_API void readback( ObjectManager* glObjects,
161  const DrawableConfig& config );
162 
173  EQ_API void readback( ObjectManager* glObjects,
174  const DrawableConfig& config,
175  const PixelViewports& regions );
176 
190  EQ_API Images startReadback( ObjectManager* glObjects,
191  const DrawableConfig& config,
192  const PixelViewports& regions );
193 
201  void setReady();
202 
209  EQ_API bool isReady() const;
210 
212  EQ_API void waitReady( const uint32_t timeout =
213  LB_TIMEOUT_INDEFINITE ) const;
214 
221  void addListener( lunchbox::Monitor<uint32_t>& listener );
222 
229  void removeListener( lunchbox::Monitor<uint32_t>& listener );
231 
232  private:
233  detail::Frame* const _impl;
234  };
235 };
236 #endif // EQ_FRAME_H
A holder for multiple images.
bool isReady() const
Test the readiness of the frame.
void setFrameData(FrameDataPtr data)
Set the data for this frame.
void setReady()
Set the frame ready.
FrameData * getData()
const std::string & getName() const
const Images & getImages() const
uint32_t getPhase() const
std::vector< PixelViewport > PixelViewports
A vector of eq::PixelViewport.
A holder for a frame data and related parameters.
Definition: fabric/frame.h:32
void disableBuffer(const Buffer buffer)
Disable the usage of a frame buffer attachment for all images.
uint32_t getBuffers() const
void waitReady(const uint32_t timeout=LB_TIMEOUT_INDEFINITE) const
Wait for the frame to become available.
const SubPixel & getSubPixel() const
Frame()
Construct a new frame.
ZoomFilter
Filtering algorithm to applied during zoom operations.
Definition: zoomFilter.h:26
A facility class to manage OpenGL objects across shared contexts.
void readback(ObjectManager *glObjects, const DrawableConfig &config)
Read back an image.
uint32_t getPeriod() const
ZoomFilter getZoomFilter() const
void addListener(lunchbox::Monitor< uint32_t > &listener)
Add a listener which will be incremented when the frame is ready.
std::vector< Image * > Images
A vector of pointers to eq::Image.
const Range & getRange() const
void useCompressor(const Frame::Buffer buffer, const uint32_t name)
Sets a compressor for compression for following transmissions.
void removeListener(lunchbox::Monitor< uint32_t > &listener)
Remove a frame listener.
A holder for a frame data and related parameters.
Definition: client/frame.h:42
FrameDataPtr getFrameData()
const Pixel & getPixel() const
Images startReadback(ObjectManager *glObjects, const DrawableConfig &config, const PixelViewports &regions)
Start reading back a set of images for this frame.
lunchbox::RefPtr< const FrameData > ConstFrameDataPtr
A reference-counted pointer to a const eq::FrameData.
Buffer
The buffer format defines which components of the frame are to be used during readback and assembly...
Definition: fabric/frame.h:40
void setAlphaUsage(const bool useAlpha)
Set alpha usage for newly allocated images.
void setData(FrameData *data)
Set the data for this frame.
void setZoomFilter(const ZoomFilter zoomFilter)
Set the filter applied to zoomed assemble operations.
lunchbox::RefPtr< FrameData > FrameDataPtr
A reference-counted pointer to an eq::FrameData.
virtual ~Frame()
Destruct the frame.
void setQuality(const Frame::Buffer buffer, const float quality)
Set the minimum quality after compression.