using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace pcd_g1
{
	class UniversalTrans
	{
		public static void Trans(Bitmap input, Bitmap input2, Bitmap mask, Graphics output, int min, int max, float zoomX = 1, float zoomY = 1)
		{
			for (int y = 0; y < mask.Height; y += 5)
			{
				for (int x = 0; x < mask.Width; x += 5)
				{
					Color c = mask.GetPixel(x, y);
					if (c.R >= min && c.R < max)
					{
						output.FillRectangle(new SolidBrush(input2.GetPixel(x, y)), x * zoomX, y * zoomY, 5 * zoomX, 5 * zoomY);
					}
					else
					{
						if (input != null)
						{
							output.FillRectangle(new SolidBrush(input.GetPixel(x, y)), x * zoomX, y * zoomY, 5 * zoomX, 5 * zoomY);
						}
					}
				}
			}

		}

	}
}
