/* -*-c++-*- 
 * 
 * osgART - ARToolKit for OpenSceneGraph
 * Copyright (C) 2005-2008 Human Interface Technology Laboratory New Zealand
 * 
 * This file is part of osgART 2.0
 *
 * osgART 2.0 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 3 of the License, or
 * (at your option) any later version.
 *
 * osgART 2.0 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 2.0.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/**
 *  \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 <osg/Geode>
#include <osg/Node>
#include <osg/Group>
#include <osg/MatrixTransform>
#include <osg/Geometry>
#include <osg/Projection>
#include <osg/Camera>
#include <osg/Image>

// local include
#include "osgART/Export"

namespace osgART {

	/** 
	 * class VideoLayer.
	 *
	 */
	class OSGART_EXPORT VideoLayer : public osg::Camera
	{
	public:        
	    
		/** 
		 * \brief default constructor.
		 * \param videoId the number of the video used for the background
		 * \param layerDepth
		 */
		VideoLayer();			
	
		/**
		 * Copy c'tor
		 */
		VideoLayer(const VideoLayer&, 
			const osg::CopyOp& = osg::CopyOp::SHALLOW_COPY);
						
		META_Node(osgART, VideoLayer)

		
		void setSize(double width, double height);
		
		void setSize(const osg::Image& image);
			
	    
	protected: 
	
		/**
		 * Update internal projection
		 */
		void updateProjection();
	    
		/**
		 * \brief destructor.
		 */
		virtual ~VideoLayer();		

	};


}

#endif 
