Ejemplo n.º 1
0
static int
cvtcolor(		/* convert color according to our mapping */
	COLOR	cout,
	COLOR	cin
)
{
	COLOR	ctmp;
	int	clipped;

	if (wcor != NULL) {
		clipped = warp3d(cout, cin, wcor);
		clipped |= clipgamut(cout,bright(cout),CGAMUT,colmin,colmax);
	} else if (scanning) {
		bresp(ctmp, cin);
		clipped = cresp(cout, ctmp);
	} else {
		clipped = cresp(ctmp, cin);
		bresp(cout, ctmp);
	}
	return(clipped);
}
Ejemplo n.º 2
0
static void
cwscan(			/* apply color space warp to scaline */
	COLOR	*sl,
	int	len,
	WARP3D	*wp
)
{
	int	rval;

	while (len--) {
		rval = warp3d(sl[0], sl[0], wp);
		if (rval & W3ERROR)
			syserror("warp3d");
		if (rval & W3BADMAP) {
			fprintf(stderr, "%s: %s: bad color space map\n",
					progname, cwarpfile);
			exit(1);
		}
		clipgamut(sl[0], greypoint(sl[0]), CGAMUT, cblack, cwhite);
		sl++;
	}
}