home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Painting / XiPaint3.2-Aminet11.lzx / XiPaint / Developer / OutputLib / libraries / vilintuisup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-10  |  5.1 KB  |  111 lines

  1. /********************************************************************
  2.  * vilintuisup.h                                                    *
  3.  *                                                                  *
  4.  * Funktion:  Beinhaltet Definitionen, die bei der Benutzung der    *
  5.  *            Funktionen in "vilintuisup.c" gebraucht werden.       *
  6.  *                                                                  *
  7.  *            (definitions - neccesary if using functions in        *
  8.  *             vilintuisup.c)                                       *
  9.  *                                                                  *
  10.  * Datum      23. November 1992 (Init)                              *
  11.  *            19. Januar 1993   (Last Change)                       *
  12.  *                                                                  *
  13.  * Version    1.1                                                   *
  14.  * Autor      David Göhler, Village Tronic, Hannover                *
  15.  *                                                                  *
  16.  ********************************************************************/
  17.  
  18. extern struct Library *VilIntuiBase;
  19.  
  20. /* macro definitions ************************************************/
  21. #define SETRGB(s,cn,r,g,b)     SetRGB4(&((s)->ViewPort),cn,r,g,b)
  22.  
  23. #ifndef ABS
  24. #define ABS(x) ((x)<0 ? -(x) : (x))
  25. #endif
  26.  
  27. /* needed structure for BlitOperations *******************************/
  28.  
  29. struct VilCopyRecord {
  30.     UBYTE    *SrcAdr;       /* Source address start */
  31.     UBYTE    *DestAdr;      /* Destination address start */
  32.     UWORD     SrcPitch;     /* Width of source area */
  33.     UWORD     DestPitch;    /* Width of destination area */
  34.     UWORD     Width;        /* Rectangle width to deal with */
  35.     UWORD     Height;       /* Rectangle height to deal with */
  36.     ULONG     ROP;          /* Blit Raster Operation - see above */
  37. };
  38.  
  39. struct VilFillRecord {
  40.     UBYTE    *DestAdr;      /* Destination address start */
  41.     UWORD     DestPitch;    /* Width of destination area */
  42.     UWORD     Width;        /* Rectangle width to deal with */
  43.     UWORD     Height;       /* Rectangle height to deal with */
  44.      LONG     Color;        /* if (Color < 0) Color = Color & 255) */
  45. };                          /* else      Color = R*65536 + G*256 + B */
  46.  
  47. /* needed structure for Open/CloseVillageScreen **********************/
  48.  
  49. struct Dimensions {
  50.     ULONG     ViewModeID;
  51.     UWORD     width;
  52.     UWORD     height;
  53.     UWORD     depth;
  54. };
  55.  
  56. /* needed structure for TrueColor functions *************************/
  57.  
  58. typedef
  59. #ifdef _DCC
  60. __unaligned     /* this is important: THREE bytes per pixel, NOT FOUR!! */
  61. #endif
  62. struct {
  63.    UBYTE b;     /* blue byte first !!! */
  64.    UBYTE g;     /* green byte second   */
  65.    UBYTE r;     /* red byte third      */
  66. } RGB;
  67.  
  68. /* need structure for blit operations *******************************/
  69.  
  70. /* defines for RasterOperations *************************************/
  71. #define         VIL_ZERO                0x00    /* Clear all bits */
  72. #define         VIL_ONE                 0x0e    /* Set all bits */
  73. #define         VIL_SRCCOPY             0x0d    /* Copy Source to Destination */
  74. #define         VIL_NOTSRCCOPY          0xd0    /* Copy inverted Source to Destination */
  75. #define         VIL_SRCAND              0x05    /* logical AND Source with Destination */
  76. #define         VIL_NOTSRCAND           0x50    /* logical AND inverted Source with Destination */
  77. #define         VIL_SRCPAINT            0x6d    /* logical OR Source with Destination */
  78. #define         VIL_MERGEPAINT          0xd6    /* logical OR inverted Source with Destination */
  79. #define         VIL_SRCINVERT           0x59    /* logical EXOR Source with Destination */
  80. #define         VIL_NOTSRCINVERT        0x95    /* logical EXNOR Source with Destination */
  81. #define         VIL_SRCERASE            0x09    /* logical AND Source with inverted Destination */
  82. #define         VIL_NOTSRCERASE         0x90    /* logical AND inverted Source with inverted Destination */
  83. #define         VIL_SRCORNOT            0xad    /* logical OR Source with inverted Destination */
  84. #define         VIL_NOTSRCORNOT         0xda    /* logical OR inverted Source with inverted Destination */
  85. #define         VIL_DSTINVERT           0x0b    /* invert Destination */
  86.  
  87. /* function prototypes **********************************************/
  88.  
  89. /* general functions */
  90.  
  91. #include "clib/vilintuisup_protos.h"
  92.  
  93. /* pixel functions for each mode */
  94.  
  95. void           SetTrueColorPixel(struct Screen *s, UWORD x, UWORD y, UBYTE r, UBYTE g, UBYTE b);
  96. void           SetPackedPixel   (struct Screen *s, UWORD x, UWORD y, UBYTE color);
  97. void           Set15BitPixel    (struct Screen *s, UWORD x, UWORD y, UBYTE r, UBYTE g, UBYTE b);
  98. void           Set16BitPixel    (struct Screen *s, UWORD x, UWORD y, UBYTE r, UBYTE g, UBYTE b);
  99.  
  100. /* line drawing functions for each mode */
  101.  
  102. void           LinePacked       (struct Screen *s, UWORD xs,UWORD ys,UWORD xe,UWORD ye,UBYTE color);
  103. void           LineTrueColor    (struct Screen *s, UWORD xs,UWORD ys,UWORD xe,UWORD ye,RGB *color);
  104.  
  105. /* extra functions */
  106.  
  107. UWORD          Get16FromRGB(UBYTE r, UBYTE g, UBYTE b);
  108. UWORD          Get15FromRGB(UBYTE r, UBYTE g, UBYTE b);
  109. void           WaitTilEnd(struct Screen *s);
  110.  
  111.