DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T d

⟦d60bbe168⟧ TextFile

    Length: 2611 (0xa33)
    Types: TextFile
    Names: »ddxfill.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« 
        └─⟦2109abc41⟧ 
            └─ ⟦this⟧ »./X.V10R4/libqvss/ddxfill.c« 

TextFile

/* fill.c	Perform a simple raster operation a section of the screen
 *
 *	PixFill		Do a function on the screen
 *	StippleFill	Fill rectangle with a stipple pattern
 *
 *	Modification History
 *
 *	Carver 8510.25 Removed error checking in calls to copyrmsk
 *		       and copybmsk.  No errors are ever return.
 *
 */

#include "ddxqvss.h"
#include "qvss.h"
#include "vstagbl.h"

extern BITMAP pbm;

/*ARGSUSED*/
PixFill (srcpix, xymask, dstx, dsty, width, height, clips, clipcount,
	 func, zmask)
	int srcpix, dstx, dsty, width, height, clipcount, zmask;
	register BITMAP *xymask;
	register int func;
	CLIP *clips;
{
	int constant = srcpix & 1;

	if (!(zmask & 1)) {
	    return;
	}
	if (xymask == 0)
	  {
	  copyrmsk (VSTA$K_SRC_CONST, constant, 0, 0, 0, 0,
			  width, height, (short *) pbm.data,
			  pbm.width, pbm.height, dstx, dsty, func,
			  clipcount, clips);
	  return;
	  }

	copybmsk (VSTA$K_SRC_CONST, constant, 0, 0, 0, 0,
			(short *) xymask->data, xymask->width, 
			xymask->height, 0, 0, width, height, 
			(short *) pbm.data,
			pbm.width, pbm.height, dstx, dsty, func,
			clipcount, clips);
	return;
}

extern int errno;
#include <errno.h>

int StippleFill (srcpix, xoff, yoff, stipmask, dstx, dsty, width, height,
	clips, clipcount, func, zmask)
	int srcpix;		/* source pixel */
	int xoff, yoff;		/* stipple origin */
	BITMAP *stipmask;	/* stipple mask */
	int dstx, dsty;		/* destination */
	int width, height;
	CLIP *clips;		/* clipping rectangles */
	int clipcount;
	int func;		/* GX display function */
	int zmask;		/* plane mask */
{
    	static char funcmap[16][2] = {
		{GXandInverted,	GXandInverted},	/* GXclear */
		{GXandInverted, GXnoop},	/* GXand */
		{GXandInverted,	GXxor},		/* GXandReverse */
		{GXandInverted, GXor},		/* GXcopy */
		{GXnoop,	GXandInverted},	/* GXandInverted */
		{GXnoop,	GXnoop},	/* GXnoop */
		{GXnoop,	GXxor},		/* GXxor */
		{GXnoop,	GXor},		/* GXor */
		{GXxor,		GXandInverted},	/* GXnor */
		{GXxor,		GXnoop},	/* GXequiv */
		{GXxor,		GXxor},		/* GXinvert */
		{GXxor,		GXor},		/* GXorReverse */
		{GXor,		GXandInverted},	/* GXcopyInverted */
		{GXor,		GXnoop},	/* GXorInverted */
		{GXor,		GXxor},		/* GXnand */
		{GXor,		GXor}		/* GXset */
	};
	int newfunc = funcmap [func][srcpix & 1];
		
	if (!(zmask & 1)) {
	    return (1);
	}
	if ((stipmask->width != 16) || (stipmask->height != 16)) {
		errno = EINVAL;
		return (0);
	}
	copyrmsk (VSTA$K_SRC_HT_BITMAP, (short *)stipmask->data, 
		stipmask->width, stipmask->height, xoff, yoff,
		width, height,
		(short *)pbm.data, pbm.width, pbm.height,
		dstx, dsty, newfunc, clipcount, clips);
	return (1);
}