LCOV - code coverage report
Current view: top level - eq/client - frame.cpp (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 41 88 46.6 %
Date: 2014-06-18 Functions: 19 33 57.6 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2014, 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             : #include "frame.h"
      20             : 
      21             : #include "frameData.h"
      22             : #include "image.h"
      23             : #include <eq/util/objectManager.h>
      24             : 
      25             : namespace eq
      26             : {
      27             : namespace detail
      28             : {
      29             : class Frame
      30             : {
      31             : public:
      32             :     FrameDataPtr frameData;
      33             : 
      34             :     ZoomFilter zoomFilter; // texture filter
      35             : 
      36           5 :     Frame() : zoomFilter( FILTER_LINEAR ) {}
      37           5 :     ~Frame()
      38           5 :     {
      39           5 :         if( frameData )
      40           1 :             LBINFO << "FrameData attached in frame destructor" << std::endl;
      41           5 :     }
      42             : };
      43             : }
      44             : 
      45           5 : Frame::Frame()
      46           5 :         : _impl( new detail::Frame )
      47             : {
      48           5 : }
      49             : 
      50          14 : Frame::~Frame()
      51             : {
      52           5 :     delete _impl;
      53           9 : }
      54             : 
      55           0 : void Frame::setZoomFilter( const ZoomFilter zoomFilter )
      56             : {
      57           0 :     _impl->zoomFilter = zoomFilter;
      58           0 : }
      59             : 
      60           0 : ZoomFilter Frame::getZoomFilter() const
      61             : {
      62           0 :     return _impl->zoomFilter;
      63             : }
      64             : 
      65           9 : void Frame::setFrameData( FrameDataPtr data )
      66             : {
      67           9 :     _impl->frameData = data;
      68           9 : }
      69             : 
      70          25 : FrameDataPtr Frame::getFrameData()
      71             : {
      72          25 :     return _impl->frameData;
      73             : }
      74             : 
      75           2 : ConstFrameDataPtr Frame::getFrameData() const
      76             : {
      77           2 :     return _impl->frameData;
      78             : }
      79             : 
      80           2 : uint32_t Frame::getBuffers() const
      81             : {
      82           2 :     return _impl->frameData->getBuffers();
      83             : }
      84             : 
      85          44 : const Pixel& Frame::getPixel() const
      86             : {
      87          44 :     return _impl->frameData->getPixel();
      88             : }
      89             : 
      90          23 : const SubPixel& Frame::getSubPixel() const
      91             : {
      92          23 :     return _impl->frameData->getSubPixel();
      93             : }
      94             : 
      95           0 : const Range& Frame::getRange() const
      96             : {
      97           0 :     return _impl->frameData->getRange();
      98             : }
      99             : 
     100           0 : uint32_t Frame::getPeriod() const
     101             : {
     102           0 :     return _impl->frameData->getPeriod();
     103             : }
     104             : 
     105           0 : uint32_t Frame::getPhase() const
     106             : {
     107           0 :     return _impl->frameData->getPhase();
     108             : }
     109             : 
     110          48 : const Images& Frame::getImages() const
     111             : {
     112          48 :     return _impl->frameData->getImages();
     113             : }
     114             : 
     115           0 : void Frame::clear()
     116             : {
     117           0 :     _impl->frameData->clear();
     118           0 : }
     119             : 
     120           0 : void Frame::deleteGLObjects( util::ObjectManager& om )
     121             : {
     122           0 :     if( _impl->frameData )
     123           0 :         _impl->frameData->deleteGLObjects( om );
     124           0 : }
     125             : 
     126           0 : void Frame::setAlphaUsage( const bool useAlpha )
     127             : {
     128           0 :     if( _impl->frameData )
     129           0 :         _impl->frameData->setAlphaUsage( useAlpha );
     130           0 : }
     131             : 
     132           0 : void Frame::setQuality( const Frame::Buffer buffer, const float quality )
     133             : {
     134           0 :     if( _impl->frameData )
     135           0 :         _impl->frameData->setQuality( buffer, quality );
     136           0 : }
     137             : 
     138           0 : void Frame::useCompressor( const Frame::Buffer buffer, const uint32_t name )
     139             : {
     140           0 :     if( _impl->frameData )
     141           0 :         _impl->frameData->useCompressor( buffer, name );
     142           0 : }
     143             : 
     144           0 : void Frame::readback( util::ObjectManager& glObjects, const DrawableConfig& config )
     145             : {
     146           0 :     const PixelViewport& pvp = _impl->frameData->getPixelViewport();
     147             :     const Images& images =
     148             :         _impl->frameData->startReadback( *this, glObjects, config,
     149           0 :                                          PixelViewports( 1, pvp ));
     150           0 :     for( ImagesCIter i = images.begin(); i != images.end(); ++i )
     151           0 :         (*i)->finishReadback( glObjects.glewGetContext( ));
     152           0 : }
     153             : 
     154           0 : void Frame::readback( util::ObjectManager& glObjects, const DrawableConfig& config,
     155             :                       const PixelViewports& regions )
     156             : {
     157             :     const Images& images =
     158           0 :         _impl->frameData->startReadback( *this, glObjects, config, regions );
     159           0 :     for( ImagesCIter i = images.begin(); i != images.end(); ++i )
     160           0 :         (*i)->finishReadback( glObjects.glewGetContext( ));
     161           0 : }
     162             : 
     163           2 : Images Frame::startReadback( util::ObjectManager& glObjects,
     164             :                              const DrawableConfig& config,
     165             :                              const PixelViewports& regions )
     166             : {
     167           2 :     return _impl->frameData->startReadback( *this, glObjects, config, regions );
     168             : }
     169             : 
     170           0 : void Frame::setReady()
     171             : {
     172           0 :     _impl->frameData->setReady();
     173           0 : }
     174             : 
     175           2 : bool Frame::isReady() const
     176             : {
     177           2 :     return _impl->frameData->isReady();
     178             : }
     179             : 
     180          21 : void Frame::waitReady( const uint32_t timeout ) const
     181             : {
     182          21 :     _impl->frameData->waitReady( timeout );
     183          21 : }
     184             : 
     185           0 : void Frame::disableBuffer( const Buffer buffer )
     186             : {
     187           0 :     _impl->frameData->disableBuffer( buffer );
     188           0 : }
     189             : 
     190           2 : void Frame::addListener( lunchbox::Monitor<uint32_t>& listener )
     191             : {
     192           2 :     _impl->frameData->addListener( listener );
     193           2 : }
     194             : 
     195           2 : void Frame::removeListener( lunchbox::Monitor<uint32_t>& listener )
     196             : {
     197           2 :     _impl->frameData->removeListener( listener );
     198           2 : }
     199             : 
     200          36 : }

Generated by: LCOV version 1.10