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.

163 lines
3.6 KiB

  1. /**************************************************************************\
  2. *
  3. * Copyright (c) 1999 Microsoft Corporation
  4. *
  5. * Module Name:
  6. *
  7. * ImageAttr.hpp
  8. *
  9. * Abstract:
  10. *
  11. * ImageAttribute (recolor) related declarations
  12. *
  13. * Revision History:
  14. *
  15. * 14-Nov-1999 gilmanw
  16. * Created it.
  17. *
  18. \**************************************************************************/
  19. #ifndef _IMAGEATTR_HPP
  20. #define _IMAGEATTR_HPP
  21. class GpImageAttributes : public GpObject
  22. {
  23. protected:
  24. VOID SetValid(BOOL valid)
  25. {
  26. GpObject::SetValid(valid ? ObjectTagImageAttributes : ObjectTagInvalid);
  27. }
  28. public:
  29. GpImageAttributes();
  30. GpImageAttributes* Clone() const;
  31. VOID Dispose();
  32. GpLockable* GetObjectLock() const
  33. {
  34. return &Lockable;
  35. }
  36. // Set to identity, regardless of what the default color adjustment is.
  37. GpStatus
  38. SetToIdentity(
  39. ColorAdjustType type
  40. );
  41. // Remove any individual color adjustments, and go back to using the default
  42. GpStatus
  43. Reset(
  44. ColorAdjustType type
  45. );
  46. GpStatus
  47. SetColorMatrix(
  48. ColorAdjustType type,
  49. BOOL enable,
  50. ColorMatrix* colorMatrix,
  51. ColorMatrix* grayMatrix,
  52. ColorMatrixFlags flags);
  53. GpStatus
  54. SetThreshold(
  55. ColorAdjustType type,
  56. BOOL enable,
  57. REAL threshold);
  58. GpStatus
  59. SetGamma(
  60. ColorAdjustType type,
  61. BOOL enable,
  62. REAL gamma);
  63. GpStatus SetNoOp(
  64. ColorAdjustType type,
  65. BOOL enable);
  66. GpStatus
  67. SetColorKeys(
  68. ColorAdjustType type,
  69. BOOL enable,
  70. Color* colorLow,
  71. Color* colorHigh);
  72. GpStatus
  73. SetOutputChannel(
  74. ColorAdjustType type,
  75. BOOL enable,
  76. ColorChannelFlags channelFlags);
  77. GpStatus
  78. SetOutputChannelProfile(
  79. ColorAdjustType type,
  80. BOOL enable,
  81. WCHAR *profile);
  82. GpStatus
  83. SetRemapTable(
  84. ColorAdjustType type,
  85. BOOL enable,
  86. UINT mapSize,
  87. ColorMap* map);
  88. GpStatus
  89. SetCachedBackground(
  90. BOOL enableFlag);
  91. BOOL HasRecoloring(
  92. ColorAdjustType type = ColorAdjustTypeAny
  93. ) const;
  94. GpStatus SetWrapMode(WrapMode wrap, ARGB color = 0, BOOL Clamp = FALSE);
  95. GpStatus SetICMMode(BOOL on);
  96. VOID GetAdjustedPalette(
  97. ColorPalette * colorPalette,
  98. ColorAdjustType colorAdjustType
  99. );
  100. //----------------------------------------------------------------------
  101. // GpObject virtuals
  102. //----------------------------------------------------------------------
  103. virtual BOOL IsValid() const
  104. {
  105. // If the image attribtes came from a different version of GDI+, its tag
  106. // will not match, and it won't be considered valid.
  107. return ((recolor != NULL) && GpObject::IsValid(ObjectTagImageAttributes));
  108. }
  109. virtual ObjectType GetObjectType() const
  110. {
  111. return ObjectTypeImageAttributes;
  112. }
  113. // Serialization
  114. virtual UINT GetDataSize() const;
  115. virtual GpStatus GetData(IStream * stream) const;
  116. virtual GpStatus SetData(const BYTE * dataBuffer, UINT size);
  117. public:
  118. GpRecolor* recolor;
  119. // !!! should move this into the DpImageAttributes
  120. BOOL cachedBackground;
  121. // Contains DrawImage Wrap-Mode settings
  122. DpImageAttributes DeviceImageAttributes;
  123. protected:
  124. // Object lock
  125. mutable GpLockable Lockable;
  126. public:
  127. ~GpImageAttributes();
  128. };
  129. #endif