void LoadBase()
{
	Base.Posx  = 0;
	Base.Posy  = 0;
	Base.Image = ImageAdd("Assets/BG FL.png");
	Base.View  = ViewAdd(Base.Image, Base.Posx, Base.Posy);

	int GameText = FontAdd("Arial14Bold - FontMedium");
	TextAdd(75,85,"--",GameText);
	TextAdd(220,85,"93",GameText);

}
int MenuTouch(int id, int event, int x, int y)
{
	if(id == 0)
	{
		LoadBase();
		LoadBoxPos();
		shuffle(idarray);
		AssignIDxImageNumber();
		LoadImages();
	}
	if(id == 1)
	{
		MIH = ImageAdd("Assets/Scores.png");
		ViewSetImage(MVH, MIH);

		fonthandle = FontAdd("Arial12Bold - FontSmall");
		texthandle[0] = TextAdd(100,490,"No Record Found",fonthandle);
	}
	if(id == 2)
	{
		MIH = ImageAdd("Assets/Instructions.png");
		ViewSetImage(MVH, MIH);
	}
	if(id == 3)
	{
		Menu();
	}

	if(id == 4)
	{
		MIH = ImageAdd("Assets/Facebook.png");
		ViewSetImage(MVH,MIH);

		fonthandle = FontAdd("Arial12Bold - FontSmall");
		texthandle[0] = TextAdd(120,490,"Subscribe",fonthandle);
		texthandle[1] =	TextAdd(80,510,"fb.com/Umair.Hasnain",fonthandle);
		texthandle[2] =	TextAdd(90,530,"fb.com/Sair.Samim",fonthandle);
		texthandle[3] =	TextAdd(98,550,"fb.com/hjgondal",fonthandle);
		OnTimer();
		

	}

	if(id == 5)
	{
		MIH = ImageAdd("Assets/i.png");
		ViewSetImage(MVH,MIH);
		//tell about project
	}
	return 0;
}
//===============================================
//		     ******On Touch******
//===============================================
int OnTouch(int box ,int event,int x,int y)
{ 
	int posfactor;

	if( Boxes[box + 1][imagenumber] == 15 )
	{
		posfactor = 1;
		SwapBoxes(box, posfactor);
	}
	if( Boxes[box - 1][imagenumber] == 15 )
	{
		posfactor = -1;
		SwapBoxes(box, posfactor);
	}
	if( Boxes[box + 4][imagenumber] == 15 )
	{
		posfactor = 4;
		SwapBoxes(box, posfactor);
	}
	if( Boxes[box - 4][imagenumber] == 15 )
	{
		posfactor = -4;
		SwapBoxes(box, posfactor);
	}	
	if (CheckBoxes()) 
	{
		fonthandle = FontAdd("Arial12Bold - FontSmall");
		texthandle[0] = TextAdd(120,300,"Solved :D",fonthandle);
	}
	return 0;
}
int main(int argc, char** argv)
{
	std::string folderPath = argv[1];
	std::string destMainFolder = argv[2];
	std::vector<std::string> fileList;

	GET_DirectoryImages(folderPath.c_str(), fileList);

	omp_set_dynamic(0);     // Explicitly disable dynamic teams
	omp_set_num_threads(8); // Use 4 threads for all consecutive parallel regions
	#pragma omp parallel for
	for (int i = 0; i < fileList.size(); i++)
	{
		std::string fileName = NameBeforeExt(fileList[i]);
		std::string filePath = folderPath + "\\" + fileList[i];
		std::string destFoldPath = destMainFolder + "\\" + fileName;
		PathControl(destFoldPath);
		destFoldPath += "\\" + fileName;
		cv::Mat Im = cv::imread(filePath, cv::IMREAD_COLOR);

		//1.Rotated
		RotatedImages(destFoldPath, Im);
		//2.Mirror Effect
		MirrorEffects(destFoldPath, Im);
		//3.Salt and Pepper Noise
		SaltAndPepperNoise(destFoldPath, Im);
		//4.Gaussian Blur Image
		GaussianBluring(destFoldPath, Im);
		//5.Contrast High and Low
		ContrastHL(destFoldPath, Im);
		//6.Scales Change
		ScalesWH(destFoldPath, Im);
		//7.Text Adding
		TextAdd(destFoldPath, Im);
		//8.Cropped Images
		CropIm(destFoldPath, Im, 0.6);
		CropIm(destFoldPath, Im, 0.7);
		CropIm(destFoldPath, Im, 0.8);
		CropIm(destFoldPath, Im, 0.9);
		//9.JPEG Compression
		JpegComp(destFoldPath, Im, 60);
		JpegComp(destFoldPath, Im, 40);
		JpegComp(destFoldPath, Im, 20);
		JpegComp(destFoldPath, Im, 10);
		JpegComp(destFoldPath, Im, 5);
	}
	return 0;
}