Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.9 KiB

  1. // Copyright (C) Microsoft Corp. 1994
  2. /*==============================================================================
  3. The prototypes in this header file define an API for the Dcx Codec DLL.
  4. DATE NAME COMMENTS
  5. 13-Jan-94 RajeevD Parallel to faxcodec.h
  6. ==============================================================================*/
  7. #ifndef _INC_DCXCODEC
  8. #define _INC_DCXCODEC
  9. #include <faxcodec.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /*==============================================================================
  14. DcxCodecInit() initializes a context for a conversion. The client may pass a
  15. NULL context pointer to query for the exact size of the context, allocate the
  16. context memory, and call a second time to initialize.
  17. ==============================================================================*/
  18. UINT // returns size of context (0 on failure)
  19. WINAPI DcxCodecInit
  20. (
  21. LPVOID lpContext, // context pointer (or NULL on query)
  22. LPFC_PARAM lpParam // initialization parameters
  23. );
  24. /*==============================================================================
  25. DcxCodecConvert() executes the conversion specified in DcxCodecInit().
  26. In the input buffer, lpbBegData is advanced and uLengthData is decremented as
  27. data is consumed. If the caller wants to retain the input data, both must be
  28. saved and restored.
  29. In the output buffer, uLengthData is incremented as data is appended. If the
  30. output type is HRAW_DATA, an integral number of scan lines are produced.
  31. To flush any output data at the end of apage, pass a NULL input buffer.
  32. Returns when the input buffer is empty or the output buffer full.
  33. ==============================================================================*/
  34. FC_STATUS // returns status
  35. WINAPI DcxCodecConvert
  36. (
  37. LPVOID lpContext, // context pointer
  38. LPBUFFER lpbufIn, // input buffer (NULL at end of page)
  39. LPBUFFER lpbufOut // output buffer
  40. );
  41. #ifdef __cplusplus
  42. } // extern "C" {
  43. #endif
  44. #pragma pack (push)
  45. #pragma pack(1)
  46. // DCX file header
  47. typedef struct
  48. {
  49. DWORD dwSignature; // always set to DCX_SIG
  50. DWORD dwOffset[1024]; // array of page offsets
  51. }
  52. DCX_HDR;
  53. #define DCX_SIG 987654321L
  54. // PCX file header
  55. typedef struct
  56. {
  57. BYTE bSig; // signature: always 0Ah
  58. BYTE bVer; // version: at least 2
  59. BYTE bEnc; // encoding: always 1
  60. BYTE bBPP; // color depth [bpp]
  61. short xMin; // x minimum, inclusive
  62. short yMin; // y minimum, inclusive
  63. short xMax; // x maximum, inclusive
  64. short yMax; // y maximum, inclusive
  65. WORD xRes; // x resolution [dpi]
  66. WORD yRes; // y resolution [dpi]
  67. BYTE bPalette[48]; // color palette
  68. BYTE bReserved;
  69. BYTE bPlanes; // number of color planes
  70. WORD wHoriz;
  71. WORD wPalInfo; // palette info: always 1
  72. char bFill[58];
  73. }
  74. PCX_HDR;
  75. #pragma pack(pop)
  76. #endif // _INC_DCXCODEC