LCOV - code coverage report
Current view: top level - eq/fabric - frameData.h (source / functions) Hit Total Coverage
Test: Equalizer Lines: 15 16 93.8 %
Date: 2017-12-16 05:07:20 Functions: 12 14 85.7 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2017, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          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 EQFABRIC_FRAMEDATA_H
      20             : #define EQFABRIC_FRAMEDATA_H
      21             : 
      22             : #include <eq/fabric/api.h>
      23             : #include <eq/fabric/types.h>
      24             : #include <eq/fabric/vmmlib.h>
      25             : 
      26             : #include <eq/fabric/frame.h>         // for Frame::Type
      27             : #include <eq/fabric/renderContext.h> // member
      28             : 
      29             : namespace eq
      30             : {
      31             : namespace fabric
      32             : {
      33           4 : class FrameData
      34             : {
      35             : public:
      36           4 :     FrameData()
      37           4 :         : _frameType(Frame::TYPE_MEMORY)
      38           4 :         , _buffers(Frame::Buffer::none)
      39             :     {
      40           4 :     }
      41             : 
      42             :     /**
      43             :      * Set the covered area for readbacks.
      44             :      *
      45             :      * Preset for Equalizer output frames. The given pixel viewport is used
      46             :      * together with the Frame offset to compute the area for the readback()
      47             :      * operation.
      48             :      */
      49           2 :     void setPixelViewport(const PixelViewport& pvp) { _pvp = pvp; }
      50             :     /** @return the covered area for readbacks. */
      51           1 :     const PixelViewport& getPixelViewport() const { return _pvp; }
      52             :     /** Set the (color, depth) buffers of the source frame. */
      53          10 :     void setBuffers(const Frame::Buffer buffers) { _buffers = buffers; }
      54             :     /** Disable the usage of a frame buffer attachment for all images. */
      55           0 :     void disableBuffer(const Frame::Buffer buffer) { _buffers &= ~buffer; }
      56             :     /** @return the (color, depth) buffers of the source frame. */
      57          66 :     Frame::Buffer getBuffers() const { return _buffers; }
      58             :     /** Set the source context decomposition wrt dest channel. */
      59           4 :     void setContext(const RenderContext& context) { _context = context; }
      60             :     /** @return the source context decomposition wrt dest channel. */
      61          65 :     const RenderContext& getContext() const { return _context; }
      62           1 :     RenderContext& getContext() { return _context; }
      63             :     /** Set additional zoom for input frames. */
      64             :     void setZoom(const Zoom& zoom) { _zoom = zoom; }
      65             :     /** @return the additional zoom. */
      66          64 :     const Zoom& getZoom() const { return _zoom; }
      67             :     /**
      68             :      * Set the frame storage type.
      69             :      *
      70             :      * @param type frame storage type.
      71             :      */
      72           4 :     void setType(const fabric::Frame::Type type) { _frameType = type; }
      73             :     /** @return the frame storage type. */
      74           3 :     Frame::Type getType() const { return _frameType; }
      75             :     EQFABRIC_API void serialize(co::DataOStream& os) const;
      76             :     EQFABRIC_API void deserialize(co::DataIStream& is);
      77             : 
      78             : protected:
      79             :     PixelViewport _pvp;
      80             :     RenderContext _context; //<! source channel render context
      81             :     Zoom _zoom;
      82             :     Frame::Type _frameType;
      83             :     Frame::Buffer _buffers;
      84             : };
      85             : }
      86             : }
      87             : 
      88             : #endif // EQFABRIC_FRAMEDATA_H

Generated by: LCOV version 1.11