/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkCameraParameters.cxx
	Version:		$Revision: 1763 $
	Date:			$Date: 2011-09-25 20:22:20 +0200 (So, 25 Sep 2011) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	This program 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 RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/

#include "ritkCameraParameters.h"

namespace ritk
{

CameraParameters::CameraParameters()
{
	// Initialize with zeors
	for ( unsigned int i = 0; i < NumCameraParameters; i++ )
		m_Params[i] = 0;
}

CameraParameters::~CameraParameters()
{
}


//----------------------------------------------------------------------------
CameraParameters::CameraParameterValueType&
CameraParameters::operator[](unsigned int index)
{
	return m_Params[index];
}


//----------------------------------------------------------------------------
const CameraParameters::CameraParameterValueType&
CameraParameters::operator[](unsigned int index) const
{
	return m_Params[index];
}


//----------------------------------------------------------------------------
CameraParameters::CameraParametersType&
CameraParameters::ToArray()
{
	return m_Params;
}


//----------------------------------------------------------------------------
const CameraParameters::CameraParametersType&
CameraParameters::ToArray() const
{
	return m_Params;
}


//----------------------------------------------------------------------------
std::ostream & operator<<(std::ostream& os, const CameraParameters &Params)
{
	for ( unsigned int i = 0; i < CameraParameters::NumCameraParameters; i++ )
	{
		os << Params[i];
		if ( i < CameraParameters::NumCameraParameters-1 )
			os << " ";
	}	
	return os;
}


//----------------------------------------------------------------------------
std::istream & operator>>(std::istream& is, CameraParameters &Params)
{
	for ( unsigned int i = 0; i < CameraParameters::NumCameraParameters; i++ )
	{
		is >> Params[i];
	}
	return is;
}



} // end namespace ritk

