/binding/win32/gdipluscolormatrix.d

http://github.com/wilkie/djehuty · D · 100 lines · 43 code · 16 blank · 41 comment · 0 complexity · 0a25a9e5b5dcd7c2a8c704be2ec40b8f MD5 · raw file

  1. /*
  2. * gdipluscolormatrix.d
  3. *
  4. * This module implements GdiPlusColorMatrix.h for D. The original copyright
  5. * info is given below.
  6. *
  7. * Author: Dave Wilkinson
  8. * Originated: November 25th, 2009
  9. *
  10. */
  11. module binding.win32.gdipluscolormatrix;
  12. import binding.win32.windef;
  13. import binding.win32.winbase;
  14. import binding.win32.winnt;
  15. import binding.win32.guiddef;
  16. import binding.win32.gdipluscolor;
  17. import binding.win32.gdiplusimaging;
  18. import binding.win32.gdiplustypes;
  19. import binding.win32.gdiplusenums;
  20. import binding.win32.gdipluspixelformats;
  21. /**************************************************************************\
  22. *
  23. * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved.
  24. *
  25. * Module Name:
  26. *
  27. * GdiplusColorMatrix.h
  28. *
  29. * Abstract:
  30. *
  31. * GDI+ Color Matrix object, used with Graphics.DrawImage
  32. *
  33. \**************************************************************************/
  34. extern(System):
  35. //----------------------------------------------------------------------------
  36. // Color channel look up table (LUT)
  37. //----------------------------------------------------------------------------
  38. alias BYTE[256] ColorChannelLUT;
  39. //----------------------------------------------------------------------------
  40. // Per-channel Histogram for 8bpp images.
  41. //----------------------------------------------------------------------------
  42. enum HistogramFormat {
  43. HistogramFormatARGB,
  44. HistogramFormatPARGB,
  45. HistogramFormatRGB,
  46. HistogramFormatGray,
  47. HistogramFormatB,
  48. HistogramFormatG,
  49. HistogramFormatR,
  50. HistogramFormatA
  51. }
  52. //----------------------------------------------------------------------------
  53. // Color matrix
  54. //----------------------------------------------------------------------------
  55. struct ColorMatrix {
  56. REAL m[5][5] = [[1,0,0,0,0], [0,1,0,0,0], [0,0,1,0,0], [0,0,0,1,0], [0,0,0,0,1]];
  57. }
  58. //----------------------------------------------------------------------------
  59. // Color Matrix flags
  60. //----------------------------------------------------------------------------
  61. enum ColorMatrixFlags {
  62. ColorMatrixFlagsDefault = 0,
  63. ColorMatrixFlagsSkipGrays = 1,
  64. ColorMatrixFlagsAltGray = 2
  65. }
  66. //----------------------------------------------------------------------------
  67. // Color Adjust Type
  68. //----------------------------------------------------------------------------
  69. enum ColorAdjustType {
  70. ColorAdjustTypeDefault,
  71. ColorAdjustTypeBitmap,
  72. ColorAdjustTypeBrush,
  73. ColorAdjustTypePen,
  74. ColorAdjustTypeText,
  75. ColorAdjustTypeCount,
  76. ColorAdjustTypeAny // Reserved
  77. }
  78. //----------------------------------------------------------------------------
  79. // Color Map
  80. //----------------------------------------------------------------------------
  81. struct ColorMap {
  82. Color oldColor;
  83. Color newColor;
  84. }