home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / emxdive.zip / DIVE.H next >
C/C++ Source or Header  |  1998-03-09  |  6KB  |  184 lines

  1. /* dive.h */
  2.  
  3. #ifdef __cplusplus
  4.         extern "C" {
  5. #endif
  6.  
  7. #ifndef _DIVE_H_
  8. #define _DIVE_H_
  9.  
  10.  
  11. #define MAX_DIVE_INSTANCES 64
  12.  
  13.  
  14. #define FOURCC ULONG
  15. #define HDIVE ULONG
  16.  
  17. #define DIVE_BUFFER_SCREEN 0x00000000
  18. #define DIVE_BUFFER_GRAPHICS_PLANE 0x00000001
  19. #define DIVE_BUFFER_ALTERNATE_PLANE 0x00000002
  20.  
  21. #define DIVE_FULLY_VISIBLE 0xffffffff
  22.  
  23.  
  24. /* Blitter setup structures */
  25.  
  26. typedef struct _SETUP_BLITTER {
  27. ULONG   ulStructLen;
  28. /* ulStructLen tells how much of the structure is used. */
  29. /* Comments here show appropriate values, so don't count ;) */
  30. ULONG   fInvert;                /* Image is inverted on blit */
  31. /* fInvert use: */
  32. /* b0001 = d01 = h01 horizontal flip */
  33. /* b0010 = d02 = h02 vertical flip */
  34.  
  35. /* This is the mark for 8 bytes */
  36.  
  37. FOURCC  fccSrcColorFormat;      /* Source data format */
  38. ULONG   ulSrcWidth;             /* Width in pels */
  39. ULONG   ulSrcHeight;            /* Height in pels */
  40. /* The following are for displaying a sub-portion of the image. */
  41. ULONG   ulSrcPosX;              /* X Position of source data */
  42. ULONG   ulSrcPosY;              /* Y Position of source data */
  43.  
  44. /* This is the mark for 28 bytes */
  45.  
  46. ULONG   ulDitherType;           /* Dither type */
  47.  
  48. /* 32 byte mark */
  49.  
  50. FOURCC  fccDstColorFormat;      /* Destination color format */
  51. ULONG   ulDstWidth;             /* Destination width in pels */
  52. ULONG   ulDstHeight;            /* Destination height in pels */
  53. LONG    lDstPosX;
  54. LONG    lDstPosY;
  55.  
  56. /* 52 byte mark */
  57.  
  58. LONG    lScreenPosX;
  59. LONG    lScreenPosY;
  60.  
  61. /* 60 byte mark */
  62.  
  63. ULONG   ulNumDstRects;
  64. PRECTL  pVisDstRects; /* This is a pointer to an array of visible rectangles. */
  65.  
  66. /* 68 bytes = fully used */
  67.  
  68. } SETUP_BLITTER;
  69.  
  70. typedef SETUP_BLITTER *PSETUP_BLITTER;
  71.  
  72.  
  73. /* Stuff for DiveQueryCaps() */
  74.  
  75. typedef struct _DIVE_CAPS {
  76. ULONG   ulStructLen;            /* sizeof(DIVE_CAPS) */
  77. ULONG   ulPlaneCount;           /* Number of defined planes */
  78.  
  79. /*Following info applies to ulPlaneID */
  80. BOOL    fScreenDirect;          /* Direct screen access */
  81. BOOL    fBankSwitched;          /* VRAM bank-switched? */
  82. ULONG   ulDepth;                /* Number of bits per pixel */
  83. ULONG   ulHorizontalResolution;
  84. ULONG   ulVerticalResolution;
  85. ULONG   ulScanLineBytes;
  86. FOURCC  fccColorEncoding;
  87. ULONG   ulApertureSize;
  88.  
  89. ULONG   ulInputFormats;         /* Number of input color formats */
  90. ULONG   ulOutputFormats;
  91. ULONG   ulFormatLength;         /* Length of format buffer */
  92. PVOID   pFormatData;            /* Pointer to format buffer of FOURCC's */
  93. } DIVE_CAPS;
  94.  
  95. typedef DIVE_CAPS *PDIVE_CAPS;
  96.  
  97.  
  98. /* DIVE function declarations as of Warp 4 */
  99.  
  100. ULONG APIENTRY DiveAcquireFrameBuffer ( HDIVE, PRECTL );
  101. ULONG APIENTRY DiveDeacquireFrameBuffer ( HDIVE );
  102.  
  103. ULONG APIENTRY DiveAllocImageBuffer ( HDIVE, PULONG, FOURCC, ULONG, ULONG, ULONG, PBYTE);
  104. /* if specified line size is 0, allocated line size is rounded up to nearest DWORD boundary. */
  105. ULONG APIENTRY DiveBeginImageBufferAccess ( HDIVE, ULONG, PBYTE *, PULONG, PULONG );
  106. ULONG APIENTRY DiveEndImageBufferAccess ( HDIVE, ULONG );
  107. ULONG APIENTRY DiveFreeImageBuffer (HDIVE, ULONG );
  108.  
  109. ULONG APIENTRY DiveSetupBlitter (HDIVE, PSETUP_BLITTER );
  110. ULONG APIENTRY DiveBlitImage ( HDIVE, ULONG, ULONG );
  111.  
  112. ULONG APIENTRY DiveCalcFrameBufferAddress ( HDIVE, PRECTL, PBYTE *, PULONG, PULONG );
  113. ULONG APIENTRY DiveSwitchBank ( HDIVE, ULONG );
  114.  
  115. ULONG APIENTRY DiveQueryCaps ( PDIVE_CAPS, ULONG );
  116. ULONG APIENTRY DiveSetDestinationPalette ( HDIVE, ULONG, ULONG, PBYTE );
  117. ULONG APIENTRY DiveSetSourcePalette ( HDIVE, ULONG, ULONG, PBYTE );
  118.  
  119. ULONG APIENTRY DiveOpen ( HDIVE *, BOOL, PVOID ppFrameBuffer );
  120. ULONG APIENTRY DiveClose ( HDIVE );
  121.  
  122. #ifdef INCL_MM_OS2
  123. ULONG APIENTRY DiveBlitImageLines ( HDIVE, ULONG, ULONG, PBYTE );
  124. #endif
  125. /* in pbLineMask: one byte per line in source buffer, 0:unchanged, 0xFF=changed. */
  126.  
  127. #define DIVE_PALETTE_PHYSICAL (PBYTE)0x00000000
  128. #define DIVE_PALETTE_DEFAULT (PBYTE)0xffffffff
  129.  
  130. #ifdef INCL_MM_OS2
  131. ULONG APIENTRY DiveSetTransparentBlitMode ( HDIVE, ULONG ulTransBlitMode, ULONG ulValue1, ULONG ulValue2);
  132. #define DIVE_IBM_NONE 0x0
  133. #define DIVE_IBM_EXCLUDE_SOURCE_VALUE 0x01
  134. /* Pixels matching ulValue1 are not transferred */
  135. #define DIVE_IBM_EXCLUDE_SOURCE_RGB_RANGE 0x02
  136. /* don't transfer values that fall between ulValue1 and ulValue2 */
  137. #define DIVE_IBM_INCLUDE_SOURCE_RGB_RANGE 0x03
  138. #define DIVE_IBM_EXCLUDE_SOURCE_YUV_RANGE 0x04
  139. #define DIVE_IBM_INCLUDE_SOURCE_YUV_RANGE 0x05
  140. #endif
  141. #endif
  142.  
  143. #ifdef __cplusplus
  144. }
  145. #endif
  146.  
  147.  
  148.  
  149. /* Return codes as of Warp 4 */
  150.  
  151. #define DIVE_SUCCESS 0x00000000
  152. #define DIVE_ERR_INVALID_INSTANCE 0x00001000
  153. #define DIVE_ERR_SOURCE_FORMAT 0x00001001
  154. #define DIVE_ERR_DESTINATION_FORMAT 0x00001002
  155. #define DIVE_ERR_BLITTER_NOT_SETUP 0x00001003
  156. #define DIVE_ERR_INSUFFICIENT_LENGTH 0x00001004
  157. #define DIVE_ERR_TOO_MANY_INSTANCES 0x00001005
  158. #define DIVE_ERR_NO_DIRECT_ACCESS 0x00001006
  159. #define DIVE_ERR_NOT_BANK_SWITCHED 0x00001007
  160. #define DIVE_ERR_INVALID_BANK_NUMBER 0x00001008
  161. #define DIVE_ERR_FB_NOT_ACQUIRED 0x00001009
  162. #define DIVE_ERR_FB_ALREADY_ACQUIRED 0x0000100a
  163. #define DIVE_ERR_ACQUIRE_FAILED 0x0000100b
  164. #define DIVE_ERR_BANK_SWITCH_FAILED 0x0000100c
  165. #define DIVE_ERR_DEACQUIRE_FAILED 0x0000100d
  166. #define DIVE_ERR_INVALID_PALETTE 0x0000100e
  167. #define DIVE_ERR_INVALID_DESTINATION_RECTL 0x0000100f
  168. #define DIVE_ERR_INVALID_BUFFER_NUMBER 0x00001010
  169. #define DIVE_ERR_SSMDD_NOT_INSTALLED 0x00001011
  170. #define DIVE_ERR_BUFFER_ALREADY_ACCESSED 0x00001012
  171. #define DIVE_ERR_BUFFER_NOT_ACCESSED 0x00001013
  172. #define DIVE_ERR_TOO_MANY_BUFFERS 0x00001014
  173. #define DIVE_ERR_ALLOCATION_ERROR 0x00001015
  174. #define DIVE_ERR_INVALID_LINESIZE 0x00001016
  175. #define DIVE_ERR_FATAL_EXCEPTION 0x00001017
  176. #define DIVE_ERR_INVALID_CONVERSION 0x00001018
  177. #define DIVE_ERR_VSD_ERROR 0x00001019
  178. #define DIVE_ERR_COLOR_SUPPORT 0x0000101a
  179. #define DIVE_ERR_OUT_OF_RANGE 0x0000101b
  180. #define DIVE_WARN_NO_SIZE 0x00001100
  181.  
  182.  
  183.  
  184.