1: /* Copyright 1985, Massachusetts Institute of Technology */
   2: 
   3: /* put.c	Perform a raster operation with a source bitmap
   4:  *
   5:  *	PixmapPut	Puts a pixmap up on the screen
   6:  *	PixmapBitsPut	Puts a pixmap up on the screen
   7:  *	BitmapBitsPut	Puts a pixmap up on the screen
   8:  *
   9:  * Modification History:
  10:  *
  11:  *   Carver 8601.13 Added extern statement for SSmap
  12:  *
  13:  *   Carver 8601.06 Added line to PixmapPut to adjust the func to compensate
  14:  *		    for the reverse flag being set in the pixmap descriptor.
  15:  *
  16:  *   Carver 8510.10 Put in support for source bitmap/sub-bitmap mask
  17:  *		    copy areas.
  18:  *
  19:  *   Carver 8510.09 In PixmapBitsPut fixed the table lookup on foreground
  20:  *		    and background.
  21:  */
  22: 
  23: #include "ddxqvss.h"
  24: #include "vstagbl.h"
  25: 
  26: extern BITMAP pbm;
  27: 
  28: PixmapPut (src, srcx, srcy, width, height, dstx, dsty, clips, clipcount,
  29:        func, zmask)
  30:     register PIXMAP *src;
  31:     int srcx, srcy, width, height, dstx, dsty, clipcount, zmask;
  32:     register int func;
  33:     CLIP *clips;
  34: {
  35:     BITMAP *bm = (BITMAP *) src->data;
  36:     extern char SSMap[];
  37: 
  38:     if (!(zmask & 1))  return;
  39: 
  40:     /* ADJUST MAP FOR REVERSE PIXMAP */
  41: 
  42:     func = SSMap[ func | (src->kind & InvertFlag)];
  43: 
  44:     copyrmsk( VSTA$K_SRC_BITMAP, (short *)bm->data, bm->width, bm->height,
  45:         srcx, srcy, width, height,
  46:         (short *)pbm.data, pbm.width, pbm.height,
  47:         dstx, dsty, func, clipcount, clips);
  48:     return;
  49: }
  50: 
  51: 
  52: /*ARGSUSED*/
  53: PixmapBitsPut (width, height, format, data, xymask, dstx, dsty,
  54:            clips, clipcount, func, zmask)
  55:     char *data;
  56:     int width, height, format, dstx, dsty, clipcount, zmask;
  57:     BITMAP *xymask;
  58:     CLIP *clips;
  59:     int func;
  60: {
  61:     BitmapBitsPut (width, height, data, 1, 0, xymask, dstx, dsty,
  62:                clips, clipcount, func, zmask);
  63: }
  64: 
  65: 
  66: BitmapBitsPut (width, height, data, fore, back, xymask, dstx, dsty,
  67:            clips, clipcount, func, zmask)
  68:     char *data;
  69:     int width, height, fore, back, dstx, dsty, clipcount, zmask;
  70:     register BITMAP *xymask;
  71:     CLIP *clips;
  72:     register int func;
  73: {
  74:     int mask_x = pbm.width, mask_y = pbm.height;
  75:     extern char FBMap[];
  76: 
  77:     if (!(zmask & 1))  return;
  78: 
  79:     /* USE FBMap TABLE TO CONVERT FORE/BACK INTO A SINGLE SOURCE
  80: 	   MAPPING FUNCTION */
  81: 
  82:     if (fore & 1) func += 0x20;
  83:     if (back & 1) func += 0x10;
  84: 
  85:     func = FBMap[func];
  86: 
  87:     if (xymask == NULL)
  88:         {
  89:         copyrmsk (VSTA$K_SRC_BITMAP, (short *) data, width, height,
  90:               0, 0, mask_x, mask_y, (short *) pbm.data, pbm.width,
  91:               pbm.height, dstx, dsty, func, clipcount, clips);
  92:         }
  93:     else
  94:         {
  95: 
  96:         copybmsk (
  97:             VSTA$K_SRC_BITMAP, (short *)data, width, height,
  98:             0, 0,
  99:             (short *) xymask->data, xymask->width, xymask->height,
 100:             0, 0, width, height,
 101:             (short *)pbm.data, pbm.width, pbm.height,
 102:             dstx, dsty, func, clipcount, clips);
 103:         };
 104: 
 105: 
 106: 
 107:     return;
 108: }

Defined functions

BitmapBitsPut defined in line 66; used 1 times
  • in line 61
PixmapBitsPut defined in line 53; never used
PixmapPut defined in line 28; never used
Last modified: 1986-01-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 884
Valid CSS Valid XHTML 1.0 Strict