home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mmpm21tk.zip / TK / MMOTTK / MMOTPROC.H < prev    next >
C/C++ Source or Header  |  1993-02-09  |  6KB  |  156 lines

  1. /********************** START OF SPECIFICATIONS *************************/
  2. /*                                                                      */
  3. /* SOURCE FILE NAME: MMOTPROC.H                                         */
  4. /*                                                                      */
  5. /* DESCRIPTIVE NAME: Multi-Media I/O Procedure for M-Motion Video       */
  6. /*                                                                      */
  7. /* COPYRIGHT:                                                           */
  8. /*              Copyright (c) IBM Corporation  1990, 1993               */
  9. /*                        All Rights Reserved                           */
  10. /*                                                                      */
  11. /* ABSTRACT: This file is the include/header file for use with the      */
  12. /*           M-Motion IOProc (file MMOT.C)                              */
  13. /*                                                                      */
  14. /*********************** END OF SPECIFICATIONS **************************/
  15.  
  16. #pragma pack(2)
  17.  
  18. static char     pszMotionExt  [] = "VID";
  19.  
  20. typedef RGB FAR *PRGB;  
  21.  
  22. /****************************************
  23.  * Custom M-Motion Still Image File header
  24.  ****************************************/
  25. typedef struct _MMOTIONHEADER
  26.     {
  27.     CHAR    mmID[6];            /* always set to "YUV12C"            */
  28.     CHAR    mmFuture[2];        /* 0, 0 : Reserved for future use    */
  29.     USHORT  mmXorg;             /* X origin of YUV data              */
  30.     USHORT  mmYorg;             /* Y origin of YUV data              */
  31.     USHORT  mmXlen;             /* width of image                    */
  32.     USHORT  mmYlen;             /* height of image                   */
  33.     } MMOTIONHEADER;
  34. typedef MMOTIONHEADER FAR *PMMOTIONHEADER;
  35.  
  36. /****************************************
  37.  * IOProc information structure, used for every file opened
  38.  *    by this IOProc
  39.  ****************************************/
  40. typedef struct _MMFILESTATUS
  41.     {
  42.     PBYTE   lpRGBBuf;               /* 24-bit RGB Buf for trans data */
  43.  
  44.     /* Buffer containing pel data from WRITES in bitmap format       */
  45.     PBYTE   lpImgBuf;
  46.     ULONG   ulRGBTotalBytes;        /* Length of 24-bit RGBBuf       */
  47.  
  48.     /* 4-byte RGB Palette for any trans data                         */
  49.     RGB     rgbPalette[MAX_PALETTE];
  50.     LONG    lImgBytePos;            /* Current pos in RGB buf        */
  51.  
  52.     /*  Bytes/row, incl overflow - not ULONG pads                    */
  53.     ULONG   ulImgPelBytesPerLine;
  54.  
  55.     /* Bytes/row, incl overflow & ULONG pads '                       */
  56.     ULONG   ulImgPaddedBytesPerLine;
  57.  
  58.     /* Length of trans data in 1, 4, 8, or 24 bbp                    */
  59.     ULONG   ulImgTotalBytes;
  60.     ULONG   ulFlags;                /* Misc flags                    */
  61.     BOOL    bSetHeader;             /* TRUE if header set in WRITE mode*/
  62.  
  63.     /* MMIO handle to Storage System IOProc that provides data.      */
  64.     HMMIO   hmmioSS;
  65.     MMIMAGEHEADER   mmImgHdr;       /* Standard image header         */
  66.     MMOTIONHEADER   mmotHeader;     /* Custom image header           */
  67.     } MMFILESTATUS;
  68. typedef MMFILESTATUS FAR *PMMFILESTATUS;
  69.  
  70. /************************************************************
  71.  * 4-pel Packed YUV block from/to an M-Motion Still Image file
  72.  ************************************************************/
  73. typedef struct _YUV
  74.     {
  75.     USHORT  YUVWord1;
  76.     USHORT  YUVWord2;
  77.     USHORT  YUVWord3;
  78.     } YUV;
  79. typedef YUV FAR *PYUV;
  80.  
  81. /***********************************************************
  82.  * A four-pel B, G, R ordered structure used for converting
  83.  *   between RGB and YUV
  84.  ***********************************************************/
  85. typedef struct _RGB4
  86.     {
  87.     BYTE    bB1;  /* Pel 1 */
  88.     BYTE    bG1;
  89.     BYTE    bR1;
  90.     BYTE    bB2;  /* Pel 2 */
  91.     BYTE    bG2;
  92.     BYTE    bR2;
  93.     BYTE    bB3;  /* Pel 3 */
  94.     BYTE    bG3;
  95.     BYTE    bR3;
  96.     BYTE    bB4;  /* Pel 4 */
  97.     BYTE    bG4;
  98.     BYTE    bR4;
  99.     } RGB4;
  100. typedef RGB4 FAR *PRGB4;
  101.  
  102. #define     MMOTION_HEADER_SIZE         sizeof (MMOTIONHEADER)
  103. #define     ONE_BLOCK                   6L
  104. #define     FOURCC_MMOT                 mmioFOURCC('M', 'M', 'O', 'T')
  105.  
  106. /* RC file defines */
  107. #define     HEX_FOURCC_MMOT             0x544F4D4DL
  108. #define     MMOTION_IOPROC_NAME_TABLE   7000
  109. #define     MMOTION_NLS_CHARSET_INFO    7500
  110.  
  111. #ifndef BITT_NONE
  112. #define BITT_NONE 0
  113. #define BI_NONE   0
  114. #endif
  115.  
  116. /**********************
  117.  * Function Declarations
  118.  **********************/
  119. LONG EXPENTRY IOProc_Entry (PVOID  pmmioStr, USHORT usMsg,
  120.                                    LONG   lParam1, LONG lParam2);
  121.  
  122. void GetYUV (PYUV pYuv, SHORT Y[], SHORT *U1, SHORT *V1);
  123. void YUVtoRGB (SHORT Y[], SHORT U1, SHORT V1, PBYTE lpYUVtoRGBBuf);
  124. void RGBtoYUV (SHORT YO[], SHORT *U1, SHORT *V1, PBYTE lpRGBBuf);
  125. void PutYUV (PBYTE lpTempBuf, SHORT YO[], SHORT U1, SHORT V1);
  126.  
  127. void InitFileStruct (PMMFILESTATUS);
  128.  
  129. ULONG RGBBytesToPels (ULONG, USHORT);
  130. ULONG PelsToRGBBytes (ULONG, USHORT);
  131.  
  132. void Convert1BitTo24Bit (PBYTE, PRGB, PRGB, ULONG);
  133. void Convert4BitTo24Bit (PBYTE, PRGB, PRGB, ULONG);
  134. void Convert8BitTo24Bit (PBYTE, PRGB, PRGB, ULONG);
  135.  
  136. void RGB2_To_RGB (PRGB2, PRGB, USHORT);
  137.  
  138. USHORT NumColors (USHORT);
  139.  
  140. void ConvertOneLineYUVtoRGB (PBYTE, PBYTE, ULONG);
  141. void ConvertOneLineRGBtoYUV (PBYTE, PBYTE, ULONG);
  142.  
  143. BOOL ImgBufferFlip (PBYTE, ULONG, ULONG);
  144. LONG ImgBytesToRGBBytes (LONG, USHORT);
  145.  
  146. LONG GetFormatString (LONG lSearchId,
  147.                       PSZ  pszFormatString,
  148.                       LONG lBytes);
  149.  
  150. LONG GetFormatStringLength (LONG  lSearchId,
  151.                             PLONG plNameLength);
  152.  
  153. ULONG APIENTRY GetNLSData (PULONG, PULONG);
  154.  
  155. #pragma pack()
  156.