/* ImLib3D
 * Copyright (c) 2001, ULP-IPB Strasbourg.
 *
 * This program 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.
 * 
 * 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 the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
/*! \file   TestPatterns.hpp */

#ifndef _TestPatterns_hpp
#define _TestPatterns_hpp

#include<ImLib3D/Image3D.hpp>
#include<ImLib3D/ImageProcessor.hpp>
#include<ImLib3D/MorphologicalOperators.hpp>
#ifdef NOTDEF
//! class for grouping Test Pattern generation drawing functions
//  class TestPatterns
//  {
//  public:
//      //! Sphere: Center=C radius=r
//  	static void Sphere(Image3Df &ima,const Vect3Df &C,float r);
//  	//! cone: base=P0 point=P1 radius at base=r
//  	static void Cone(Image3Df &ima,const Vect3Df &P0,const Vect3Df &P1,float r);
//  	static void ConeAA(Image3Df &ima,const Vect3Df &P0,const Vect3Df &P1,float r,float ar=4.0);
//  	static void NoiseUniform(Image3Df &ima,float v0=0,float v1=1);
//  	static void NoiseGaussian(Image3Df &ima,float average=0,float variance=1);
//  	static void Target(Image3Df &ima);
//  	static void Explode(Field3Df &ima,const Vect3Df &C);
//  	static void Parallellogram(Image3Df &ima, const RectZone3Di & rect);
//  	//! GridRectangular: spaced by masksize, P will be at an intersection
//  	static void RectangularGrid(Image3Df &ima, const Size3D& masksize, const Vect3Di& P=Vect3Di(0,0,0));
//  	//! ColoredGrid is a Mask3D where each cube is colored. No two adjacent cubes have the same color. Neighborhood defined for MORPHO_Cross7, MORPHO_Planar19 and MORPHO_Cubic27
//  	static void ColoredGrid(Mask3D &ima, const Size3D& masksize, StructureElementType structure = MORPHO_Cross7);
//  };
#endif//NOTDEF



namespace IP3D
{
/*! #&Sphere&#     Draws a sphere.
        Input: image size 
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>center        type:Vect3Df
      <LI>radius        type:float
      <LI>Result image  type:Image3Df
     </UL>
~*/
		void Sphere(const Size3D &size,const Vect3Df &C,float r,Image3Df &ima);
};


namespace IP3D
{
/*! #&Explode&#     Creates a field where vectors point away from a specified center.
        The falue of the field a point P is: F(P)=P-C
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>Center        type:Vect3Df
      <LI>Result image  type:Field3Df
     </UL>
~*/
		void Explode(const Size3D &size,const Vect3Df &C,Field3Df &ima);
};


namespace IP3D
{
/*! #&Cone&#     Draws a cone.
        Input: image size,base's center. Point. 
     <UL>Args:
      <LI>Image size                   type:Size3D
      <LI>center                       type:Vect3Df
      <LI>point                        type:Vect3Df
      <LI>radius                       type:float
      <LI>Result image                 type:Image3Df
      <LI>antialiasing falloff radius  type:float
     </UL>
~*/
		void Cone(const Size3D &size,const Vect3Df &P0,const Vect3Df &P1,float r,Image3Df &ima,float ar=4.0);
namespace ConeHelpers
{
	void NoAA(Image3Df &ima,const Vect3Df &P0,const Vect3Df &P1,float r);
}
};

namespace IP3D
{
/*! #&NoiseUniform&#     Creates an image with uniform noise.
        . 
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>Result image  type:Image3Df
      <LI>min value     type:float
      <LI>max value     type:float
     </UL>
~*/
		void NoiseUniform(const Size3D &size,Image3Df &ima,float v0=0,float v1=1);
};

namespace IP3D
{
/*! #&NoiseGaussian&#     Creates an image with gaussian noise.
        . 
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>Result image  type:Image3Df
      <LI>average       type:float
      <LI>variance      type:float
     </UL>
~*/
		void NoiseGaussian(const Size3D &size,Image3Df &ima,float v0=0,float v1=1);
};

namespace IP3D
{
/*! #&Target&#     Creates an image with target like pattern.
        Spatial frequency increases radially from center of image. 
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>Result image  type:Image3Df
     </UL>
~*/
		void Target(const Size3D &size,Image3Df &ima);

};

namespace IP3D
{
/*! #&Bump&#     Creates a gaussian bump.
        Given a center, bump height, and std dev
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>center        type:Vect3Df
      <LI>height        type:float
      <LI>size          type:float
      <LI>Result image  type:Image3Df
     </UL>
~*/
		void Bump(const Size3D &size,const Vect3Df &center,float height,float gsize,Image3Df &ima);
};

namespace IP3D
{
/*! #&Parallellogram&#     Creates an image with a parallellogram.
        Both points are included. 
     <UL>Args:
      <LI>Image size    type:Size3D
      <LI>zone          type:RectZone3Di
      <LI>Result image  type:Image3Df
     </UL>
~*/
		void Parallellogram(const Size3D &size,const RectZone3Di & rect,Image3Df &ima);
};

namespace IP3D
{
/*! #&RectangularGrid&# Creates an image with a grid
     <UL>Args:
      <LI>Result image                    type:Image3df
      <LI>width                           type:int
      <LI>height                          type:int
      <LI>depth                           type:int
      <LI>masksize.x                      type:int
      <LI>masksize.y                      type:int
      <LI>masksize.z                      type:int
      <LI>[opt] intersection.x            type:int 
      <LI>[opt] intersection.y            type:int
      <LI>[opt] intersection.z            type:int
     </UL>
 */
		void RectangularGrid(const Size3D &size, const Size3D &masksize,Image3Df &ima, const Vect3Di *pintersection=NULL);
};

namespace IP3D
{
/*! #&ColoredGrid&# Creates an image where no two neighbors have the same colors
     <UL>Args:
      <LI>Result image                    type:Mask3D
      <LI>width                           type:int
      <LI>height                          type:int
      <LI>depth                           type:int
      <LI>masksize.x                      type:int
      <LI>masksize.y                      type:int
      <LI>masksize.z                      type:int
      <LI>[opt] neighborhood type         type:int 
     </UL>
 */
		void ColoredGrid(const Size3D &size, const Size3D &masksize,Mask3D &ima, StructureElementType neighborhoodtype=MORPHO_Cross7);
};

#endif // _TestPatterns_hpp
