#pragma once
#include <opencv\cv.h>

#include "Mat.h"
#include "StructuringElement.h"

namespace Domination {
	namespace Unmanaged {
		namespace OpenCV {

			public ref class ImageFiltering {
			public:
				static void blur(Mat^ src, Mat^ dst, System::Drawing::Size^ ksize);
				//void blur(Mat^ src, Mat^ dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT );

				static void dilate(Mat^ src, Mat^ dst, Mat^ kernel)
				{
					dilate(src, dst, kernel, gcnew System::Drawing::Point(-1, -1), 1, (int)cv::BORDER_CONSTANT);
				}
				static void dilate(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor)
				{
					dilate(src, dst, kernel, anchor, 1, cv::BORDER_CONSTANT);
				}
				static void dilate(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor, int iterations)
				{
					dilate(src, dst, kernel, anchor, iterations, cv::BORDER_CONSTANT);
				}
				static void dilate(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor, int iterations, int borderType);
				
				static void erode(Mat^ src, Mat^ dst, Mat^ kernel)
				{
					erode(src, dst, kernel, gcnew System::Drawing::Point(-1, -1), 1, (int)cv::BORDER_CONSTANT);
				}
				static void erode(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor)
				{
					erode(src, dst, kernel, anchor, 1, cv::BORDER_CONSTANT);
				}
				static void erode(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor, int iterations)
				{
					erode(src, dst, kernel, anchor, iterations, cv::BORDER_CONSTANT);
				}
				static void erode(Mat^ src, Mat^ dst, Mat^ kernel, System::Drawing::Point^ anchor, int iterations, int borderType);

				static void GaussianBlur(Mat^ src, Mat^ dst, System::Drawing::Size^ ksize, double sigmaX);
				static void GaussianBlur(Mat^ src, Mat^ dst, System::Drawing::Size^ ksize, double sigmaX, double sigmaY, int borderType);

				static Mat^ getStructuringElement(StructuringElement shape, System::Drawing::Size^ ksize)
				{
					return getStructuringElement(shape, ksize, gcnew System::Drawing::Point(-1, -1));
				}
				static Mat^ getStructuringElement(StructuringElement shape, System::Drawing::Size^ ksize, System::Drawing::Point^ anchor);
			};

		}
	}
}