/*
 *	osgART/Video/DummyImage/DummyImageVideo
 *	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  DummyImageVideo
 *  \brief A Video class for image input
 *
 * 
 * A video class that just displaying always the same image, ideal for
 * debugging or taking snapshot. The image format is mainly the one
 * implicitly supported in OpenSceneGraph.
 *	
 *   \remark 
 *
 *   History :
 *
 *  \author Raphael Grasset Raphael.Grasset@hitlabnz.org
 *  \version 3.1
 *  \date 07/05/31
 **/

#ifndef OSGART_DUMMYIMAGEVIDEO
#define OSGART_DUMMYIMAGEVIDEO

#include <iostream>
#include <string>

// graphics include
#include <osgART/Export>
#include <OpenThreads/Mutex>
#include <osg/Image>

// local include
#include <osgART/GenericVideo>

/**
 * class DummyImageVideo.
 *
 */
class DummyImageVideo : public osgART::GenericVideo
{
public:        
// Standard Services
    
    /** 
    * \brief default constructor.
    * The default constructor.
    * @param config a string definition of the Video. See documentation
    * of DummyImage for further details.
    */
    DummyImageVideo();
    
   
    /** 
    * \brief affectation operator.
    *
    */
    DummyImageVideo& operator=(const DummyImageVideo &);
    
    /**
    * \brief open the Video stream.
    * Access the Video stream (hardware or file) and get an handle on it.
    */
	void open();
	
	/**
    * \brief close the Video stream.
    * Terminate the connection with the Video stream and clean handle.
    */
	void close();
	
	/**
    * \brief start the Video stream grabbing.
    * Start to get image from the Video stream. In function of the implementation on different
    * platform, this function can run a thread, signal or real-time function. 
    */
	void start();
	
	/**
    * \brief stop the Video stream grabbing.
    * Stop to get image from the Video stream. In function of the implementation on different
    * platform, this function can stop a thread, signal or real-time function. 
    */
	void stop();
	
	/**
    * \brief update the Video stream grabbing.
    * Try to get an image of the Video instance, usable by your application.
    */
	void update();
    
    inline virtual void releaseImage() {};
    
    
    virtual osgART::VideoConfiguration* getVideoConfiguration();
    
protected:

	/** 
    * \brief destructor.
    *
    */
    virtual ~DummyImageVideo();       
    

private:

	osgART::VideoConfiguration m_config;
	
	bool m_flip_horizontal;
	bool m_flip_vertical;

};

#endif
