1 /*
    2 **	$VER: cybergraphics.h 50.12 (13.08.2008)
    3 **
    4 **	include file for cybergraphics.library
    5 **
    6 **	Copyright � 1996-2008 by Vision Factory Development
    7 **	All Rights reserved.
    8 **
    9 */
   10 
   11 #ifndef CYBERGRAPHX_CYBERGRAPHICS_H
   12 #define CYBERGRAPHX_CYBERGRAPHICS_H
   13 
   14 #ifndef UTILITY_TAGITEM_H
   15 #include <utility/tagitem.h>
   16 #endif
   17 
   18 #ifndef GRAPHICS_DISPLAYINFO_H
   19 #include <graphics/displayinfo.h>
   20 #endif
   21 
   22 #pragma pack(2)
   23 
   24 
   25 #define CYBERGFXNAME              "cybergraphics.library"
   26 #define CYBERGFX_INCLUDE_VERSION  (41UL)
   27 
   28 /*
   29  *  Definition of CyberModeNode (Returned in AllocModeList)
   30  *
   31  */
   32 
   33 struct CyberModeNode
   34 {
   35 	struct Node Node;
   36 	char   ModeText[DISPLAYNAMELEN];        /* name for this mode */
   37 	ULONG  DisplayID;                       /* display id associated with the node */
   38 	UWORD  Width;                           /* visible width */
   39 	UWORD  Height;                          /* visible height */
   40 	UWORD  Depth;                           /* display depth */
   41 	struct TagItem *DisplayTagList;         /* taglist with extended ModeID information */
   42 };
   43 
   44 
   45 /*
   46  * Parameters for GetCyberMapAttr()
   47  *
   48  */
   49 
   50 #define CYBRMATTR_XMOD        (0x80000001) /* function returns BytesPerRow if its called with this parameter */
   51 #define CYBRMATTR_BPPIX       (0x80000002) /* BytesPerPixel shall be returned */
   52 #define CYBRMATTR_DISPADR     (0x80000003) /* do not use this ! private tag */
   53 #define CYBRMATTR_PIXFMT      (0x80000004) /* the pixel format is returned */
   54 #define CYBRMATTR_WIDTH       (0x80000005) /* returns width in pixels */
   55 #define CYBRMATTR_HEIGHT      (0x80000006) /* returns height in lines */
   56 #define CYBRMATTR_DEPTH       (0x80000007) /* returns bits per pixel */
   57 #define CYBRMATTR_ISCYBERGFX  (0x80000008) /* returns -1 if supplied bitmap is a cybergfx one */
   58 #define CYBRMATTR_ISLINEARMEM (0x80000009) /* returns -1 if supplied bitmap is linear accessable */
   59 #define CYBRMATTR_COLORMAP    (0x8000000A) /* returns colormap associated with that bitmap (v50) */
   60 
   61 /*
   62  * Parameters for GetCyberIDAttr()
   63  *
   64  */
   65 
   66 #define CYBRIDATTR_PIXFMT (0x80000001) /* the pixel format is returned */
   67 #define CYBRIDATTR_WIDTH  (0x80000002) /* returns visible width in pixels */
   68 #define CYBRIDATTR_HEIGHT (0x80000003) /* returns visible height in lines */
   69 #define CYBRIDATTR_DEPTH  (0x80000004) /* returns bits per pixel */
   70 #define CYBRIDATTR_BPPIX  (0x80000005) /* BytesPerPixel shall be returned */
   71 
   72 /*
   73  * Tags for CyberModeRequest()
   74  *
   75  */
   76 
   77 #define CYBRMREQ_TB          (TAG_USER+0x40000)
   78 
   79 /*
   80  * FilterTags
   81  *
   82  */
   83 
   84 #define CYBRMREQ_MinDepth    (CYBRMREQ_TB+0)  /* Minimum depth for displayed screenmode */
   85 #define CYBRMREQ_MaxDepth    (CYBRMREQ_TB+1)  /* Maximum depth  "       "        " */
   86 #define CYBRMREQ_MinWidth    (CYBRMREQ_TB+2)  /* Minumum width  "       "        " */
   87 #define CYBRMREQ_MaxWidth    (CYBRMREQ_TB+3)  /* Maximum width  "       "        " */
   88 #define CYBRMREQ_MinHeight   (CYBRMREQ_TB+4)  /* Minumum height "       "        " */
   89 #define CYBRMREQ_MaxHeight   (CYBRMREQ_TB+5)  /* Minumum height "       "        " */
   90 #define CYBRMREQ_CModelArray (CYBRMREQ_TB+6)
   91 
   92 #define CYBRMREQ_WinTitle    (CYBRMREQ_TB+20)
   93 #define CYBRMREQ_OKText      (CYBRMREQ_TB+21)
   94 #define CYBRMREQ_CancelText  (CYBRMREQ_TB+22)
   95 
   96 #define CYBRMREQ_Screen      (CYBRMREQ_TB+30)  /* Screen you wish the Requester to open on */
   97 
   98 /*
   99  * Tags for BestCyberModeID()
  100  *
  101  */
  102 
  103 #define CYBRBIDTG_TB  (TAG_USER+0x50000)
  104 
  105 /* FilterTags */
  106 
  107 #define CYBRBIDTG_Depth         (CYBRBIDTG_TB+0)
  108 #define CYBRBIDTG_NominalWidth  (CYBRBIDTG_TB+1)
  109 #define CYBRBIDTG_NominalHeight (CYBRBIDTG_TB+2)
  110 #define CYBRBIDTG_MonitorID     (CYBRBIDTG_TB+3)
  111 #define CYBRBIDTG_BoardName     (CYBRBIDTG_TB+5)
  112 
  113 /*
  114  * definition of drivers pixel formats
  115  *
  116  * Note: PIXFMT_BGR15, PIXFMT_BGR15PC, PIXFMT_BGR16 and PIXFMT_BGR16PC
  117  * aren't really supported by CyberGraphX, you should not use them as
  118  * pixel format for your bitmaps.
  119  */
  120 
  121 #define PIXFMT_LUT8     (0UL)
  122 #define PIXFMT_RGB15    (1UL)
  123 #define PIXFMT_RGB15X   (2UL)  /* CGX4 used it as RRRRRGGG GGBBBBBX, CGX3 did not support it at all */
  124 #define PIXFMT_BGR15    (2UL)  /* NOTE: Source code compatibility only, really RGB15X */
  125 #define PIXFMT_RGB15PC  (3UL)
  126 #define PIXFMT_BGR15PC  (4UL)
  127 #define PIXFMT_RGB16    (5UL)
  128 #define PIXFMT_BGR16    (6UL)
  129 #define PIXFMT_RGB16PC  (7UL)
  130 #define PIXFMT_BGR16PC  (8UL)
  131 #define PIXFMT_RGB24    (9UL)
  132 #define PIXFMT_BGR24    (10UL)
  133 #define PIXFMT_ARGB32   (11UL)
  134 #define PIXFMT_BGRA32   (12UL)
  135 #define PIXFMT_RGBA32   (13UL)
  136 
  137 
  138 /*
  139  * SrcRectangle formats defines for xxxPixelArray calls()
  140  *
  141  */
  142 
  143 #define RECTFMT_RGB     (0UL)
  144 #define RECTFMT_RGBA    (1UL)
  145 #define RECTFMT_ARGB    (2UL)
  146 #define RECTFMT_LUT8    (3UL)
  147 #define RECTFMT_GREY8   (4UL)
  148 #define RECTFMT_RAW     (5UL)
  149 
  150 /*
  151  * Parameters for CVideoCtrlTagList()
  152  *
  153  */
  154 
  155 #define SETVC_DPMSLevel  (0x88002001)
  156 
  157 #define DPMS_ON      (0UL)   /* Full operation                             */
  158 #define DPMS_STANDBY (1UL)   /* Optional state of minimal power reduction  */
  159 #define DPMS_SUSPEND (2UL)   /* Significant reduction of power consumption */
  160 #define DPMS_OFF     (3UL)   /* Lowest level of power consumption          */
  161 
  162 
  163 /*
  164  * Tags for LockBitMapTagList()
  165  *
  166  */
  167 
  168 #define LBMI_WIDTH       (0x84001001)
  169 #define LBMI_HEIGHT      (0x84001002)
  170 #define LBMI_DEPTH       (0x84001003)
  171 #define LBMI_PIXFMT      (0x84001004)
  172 #define LBMI_BYTESPERPIX (0x84001005)
  173 #define LBMI_BYTESPERROW (0x84001006)
  174 #define LBMI_BASEADDRESS (0x84001007)
  175 
  176 /*
  177  * Tags for UnLockBitMapTagList()
  178  *
  179  */
  180 
  181 #define UBMI_UPDATERECTS        (0x85001001)
  182 #define UBMI_REALLYUNLOCK       (0x85001002)
  183 
  184 
  185 
  186 /*
  187  * Message passed to the DoCDrawMethodTagList() hook function
  188  *
  189  */
  190 
  191 
  192 struct  CDrawMsg
  193 {
  194 	APTR    cdm_MemPtr;
  195 	ULONG   cdm_offx;
  196 	ULONG   cdm_offy;
  197 	ULONG   cdm_xsize;
  198 	ULONG   cdm_ysize;
  199 	UWORD   cdm_BytesPerRow;
  200 	UWORD   cdm_BytesPerPix;
  201 	UWORD   cdm_ColorModel;
  202 };
  203 
  204 /*
  205  * Colour Table source formats for WriteLUTPixelArray()
  206  *
  207  */
  208 
  209 #define CTABFMT_XRGB8   (0UL)   /* ULONG [] table */
  210 
  211 
  212 /*
  213  * graphics.library/AllocBitMap() extended flags
  214  *
  215  */
  216 
  217 #ifndef BMB_SPECIALFMT
  218 #define BMB_SPECIALFMT (7UL)
  219 #define BMF_SPECIALFMT (1UL << BMB_SPECIALFMT)
  220 #endif /* BMB_SPECIALFMT */
  221 
  222 #define SHIFT_PIXFMT( fmt ) (((ULONG)(fmt)) << 24UL)
  223 
  224 #define BMF_REQUESTVMEM  (BMF_MINPLANES|BMF_DISPLAYABLE)	
  225 
  226 #ifndef BMB_ROOTMAP
  227 #define BMB_ROOTMAP (5UL)
  228 #define BMF_ROOTMAP (1UL << BMB_ROOTMAP)
  229 #endif /* BMB_ROOTMAP */
  230 
  231 #ifndef BMB_3DTARGET
  232 #define BMB_3DTARGET (8UL)
  233 #define BMF_3DTARGET (1UL << BMB_3DTARGET)
  234 #endif /* BMB_3DTARGET */
  235 
  236 
  237 /*
  238  * Operations for ProcessPixelArray() (v50)
  239  *
  240  */
  241 
  242 #define POP_BRIGHTEN            0
  243 #define POP_DARKEN              1
  244 #define POP_SETALPHA            2
  245 #define POP_TINT                3
  246 #define POP_BLUR                4
  247 #define POP_COLOR2GREY          5
  248 #define POP_NEGATIVE            6
  249 #define POP_NEGFADE             7
  250 #define POP_TINTFADE            8
  251 #define POP_GRADIENT            9
  252 #define POP_SHIFTRGB            10
  253 
  254 /*
  255  * Values for POP_SHIFTRGB
  256  *
  257  */
  258 
  259 #define RGBSHIFT_BGR             (1UL)
  260 #define RGBSHIFT_BRG             (2UL)
  261 #define RGBSHIFT_GBR             (3UL)
  262 #define RGBSHIFT_GRB             (4UL)
  263 #define RGBSHIFT_RBG             (5UL)
  264 
  265 
  266 /*
  267  * Tags for ProcessPixelArray() ops
  268  *
  269  */
  270 
  271 #define PPAOPTAG_FADEFULLSCALE  0x85231020
  272 #define PPAOPTAG_FADEOFFSET     0x85231021
  273 
  274 
  275 #define PPAOPTAG_GRADIENTTYPE                   0x85231022
  276 
  277 #define GRADTYPE_HORIZONTAL                     0
  278 #define GRADTYPE_VERTICAL                       1
  279 
  280 /* yet unsupported gradient types follow */
  281 #define GRADTYPE_RECTANGLE                      2
  282 #define GRADTYPE_LINEAR_ANGLE                   3
  283 #define GRADTYPE_RADIAL                         4 /* "circle" center-based */
  284 
  285 #define GRADIENT_NUMTYPES                       2
  286 
  287 #define PPAOPTAG_GRADCOLOR1                     0x85231023
  288 #define PPAOPTAG_GRADCOLOR2                     0x85231024
  289 
  290 #define PPAOPTAG_GRADFULLSCALE                  PPAOPTAG_FADEFULLSCALE
  291 #define PPAOPTAG_GRADOFFSET                     PPAOPTAG_FADEOFFSET
  292 
  293 #define PPAOPTAG_RGBMASK                        0x85231025
  294 
  295 #define PPAOPTAG_GRADSYMCENTER                  0x85231026
  296 
  297 /*
  298  * Tags for BltBitMap(RastPort)Alpha() (v50)
  299  *
  300  */
  301 
  302 #define BLTBMA_MIXLEVEL         0x88802000      /* from 0(0%) to 0xFFFFFFFF (100%) */
  303 #define BLTBMA_USESOURCEALPHA   0x88802001
  304 #define BLTBMA_GLOBALALPHA      BLTBMA_MIXLEVEL
  305 #define BLTBMA_DESTALPHAVALUE   0x88802002
  306 
  307 #define DESTALPHAVALUE_UNDEFINED    0 /* default */
  308 #define DESTALPHAVALUE_ONE          1
  309 #define DESTALPHAVALUE_USESOURCE    2
  310 #define DESTALPHAVALUE_USEDEST      3
  311 
  312 #pragma pack()
  313 
  314 #endif  /* CYBERGRAPHX_CYBERGRAPHICS_H */