19 #ifndef EQ_FRAMEDATA_H
20 #define EQ_FRAMEDATA_H
22 #include <eq/client/frame.h>
23 #include <eq/client/types.h>
25 #include <eq/fabric/pixelViewport.h>
26 #include <eq/fabric/pixel.h>
27 #include <eq/fabric/range.h>
28 #include <eq/fabric/subPixel.h>
30 #include <co/object.h>
31 #include <lunchbox/monitor.h>
32 #include <lunchbox/spinLock.h>
36 namespace server {
class FrameData; }
55 class FrameData :
public co::Object,
public lunchbox::Referenced
61 uint32_t internalFormat;
62 uint32_t externalFormat;
65 uint32_t compressorName;
66 uint32_t compressorFlags;
95 void setBuffers(
const uint32_t buffers ){ _data.buffers = buffers;}
106 const Range&
getRange()
const {
return _data.range; }
109 void setRange(
const Range& range ) { _data.range = range; }
115 const Pixel&
getPixel()
const {
return _data.pixel; }
172 void setZoom(
const Zoom& zoom ) { _data.zoom = zoom; }
175 const Zoom& getZoom()
const {
return _data.zoom; }
203 const DrawableConfig& config );
231 const DrawableConfig& config );
248 const DrawableConfig& config,
261 bool isReady()
const {
return _readyVersion.get() >= _version; }
264 void waitReady(
const uint32_t timeout = LB_TIMEOUT_INDEFINITE )
const;
267 void setVersion(
const uint64_t version );
278 void addListener( lunchbox::Monitor<uint32_t>& listener );
295 { _data.buffers &= ~buffer; }
304 EQ_API
Data& operator=(
const Data& rhs );
316 EQ_API
void serialize( co::DataOStream& os )
const;
317 EQ_API
void deserialize( co::DataIStream& is );
321 bool addImage(
const co::ObjectVersion& frameDataVersion,
322 const PixelViewport& pvp,
const Zoom& zoom,
323 const uint32_t buffers,
const bool useAlpha,
325 void setReady(
const co::ObjectVersion& frameData,
329 virtual ChangeType getChangeType()
const {
return INSTANCE; }
330 virtual void getInstanceData( co::DataOStream& os );
331 virtual void applyInstanceData( co::DataIStream& is );
336 lunchbox::Lock _imageCacheLock;
338 ROIFinder* _roiFinder;
344 typedef lunchbox::Monitor< uint64_t > Monitor;
347 Monitor _readyVersion;
349 typedef lunchbox::Monitor< uint32_t > Listener;
350 typedef std::vector< Listener* > Listeners;
352 lunchbox::Lockable< Listeners, lunchbox::SpinLock > _listeners;
358 uint32_t _colorCompressor;
359 uint32_t _depthCompressor;
366 const DrawableConfig& config,
370 void _applyVersion(
const uint128_t& version );
373 void _setReady(
const uint64_t version );
375 LB_TS_VAR( _commandThread );
379 EQ_API std::ostream&
operator << ( std::ostream&,
const FrameData& );
386 byteswap( value.pvp );
387 byteswap( value.frameType );
388 byteswap( value.buffers );
389 byteswap( value.period );
390 byteswap( value.phase );
391 byteswap( value.range );
392 byteswap( value.pixel );
393 byteswap( value.subpixel );
394 byteswap( value.zoom );
398 #endif // EQ_FRAMEDATA_H
void removeListener(lunchbox::Monitor< uint32_t > &listener)
Remove a frame listener.
void setReady()
Set the frame data ready.
A holder for multiple images.
const Range & getRange() const
Get the range.
void deleteGLObjects(ObjectManager *om)
Delete data allocated by the given object manager on all images.
void clear()
Clear the frame by recycling the attached images.
void waitReady(const uint32_t timeout=LB_TIMEOUT_INDEFINITE) const
Wait for the frame data to become available.
uint32_t getPhase() const
A channel represents a two-dimensional viewport within a Window.
void setRange(const Range &range)
Set the range of this frame.
const Pixel & getPixel() const
void useCompressor(const Frame::Buffer buffer, const uint32_t name)
Sets a compressor which will be allocated and used during transmit of the image buffer.
void setQuality(const Frame::Buffer buffer, const float quality)
Set the minimum quality after download and compression.
void setBuffers(const uint32_t buffers)
Set the enabled frame buffer attachments.
std::vector< PixelViewport > PixelViewports
A vector of eq::PixelViewport.
void flush()
Flush the frame by deleting all images.
std::ostream & operator<<(std::ostream &os, const ConfigEvent *event)
Print the config event to the given output stream.
void addListener(lunchbox::Monitor< uint32_t > &listener)
Add a ready listener.
use main memory to store pixel data
std::vector< Image * > Images
A vector of pointers to eq::Image.
void setAlphaUsage(const bool useAlpha)
Set alpha usage for newly allocated images.
void readback(const Frame &frame, ObjectManager *glObjects, const DrawableConfig &config)
Read back an image for this frame data.
virtual ~FrameData()
Destruct this frame data.
Frame::Type getType() const
uint32_t getPeriod() const
Holds a 2D pixel viewport with methods for manipulation.
Image * newImage(const Frame::Type type, const DrawableConfig &config)
Allocate and add a new image.
A holder for a frame data and related parameters.
void resetPlugins()
Deallocate all transfer and compression plugins on all images.
const SubPixel & getSubPixel() const
void disableBuffer(const Frame::Buffer buffer)
Disable the usage of a frame buffer attachment for all images.
uint32_t getBuffers() const
Buffer
The buffer format defines which components of the frame are to be used during readback and assembly...
const Images & getImages() const
The images of this frame data holder.
util::ObjectManager< const void * > ObjectManager
The OpenGL object manager used in the client library.
void setPixelViewport(const PixelViewport &pvp)
Set the covered area for readbacks.
void setType(const Frame::Type type)
Set the storage type.
FrameData()
Construct a new frame data holder.
const PixelViewport & getPixelViewport() const
Type
The storage type for pixel data.
Images startReadback(const Frame &frame, ObjectManager *glObjects, const DrawableConfig &config, const PixelViewports ®ions)
Start reading back a set of images for this frame data.