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.

96 lines
3.3 KiB

  1. /*************************************************************************\
  2. * Module Name: engline.hxx
  3. *
  4. * Usefuls defines, macros and prototypes for line drawing.
  5. *
  6. * Created: 9-May-1991
  7. * Author: Paul Butzi
  8. *
  9. * Copyright (c) 1991-1999 Microsoft Corporation
  10. *
  11. \**************************************************************************/
  12. typedef ULONG CHUNK;
  13. typedef ULONG MASK;
  14. #define STYLE_MAX_COUNT 16
  15. #define STYLE_MAX_VALUE 0x3fffL
  16. #define RUN_MAX 20
  17. #define STRIP_MAX 100
  18. // For the ROP table:
  19. #define MIX_XOR_OFFSET 8
  20. #define AND_ZERO 0L
  21. #define AND_PEN 1L
  22. #define AND_NOTPEN 2L
  23. #define AND_ONE 3L
  24. #define XOR_ZERO (AND_ZERO << MIX_XOR_OFFSET)
  25. #define XOR_PEN (AND_PEN << MIX_XOR_OFFSET)
  26. #define XOR_NOTPEN (AND_NOTPEN << MIX_XOR_OFFSET)
  27. #define XOR_ONE (AND_ONE << MIX_XOR_OFFSET)
  28. // Some useful structures:
  29. typedef struct _BMINFO {
  30. MASK* pamask; // Pointer to array of start masks
  31. MASK* pamaskPel; // Pointer to array of pixel masks
  32. ULONG cPelsPerChunk; // # of pels per chunk (power of two)
  33. ULONG cBitsPerPel; // # of bits per pel
  34. LONG cShift; // log2(cPelsPerChunk)
  35. MASK maskPixel; // Pels per chunk - 1
  36. } BMINFO; /* bmi, pbmi */
  37. typedef struct _LINESTATE {
  38. CHUNK chAnd; // Color to be ANDed with the
  39. CHUNK chXor; // Color to be XORed
  40. ULONG ulStepRun;
  41. ULONG ulStepSide;
  42. ULONG ulStepDiag;
  43. STYLEPOS* pspStart; // Pointer to start of style array
  44. STYLEPOS* pspEnd; // Pointer to end of style array
  45. STYLEPOS* psp; // Pointer to current style entry
  46. STYLEPOS spRemaining; // To go in current style
  47. STYLEPOS spTotal; // Sum of style array
  48. STYLEPOS spTotal2; // Twice sum of style array
  49. STYLEPOS spNext; // Style state at start of next line
  50. STYLEPOS spComplex; // Style state at start of complex clip line
  51. STYLEPOS* aspRightToLeft; // Style array in right-to-left order
  52. STYLEPOS* aspLeftToRight; // Style array in left-to-right order
  53. BOOL bIsGap; // Are we working on a gap in the style?
  54. BOOL bStartGap; // Determines if first element in style
  55. // array is for a gap or a dash
  56. ULONG xStep;
  57. ULONG yStep;
  58. ULONG xyDensity;
  59. ULONG cStyle;
  60. } LINESTATE; /* ls, pls */
  61. typedef struct _STRIP {
  62. LONG cStrips; // # of strips in array
  63. FLONG flFlips; // Indicates if line goes up or down
  64. LONG lDelta; // Delta of CHUNKs between rows in bitmap
  65. CHUNK* pchScreen; // Points to the ULONG containing the 1st pixel
  66. LONG iPixel; // Pixel position in *pchScreen of 1st pixel
  67. LONG alStrips[STRIP_MAX]; // Array of strips
  68. } STRIP; /* strip, pstrip */
  69. typedef VOID (*PFNSTRIP)(STRIP*, BMINFO*, LINESTATE*);
  70. extern BOOL bLines(BMINFO*, POINTFIX*, POINTFIX*, RUN*, ULONG, LINESTATE*,
  71. RECTL*, PFNSTRIP*, FLONG, CHUNK*, LONG);
  72. extern BMINFO gabminfo[];
  73. extern PFNSTRIP gapfnStrip[];