[BACK]Return to pix.c CVS log [TXT][DIR] Up to [Development] / inventor / libimage

File: [Development] / inventor / libimage / pix.c (download)

Revision 1.1, Tue Aug 15 12:56:29 2000 UTC (17 years, 2 months ago) by naaman
Branch point for: MAIN

Initial revision

/*
 *	getpix and putpix -
 *
 *				Paul Haeberli - 1984
 *
 */
#include	<stdio.h>
#include	"image.h"

#undef getpix
#undef putpix

int getpix(IMAGE *image)
{
    if(--(image)->cnt>=0)
    	return (int)(*(image)->ptr++);
    else
	return ifilbuf(image);
}

unsigned int putpix(IMAGE *image, unsigned int pix)
{
    if(--(image)->cnt>=0)
        return (unsigned int)(*(image)->ptr++ = pix);
    else
	return iflsbuf(image,pix);
}