ImageAttributes.jvm.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. using System;
  2. using System.Drawing;
  3. using System.Drawing.Drawing2D;
  4. namespace System.Drawing.Imaging
  5. {
  6. /// <summary>
  7. /// Summary description for ImageAttributes.
  8. /// </summary>
  9. ///
  10. [MonoTODO]
  11. public sealed class ImageAttributes : ICloneable, IDisposable
  12. {
  13. [MonoTODO]
  14. public ImageAttributes()
  15. {
  16. }
  17. public void Dispose()
  18. {
  19. }
  20. public Object Clone()
  21. {
  22. ImageAttributes imgAttr = new ImageAttributes();
  23. imgAttr.clrMatrix = clrMatrix;
  24. imgAttr.clrMatrixFlag = clrMatrixFlag;
  25. imgAttr.clrAdjustType = clrAdjustType;
  26. imgAttr.gMatrix = gMatrix;
  27. imgAttr.thresh = thresh;
  28. imgAttr.gamma = gamma;
  29. imgAttr.clrChannelFlags = clrChannelFlags;
  30. imgAttr.clrProfileFilename = clrProfileFilename;
  31. imgAttr.clrLow = clrLow;
  32. imgAttr.clrHigh = clrHigh;
  33. imgAttr.clrMap = clrMap;
  34. imgAttr.wrapMode = wrapMode;
  35. imgAttr.col = col;
  36. imgAttr.bClamp = bClamp;
  37. imgAttr.clrPalette = clrPalette;
  38. imgAttr.bNoOp = bNoOp;
  39. return imgAttr;
  40. }
  41. public void SetColorMatrix(ColorMatrix newColorMatrix)
  42. {
  43. SetColorMatrix(newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
  44. }
  45. public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag flags)
  46. {
  47. SetColorMatrix(newColorMatrix, flags, ColorAdjustType.Default);
  48. }
  49. public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
  50. {
  51. clrMatrix = newColorMatrix;
  52. clrMatrixFlag = mode;
  53. clrAdjustType = type;
  54. }
  55. public void ClearColorMatrix()
  56. {
  57. ClearColorMatrix(ColorAdjustType.Default);
  58. }
  59. public void ClearColorMatrix(ColorAdjustType type)
  60. {
  61. ColorMatrix cm = new ColorMatrix();
  62. clrMatrix = cm;
  63. clrAdjustType = type;
  64. }
  65. public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix)
  66. {
  67. SetColorMatrices(newColorMatrix, gMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
  68. }
  69. public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag flags)
  70. {
  71. SetColorMatrices(newColorMatrix, gMatrix, flags, ColorAdjustType.Default);
  72. }
  73. public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag mode, ColorAdjustType type)
  74. {
  75. clrMatrix = newColorMatrix;
  76. this.gMatrix = gMatrix;
  77. clrMatrixFlag = mode;
  78. clrAdjustType = type;
  79. }
  80. public void SetThreshold(float thresh)
  81. {
  82. SetThreshold(thresh, ColorAdjustType.Default);
  83. }
  84. public void SetThreshold(float thresh, ColorAdjustType type)
  85. {
  86. this.thresh = thresh;
  87. clrAdjustType = type;
  88. }
  89. public void ClearThreshold()
  90. {
  91. ClearThreshold(ColorAdjustType.Default);
  92. }
  93. public void ClearThreshold(ColorAdjustType type)
  94. {
  95. thresh = 1.0F;
  96. clrAdjustType = type;
  97. }
  98. public void SetGamma(float gamma)
  99. {
  100. SetGamma(gamma, ColorAdjustType.Default);
  101. }
  102. public void SetGamma(float gamma, ColorAdjustType type)
  103. {
  104. this.gamma = gamma;
  105. clrAdjustType = type;
  106. return;
  107. }
  108. public void ClearGamma()
  109. {
  110. ClearGamma(ColorAdjustType.Default);
  111. }
  112. public void ClearGamma(ColorAdjustType type)
  113. {
  114. gamma = 1;
  115. clrAdjustType = type;
  116. }
  117. public void SetNoOp()
  118. {
  119. SetNoOp(ColorAdjustType.Default);
  120. }
  121. public void SetNoOp(ColorAdjustType type)
  122. {
  123. bNoOp = true;
  124. clrAdjustType = type;
  125. }
  126. public void ClearNoOp()
  127. {
  128. ClearNoOp(ColorAdjustType.Default);
  129. }
  130. public void ClearNoOp(ColorAdjustType type)
  131. {
  132. bNoOp = false;
  133. clrAdjustType = type;
  134. }
  135. public void SetColorKey(Color clrLow, Color clrHigh)
  136. {
  137. SetColorKey(clrLow, clrHigh, ColorAdjustType.Default);
  138. }
  139. public void SetColorKey(Color clrLow, Color clrHigh, ColorAdjustType type)
  140. {
  141. this.clrLow = clrLow;
  142. this.clrHigh = clrHigh;
  143. clrAdjustType = type;
  144. }
  145. public void ClearColorKey()
  146. {
  147. ClearColorKey(ColorAdjustType.Default);
  148. }
  149. public void ClearColorKey(ColorAdjustType type)
  150. {
  151. clrAdjustType = type;
  152. }
  153. public void SetOutputChannel(ColorChannelFlag flags)
  154. {
  155. SetOutputChannel(flags, ColorAdjustType.Default);
  156. }
  157. public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)
  158. {
  159. clrChannelFlags = flags;
  160. clrAdjustType = type;
  161. }
  162. public void ClearOutputChannel()
  163. {
  164. ClearOutputChannel(ColorAdjustType.Default);
  165. }
  166. public void ClearOutputChannel(ColorAdjustType type)
  167. {
  168. clrAdjustType = type;
  169. }
  170. public void SetOutputChannelColorProfile(String clrProfileFilename)
  171. {
  172. SetOutputChannelColorProfile(clrProfileFilename, ColorAdjustType.Default);
  173. }
  174. public void SetOutputChannelColorProfile(String clrProfileFilename, ColorAdjustType type)
  175. {
  176. this.clrProfileFilename = clrProfileFilename;
  177. clrAdjustType = type;
  178. }
  179. public void ClearOutputChannelColorProfile()
  180. {
  181. ClearOutputChannel(ColorAdjustType.Default);
  182. }
  183. public void ClearOutputChannelColorProfile(ColorAdjustType type)
  184. {
  185. clrProfileFilename = null;
  186. clrAdjustType = type;
  187. }
  188. public void SetRemapTable(ColorMap[] map)
  189. {
  190. SetRemapTable(map, ColorAdjustType.Default);
  191. }
  192. public void SetRemapTable(ColorMap[] map, ColorAdjustType type)
  193. {
  194. clrMap = map;
  195. clrAdjustType = type;
  196. }
  197. public void ClearRemapTable()
  198. {
  199. ClearRemapTable(ColorAdjustType.Default);
  200. }
  201. public void ClearRemapTable(ColorAdjustType type)
  202. {
  203. clrMap = null;
  204. clrAdjustType = type;
  205. }
  206. public void SetBrushRemapTable(ColorMap []map)
  207. {
  208. SetRemapTable(map, ColorAdjustType.Brush);
  209. }
  210. public void ClearBrushRemapTable()
  211. {
  212. ClearRemapTable(ColorAdjustType.Brush);
  213. }
  214. public void SetWrapMode(WrapMode mode)
  215. {
  216. SetWrapMode(mode, new Color(), false);
  217. }
  218. public void SetWrapMode(WrapMode mode, Color clr)
  219. {
  220. SetWrapMode(mode, clr, false);
  221. }
  222. public void SetWrapMode(WrapMode mode, Color clr, bool bClamp)
  223. {
  224. wrapMode = mode;
  225. col = clr;
  226. this.bClamp = bClamp;
  227. }
  228. public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
  229. {
  230. clrPalette = palette;
  231. clrAdjustType = type;
  232. }
  233. public ColorMatrix clrMatrix;
  234. public ColorMatrixFlag clrMatrixFlag;
  235. public ColorAdjustType clrAdjustType;
  236. public ColorMatrix gMatrix;
  237. public float thresh;
  238. public float gamma;
  239. public ColorChannelFlag clrChannelFlags;
  240. public string clrProfileFilename;
  241. public Color clrLow;
  242. public Color clrHigh;
  243. public ColorMap[] clrMap;
  244. public WrapMode wrapMode;
  245. public Color col;
  246. public bool bClamp;
  247. public ColorPalette clrPalette;
  248. public bool bNoOp;
  249. }
  250. }