/* * osgART/VideoLayer * osgART: AR ToolKit for OpenSceneGraph * * Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved. * * Rev Date Who Changes * 1.0 2006-12-08 --- Version 1.0 release. * */ /* * This file is part of osgART - AR Toolkit for OpenSceneGraph * * Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved. * * (See the AUTHORS file in the root of this distribution.) * * * OSGART is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * OSGART is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSGART; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /** * \file VideoLayer * \brief Defined a Video Background Node usable for AR. * * * Defined an OpenSceneGraph geode for creating a VideoLayer Object. * This object is combined with the VideoManager for displaying a video background * using in AR Application (video see-through approach). * * \remark the layer value 1 has no transparency. * * \remark * * History : * * \author Julian Looser Julian.Looser@hitlabnz.org * \author Raphael Grasset Raphael.Grasset@hitlabnz.org * \version 3.1 * \date 01/12/07 **/ #ifndef OSGART_VIDEOLAYER #define OSGART_VIDEOLAYER // OSG include #include #include #include #include #include #include // local include #include "osgART/Export" #include "osgART/GenericVideoObject" namespace osgART { /** * class VideoLayer. * */ class OSGART_EXPORT VideoLayer : public GenericVideoObject { public: /** * \brief default constructor. * \param videoId the number of the video used for the background * \param layerDepth */ VideoLayer(GenericVideo* video , int layerDepth = 0); /** * Initialize the video layer */ virtual void init(); /** * Set transparency for this layer */ void setTransparency(float alpha); /** * Get transparency for this layer. */ inline float getTransparency() const { return m_alpha; } /** * Set the layer depth for this layer */ void setLayerDepth(int _depth); /** * Set the layer depth for this layer. */ inline int getLayerDepth() const { return m_layerDepth; } inline float getWidth() const { return m_width; } inline float getHeight() const { return m_height; } inline void setUndistortionTrackerID(int trackerID) { m_trackerid_undistort = trackerID; } protected: /** * \brief destructor. */ virtual ~VideoLayer(); float m_width; float m_height; int m_layerDepth; float m_alpha; int m_trackerid_undistort; osg::ref_ptr m_geometry; private: /** * Helper method to create a video layer */ osg::ref_ptr buildLayer(); /** * Helper method to create the actual geometry */ osg::ref_ptr buildLayerGeometry(); /* Member variables */ osg::ref_ptr m_layerModelViewMatrix; osg::ref_ptr m_layerProjectionMatrix; osg::ref_ptr m_layerGeode; osg::ref_ptr m_layerStateSet; }; } #endif