Leaked source code of windows server 2003
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.

155 lines
7.4 KiB

  1. //***************************************************************************************************
  2. // COLMATCH.H
  3. //
  4. // Functions of color matching(C Header)
  5. //---------------------------------------------------------------------------------------------------
  6. // copyright(C) 1997-1999 CASIO COMPUTER CO.,LTD. / CASIO ELECTRONICS MANUFACTURING CO.,LTD.
  7. //***************************************************************************************************
  8. //---------------------------------------------------------------------------------------------------
  9. // Include Header file
  10. //---------------------------------------------------------------------------------------------------
  11. #include "COLORDEF.H"
  12. #include "N4DIZ.H"
  13. #include "N403DIZ.H"
  14. //---------------------------------------------------------------------------------------------------
  15. // Printer name
  16. //---------------------------------------------------------------------------------------------------
  17. #define PRN_N4 0
  18. #define PRN_N403 1
  19. //---------------------------------------------------------------------------------------------------
  20. // Data define
  21. //---------------------------------------------------------------------------------------------------
  22. #define No 0
  23. #define Yes 1
  24. #define XX_RES_300DPI 0
  25. #define XX_RES_600DPI 1
  26. #define XX_MONO 0
  27. #define XX_COLOR 1
  28. #define XX_COLOR_SINGLE 2
  29. #define XX_COLOR_MANY 3
  30. #define XX_DITHERING_OFF 0
  31. #define XX_DITHERING_ON 1
  32. #define XX_DITHERING_DET 2
  33. #define XX_DITHERING_PIC 3
  34. #define XX_DITHERING_GRA 4
  35. #define XX_DITHERING_CAR 5
  36. #define XX_DITHERING_GOSA 6
  37. #define XX_COLORMATCH_NONE 0
  38. #define XX_COLORMATCH_BRI 1
  39. #define XX_COLORMATCH_VIV 2
  40. #define XX_COLORMATCH_IRO 3
  41. #define XX_COLORMATCH_NORMAL 4
  42. #define XX_COLORMATCH_VIVCOL 5
  43. #define XX_COLORMATCH_NATCOL 6
  44. #define XX_BITFONT_OFF 0
  45. #define XX_BITFONT_ON 1
  46. #define XX_CMYBLACK_OFF 0
  47. #define XX_CMYBLACK_ON 1
  48. #define XX_COMPRESS_OFF 0
  49. #define XX_COMPRESS_AUTO 1
  50. #define XX_COMPRESS_RASTER 3
  51. #define WRITESPOOLBUF(p, s, n) \
  52. ((p)->pDrvProcs->DrvWriteSpoolBuf(p, s, n))
  53. #define PALETTE_SIZE 1
  54. #define BYTE_LENGTH(s) (sizeof (s) - 1)
  55. //===================================================================================================
  56. // Color matching structure
  57. //===================================================================================================
  58. typedef struct {
  59. WORD wReso; // Resolution
  60. WORD ColMon; // Color/Monochrome
  61. WORD DatBit; // Data bit(1:2value 2:4value 4:16value)
  62. WORD BytDot; // DPI (2value:8 4value:4 16value:2)
  63. struct { // Strcture for color matching
  64. WORD Mode; // Type of color matching
  65. WORD Viv; // Vividly?(For N4-612Printer)
  66. WORD KToner; // Gray color use black toner
  67. WORD LutNum; // LUT table No.
  68. WORD Diz; // Type od dithering
  69. SHORT Toner; // Toner density(-30�`30)
  70. WORD TnrNum; // Toner density table No.
  71. WORD CmyBlk; // Replace CMY by black toner
  72. WORD Speed; // 0:high 1:normal
  73. WORD Gos32; // GOSA?
  74. WORD PColor; // Original color?
  75. WORD SubDef; // Bright, contrast and gamma
  76. SHORT Bright; // bright
  77. SHORT Contrast; // contrast
  78. WORD GamRed; // Color balance(R)
  79. WORD GamGreen; // Color balance(G)
  80. WORD GamBlue; // Color balance(B)
  81. } Mch;
  82. union {
  83. struct {
  84. LPN4DIZINF lpDizInf; // Structure for control dithering and color-matching
  85. } N4;
  86. struct {
  87. LPN403DIZINF lpDizInf; // Structure for control dithering and color-matching
  88. } N403;
  89. };
  90. } DEVCOL, FAR *LPDEVCOL;
  91. //===================================================================================================
  92. // Bitmap buffer structure
  93. //===================================================================================================
  94. typedef struct {
  95. WORD Diz; // Method of dithering
  96. WORD Style; // Method of spooling
  97. WORD DatBit; // Databit(1:2value 2:4value 4:16value)
  98. struct {
  99. struct { // Member of RGB buffer(for 1 line)
  100. WORD AllWhite; // All data is white?
  101. DWORD Siz; // Size
  102. LPRGB Pnt; // Pointer
  103. } Rgb;
  104. struct { // Member of CMYK buffer(for 1 line)
  105. DWORD Siz; // Size
  106. LPCMYK Pnt; // Poiner
  107. } Cmyk;
  108. struct { // Member of CMYK(2/4/16value)bitmap buffer(maximum 64KB)
  109. DWORD Siz; // Size
  110. WORD BseLin; // The number of lines that require
  111. WORD Lin; // The number of lines that allocate
  112. LPBYTE Pnt[4]; // Pointer
  113. } Bit;
  114. } Drv;
  115. } BMPBIF, FAR* LPBMPBIF;
  116. //***************************************************************************************************
  117. // Functions
  118. //***************************************************************************************************
  119. //===================================================================================================
  120. // Initialize the members of color-matching
  121. //===================================================================================================
  122. BOOL FAR PASCAL ColMatchInit(PDEVOBJ);
  123. //===================================================================================================
  124. // DIB spools to the printer
  125. //===================================================================================================
  126. BOOL FAR PASCAL DIBtoPrn(PDEVOBJ, PBYTE, PBITMAPINFOHEADER, PBYTE, PIPPARAMS);
  127. //===================================================================================================
  128. // Convert RGB data into CMYK data
  129. //===================================================================================================
  130. BOOL FAR PASCAL StrColMatching(PDEVOBJ, WORD, LPRGB, LPCMYK);
  131. //===================================================================================================
  132. // Free dither table, toner density table , Lut table, N403DIZINF(N4DIZINF) structure buffer
  133. //===================================================================================================
  134. void FAR PASCAL DizLutTnrTblFree(PDEVOBJ);
  135. // End of File
  136.