/*********************************************************************
 * This file is part of the PRAPI library.
 *
 * Copyright (C) 2001 Topi Mäenpää and Jaakko Viertola
 * All rights reserved.
 *
 * This program is free software. You can redistribute and/or modify
 * it under the terms of the free software licence found in the
 * accompanying file "COPYING". The licence terms must always be
 * redistributed with this source file. The above copyright notice
 * must be reproduced in all modified and unmodified copies of this
 * source file.
 *
 * $Revision: 1.8 $
 *********************************************************************/

#ifndef _IMAGETRANSFORM_H
#define _IMAGETRANSFORM_H

#include <Matrix.h>

namespace prapi
{
	/**
	 * An exception for errors in transforming images.
	 **/
	class ImageTransformException : public util::MatrixException
	{
	public:
		ImageTransformException(std::string message) : util::MatrixException(message) {}
	};
	
	/**
	 * ImageTransform is an interface for operations that convert images
	 * from one domain to another. Typical operations include FFT,
	 * texture operators, etc.
	 **/
	template <class T, class U> class ImageTransform : virtual public util::Object
	{
	public:
		virtual ~ImageTransform() {}
		/**
		 * Convert an image from a domain to another. The type of the
		 * image may change in conversion. For example, a color image may
		 * be converted to an integer image and vice-versa.
		 *
		 * @param mat the image to be transformed
		 * @return the transformed image
		 **/
		virtual util::Matrix<T> getTransformedImage(const util::Matrix<U>& mat) throw (ImageTransformException&) = 0;
	};	
}

#endif
