Esempio n. 1
0
static void img_w3i1o4(byte *rgb, FZ_PSRC, FZ_PDST, FZ_PCTM)
{
	byte rgb0 = rgb[0];
	byte rgb1 = rgb[1];
	byte rgb2 = rgb[2];
	byte sa, ssa;
	while (h--)
	{
		byte *dstp = dst0;
		int u = u0;
		int v = v0;
		int w = w0;
		while (w--)
		{
			sa = samplemask(src, srcw, srch, u, v);
			ssa = 255 - sa;
			dstp[0] = sa + fz_mul255(dstp[0], ssa);
			dstp[1] = rgb0 + fz_mul255((short)dstp[1] - rgb0, ssa);
			dstp[2] = rgb1 + fz_mul255((short)dstp[2] - rgb1, ssa);
			dstp[3] = rgb2 + fz_mul255((short)dstp[3] - rgb2, ssa);
			dstp += 4;
			u += fa;
			v += fb;
		}
		dst0 += dstw;
		u0 += fc;
		v0 += fd;
	}
}
static void img_w4i1o4(byte *argb, FZ_LPSRC, FZ_PDST, FZ_PCTM)
{
	byte alpha = argb[0];
	byte r = argb[4];
	byte g = argb[5];
	byte b = argb[6];
	byte cov;
	byte ca;
	while (h--)
	{
		byte *dstp = dst0;
		int u = u0;
		int v = v0;
		int w = w0;

		checktile(src, v>>16);

		while (w--)
		{
			cov = samplemask(src, srcw, srch, u, v);
			ca = fz_mul255(cov, alpha);
			dstp[0] = ca + fz_mul255(dstp[0], 255 - ca);
			dstp[1] = fz_mul255((short)r - dstp[1], ca) + dstp[1];
			dstp[2] = fz_mul255((short)g - dstp[2], ca) + dstp[2];
			dstp[3] = fz_mul255((short)b - dstp[3], ca) + dstp[3];
			dstp += 4;
			u += fa;
			v += fb;
		}
		dst0 += dstw;
		u0 += fc;
		v0 += fd;
	}
}
static void img_1o1(FZ_LPSRC, FZ_PDST, FZ_PCTM)
{
	byte srca;
	while (h--)
	{
		byte *dstp = dst0;
		int u = u0;
		int v = v0;
		int w = w0;

		checktile(src, v>>16);

		while (w--)
		{
			srca = samplemask(src, srcw, srch, u, v);
			dstp[0] = srca + fz_mul255(dstp[0], 255 - srca);
			dstp ++;
			u += fa;
			v += fb;
		}
		dst0 += dstw;
		u0 += fc;
		v0 += fd;
	}
}
Esempio n. 4
0
static void img_1c1(FZ_PSRC, FZ_PDST, FZ_PCTM)
{
	while (h--)
	{
		byte *dstp = dst0;
		int u = u0;
		int v = v0;
		int w = w0;
		while (w--)
		{
			dstp[0] = samplemask(src, srcw, srch, u, v);
			dstp ++;
			u += fa;
			v += fb;
		}
		dst0 += dstw;
		u0 += fc;
		v0 += fd;
	}
}