Ejemplo n.º 1
0
static int
headline(				/* process header line */
	char	*s,
	void	*p
)
{
	static RGBPRIMS	inprimS;
	char	fmt[32];

	if (formatval(fmt, s)) {	/* check if format string */
		if (!strcmp(fmt,COLRFMT)) lumf = rgblum;
		else if (!strcmp(fmt,CIEFMT)) lumf = cielum;
		else lumf = NULL;
		return(0);		/* don't echo */
	}
	if (isprims(s)) {		/* get input primaries */
		primsval(inprimS, s);
		inprims= inprimS;
		return(0);		/* don't echo */
	}
	if (isexpos(s)) {		/* picture exposure */
		inpexp *= exposval(s);
		return(0);		/* don't echo */
	}
	if (isaspect(s))		/* pixel aspect ratio */
		pixaspect *= aspectval(s);
	if (isview(s))			/* image view */
		gotview += sscanview(&ourview, s);
	return(fputs(s, stdout));
}
Ejemplo n.º 2
0
static int
headline(		/* check header line */
	char	*s,
	void	*p
)
{
	char  fmt[32];

	if (isformat(s)) {
		formatval(fmt, s);
		wrongformat = strcmp(fmt, COLRFMT);
	} else if (isaspect(s))
		pixaspect *= aspectval(s);
	return(0);
}
Ejemplo n.º 3
0
static int
headline(				/* process line from header */
	char	*s,
	void *pp
)
{
	register char	*cp;

	for (cp = s; *cp; cp++)
		if (*cp & 0x80)
			return(-1);	/* non-ascii in header */
	if (isaspect(s))
		((PICTURE *)pp)->pa *= aspectval(s);
	else
		formatval(((PICTURE *)pp)->fmt, s);
	return(0);
}
Ejemplo n.º 4
0
static int
headline(			/* check header line & echo if requested */
	char	*s,
	void	*p
)
{
	char	fmt[32];
	double	d;
	COLOR	ctmp;

	if (isheadid(s))			/* header id */
		return(0);	/* don't echo */
	if (formatval(fmt, s)) {		/* check format */
		if (globmatch(ourfmt, fmt)) {
			wrongformat = 0;
			strcpy(ourfmt, fmt);
		} else
			wrongformat = globmatch(PICFMT, fmt) ? 1 : -1;
		return(0);	/* don't echo */
	}
	if (isexpos(s)) {			/* exposure */
		d = exposval(s);
		scalecolor(input[nfiles].expos, d);
	} else if (iscolcor(s)) {		/* color correction */
		colcorval(ctmp, s);
		multcolor(input[nfiles].expos, ctmp);
	} else if (isaspect(s))
		input[nfiles].pa *= aspectval(s);
	else if (isview(s) && sscanview(&input[nfiles].vw, s) > 0)
		gotview++;

	if (echoheader) {			/* echo line */
		putchar('\t');
		return(fputs(s, stdout));
	}
	return(0);
}