Line data Source code
1 :
2 : /* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com>
3 : * 2011, Daniel Nachbaur <danielnachbaur@gmail.com>
4 : *
5 : * This library is free software; you can redistribute it and/or modify it under
6 : * the terms of the GNU Lesser General Public License version 2.1 as published
7 : * by the Free Software Foundation.
8 : *
9 : * This library is distributed in the hope that it will be useful, but WITHOUT
10 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 : * details.
13 : *
14 : * You should have received a copy of the GNU Lesser General Public License
15 : * along with this library; if not, write to the Free Software Foundation, Inc.,
16 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 : */
18 :
19 : #ifndef EQSERVER_FRAMEDATA_H
20 : #define EQSERVER_FRAMEDATA_H
21 :
22 : #include <eq/client/frameData.h>
23 : #include <eq/fabric/frame.h> // for Frame::Type
24 :
25 : namespace eq
26 : {
27 : namespace server
28 : {
29 : /** A holder for a Frame Data and parameters. */
30 : class FrameData : public co::Object
31 : {
32 : public:
33 : /** Construct a new FrameData. */
34 : FrameData();
35 :
36 : /** @name Data Access */
37 : //@{
38 : /** Set the number of the frame when this data was last used. */
39 9 : void setFrameNumber( const uint32_t number ) { _frameNumber = number; }
40 2 : uint32_t getFrameNumber() const { return _frameNumber; }
41 :
42 : /** Set the data's area within the channel */
43 9 : void setPixelViewport( const eq::PixelViewport& pvp )
44 9 : { _data.pvp = pvp; }
45 :
46 : /** Set the position of the data relative to the window. */
47 9 : void setOffset( const Vector2i& offset )
48 9 : { _offset = offset; }
49 : /** @return the position of the data relative to the window. */
50 9 : const Vector2i& getOffset() const { return _offset; }
51 :
52 : /** Set the (color, depth) buffers of the source frame. */
53 9 : void setBuffers( const uint32_t buffers )
54 9 : { _data.buffers = buffers; }
55 0 : uint32_t getBuffers() const { return _data.buffers; }
56 :
57 : /** Set the source range wrt dest channel. */
58 9 : void setRange( const eq::Range& range )
59 9 : { _data.range = range; }
60 :
61 : /** Set the source pixel decomposition wrt dest channel. */
62 9 : void setPixel( const eq::Pixel& pixel )
63 9 : { _data.pixel = pixel; }
64 :
65 : /** Set the source pixel decomposition wrt dest channel. */
66 9 : void setSubPixel( const eq::SubPixel& subpixel )
67 9 : { _data.subpixel = subpixel; }
68 :
69 : /** Set the source DPlex period wrt dest channel. */
70 9 : void setPeriod( const uint32_t period ) { _data.period = period; }
71 :
72 : /** Set the source DPlex phase wrt dest channel. */
73 9 : void setPhase( const uint32_t phase ) { _data.phase = phase; }
74 :
75 : /** Set the output frame zoom factor. */
76 9 : void setZoom( const eq::Zoom& zoom ) { _zoom = zoom; }
77 9 : const eq::Zoom& getZoom() const { return _zoom; }
78 :
79 : /** return the frame storage type. */
80 : fabric::Frame::Type getType() const { return _data.frameType; }
81 :
82 : /**
83 : * Set the frame storage type.
84 : *
85 : * @param type frame storage type.
86 : */
87 9 : void setType( const fabric::Frame::Type type )
88 9 : { _data.frameType = type; }
89 : //@}
90 :
91 : protected:
92 18 : virtual ~FrameData(){}
93 11 : virtual ChangeType getChangeType() const { return INSTANCE; }
94 : virtual void getInstanceData( co::DataOStream& os );
95 : virtual void applyInstanceData( co::DataIStream& is );
96 :
97 : private:
98 : friend class Frame;
99 : eq::FrameData::Data _data;
100 :
101 : /** The zoom factor of the output frame after readback. */
102 : eq::Zoom _zoom;
103 :
104 : /** Position wrt destination view. */
105 : Vector2i _offset;
106 :
107 : /** The number of the config frame when this data was last used. */
108 : uint32_t _frameNumber;
109 : };
110 : }
111 : }
112 : #endif // EQSERVER_FRAMEDATA_H
|