Line data Source code
1 :
2 : /* Copyright (c) 2009-2016, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQS_MONITOREQUALIZER_H
19 : #define EQS_MONITOREQUALIZER_H
20 :
21 : #include "equalizer.h" // base class
22 :
23 : #include <deque>
24 : #include <map>
25 :
26 : namespace eq
27 : {
28 : namespace server
29 : {
30 : std::ostream& operator << ( std::ostream& os, const MonitorEqualizer* );
31 :
32 : /** Destination-driven scaling.*/
33 : class MonitorEqualizer : public Equalizer
34 : {
35 : public:
36 : MonitorEqualizer();
37 : MonitorEqualizer( const MonitorEqualizer& from );
38 : virtual ~MonitorEqualizer();
39 2 : void toStream( std::ostream& os ) const final { os << this; }
40 :
41 : /** @sa Equalizer::attach. */
42 : void attach( Compound* compound ) final;
43 :
44 : /** @sa CompoundListener::notifyUpdatePre */
45 : void notifyUpdatePre( Compound* compound,
46 : const uint32_t frameNumber ) final;
47 :
48 0 : uint32_t getType() const final { return fabric::MONITOR_EQUALIZER; }
49 :
50 : protected:
51 0 : void notifyChildAdded( Compound*, Compound* ) override {}
52 0 : void notifyChildRemove( Compound*, Compound* ) override {}
53 :
54 : private:
55 : /** Init the source frame viewports. */
56 : void _updateViewports();
57 :
58 : /** compute destination size, input frame offset and
59 : output frame zoom value */
60 : void _updateZoomAndOffset();
61 :
62 : Viewports _viewports;
63 : Frames _outputFrames;
64 : };
65 : }
66 : }
67 :
68 : #endif // EQS_MONITOREQUALIZER_H
|