public abstract class Hqx
{
	private const int Ymask = 16711680;

	private const int Umask = 65280;

	private const int Vmask = 255;

	public static int YUV1;

	public static int YUV2;

	public static bool diff(int c1, int c2, int trY, int trU, int trV, int trA)
	{
		YUV1 = RgbYuv.getYuv(c1);
		YUV2 = RgbYuv.getYuv(c2);
		return Math.abs((YUV1 & 0xFF0000) - (YUV2 & 0xFF0000)) > trY || Math.abs((YUV1 & 0xFF00) - (YUV2 & 0xFF00)) > trU || Math.abs((YUV1 & 0xFF) - (YUV2 & 0xFF)) > trV || Math.abs((c1 >> 24) - (c2 >> 24)) > trA;
	}

	public static int[] HqxZoom(int zoom, int[] source, int Xres, int Yres)
	{
		int[] array = null;
		switch (zoom)
		{
		case 2:
			array = new int[Xres * Yres * zoom * zoom];
			Hqx_2x.hq2x_32_rb(source, array, Xres, Yres);
			break;
		case 3:
			array = new int[Xres * Yres * zoom * zoom];
			Hqx_3x.hq3x_32_rb(source, array, Xres, Yres);
			break;
		case 4:
			array = new int[Xres * Yres * zoom * zoom];
			Hqx_4x.hq4x_32_rb(source, array, Xres, Yres);
			break;
		default:
			array = source;
			break;
		}
		return array;
	}
}
