/dmagick/c/colorspace.d

http://github.com/MikeWey/DMagick · D · 231 lines · 60 code · 41 blank · 130 comment · 2 complexity · d54d6bc9c77ef17ec6ef788a9e403291 MD5 · raw file

  1. module dmagick.c.colorspace;
  2. import dmagick.c.exception;
  3. import dmagick.c.image;
  4. import dmagick.c.magickType;
  5. import dmagick.c.magickVersion;
  6. extern(C)
  7. {
  8. /**
  9. * Specify the colorspace that quantization (color reduction and mapping)
  10. * is done under or to specify the colorspace when encoding an output
  11. * image. Colorspaces are ways of describing colors to fit the
  12. * requirements of a particular application (e.g. Television, offset
  13. * printing, color monitors). Color reduction, by default, takes place
  14. * in the RGBColorspace. Empirical evidence suggests that distances in
  15. * color spaces such as YUVColorspace or YIQColorspace correspond to
  16. * perceptual color differences more closely than do distances in RGB
  17. * space. These color spaces may give better results when color reducing
  18. * an image.
  19. *
  20. * When encoding an output image, the colorspaces RGBColorspace,
  21. * CMYKColorspace, and GRAYColorspace may be specified. The
  22. * CMYKColorspace option is only applicable when writing TIFF, JPEG,
  23. * and Adobe Photoshop bitmap (PSD) files.
  24. */
  25. enum ColorspaceType
  26. {
  27. /**
  28. * No colorspace has been specified.
  29. */
  30. UndefinedColorspace,
  31. /**
  32. * Linear RGB colorspace
  33. */
  34. RGBColorspace,
  35. /**
  36. * Full-range grayscale
  37. */
  38. GRAYColorspace,
  39. /**
  40. * The Transparent color space behaves uniquely in that it preserves
  41. * the matte channel of the image if it exists.
  42. */
  43. TransparentColorspace,
  44. /**
  45. * Red-Green-Blue colorspace
  46. */
  47. OHTAColorspace,
  48. /**
  49. * ditto
  50. */
  51. LabColorspace,
  52. /**
  53. * CIE XYZ
  54. */
  55. XYZColorspace,
  56. /**
  57. * Kodak PhotoCD PhotoYCC
  58. */
  59. YCbCrColorspace,
  60. /**
  61. * ditto
  62. */
  63. YCCColorspace,
  64. /**
  65. * Y-signal, U-signal, and V-signal colorspace. YUV is most widely
  66. * used to encode color for use in television transmission.
  67. */
  68. YIQColorspace,
  69. /**
  70. * ditto
  71. */
  72. YPbPrColorspace,
  73. /**
  74. * ditto
  75. */
  76. YUVColorspace,
  77. /**
  78. * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
  79. * system used by printers and photographers for the rendering of
  80. * colors with ink or emulsion, normally on a white surface.
  81. */
  82. CMYKColorspace,
  83. /**
  84. * Kodak PhotoCD sRGB.
  85. */
  86. sRGBColorspace,
  87. /**
  88. * Hue, saturation, luminosity
  89. */
  90. HSBColorspace,
  91. /**
  92. * ditto
  93. */
  94. HSLColorspace,
  95. /**
  96. * Hue, whiteness, blackness
  97. */
  98. HWBColorspace,
  99. /**
  100. * Luma (Y) according to ITU-R 601
  101. */
  102. Rec601LumaColorspace,
  103. /**
  104. * YCbCr according to ITU-R 601
  105. */
  106. Rec601YCbCrColorspace,
  107. /**
  108. * Luma (Y) according to ITU-R 709
  109. */
  110. Rec709LumaColorspace,
  111. /**
  112. * YCbCr according to ITU-R 709
  113. */
  114. Rec709YCbCrColorspace,
  115. /**
  116. * Red-Green-Blue colorspace
  117. */
  118. LogColorspace,
  119. /**
  120. * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
  121. * system used by printers and photographers for the rendering of
  122. * colors with ink or emulsion, normally on a white surface.
  123. */
  124. CMYColorspace,
  125. /**
  126. * CIE 1976 (L*, u*, v*) color space.
  127. */
  128. LuvColorspace,
  129. /**
  130. * HCL is a color space that tries to combine the advantages of
  131. * perceptual uniformity of Luv, and the simplicity of specification
  132. * of HSV and HSL.
  133. */
  134. HCLColorspace,
  135. /** Alias for LCHuv. */
  136. LCHColorspace,
  137. /**
  138. * LMS is a color space represented by the response of the three types
  139. * of cones of the human eye, named after their responsivity
  140. * (sensitivity) at long, medium and short wavelengths.
  141. */
  142. LMSColorspace,
  143. /**
  144. * CIE 1976 cylindrical version of Lab.
  145. */
  146. LCHabColorspace,
  147. /**
  148. * CIE 1976 cylindrical version of Luv
  149. */
  150. LCHuvColorspace,
  151. /**
  152. * scRGB is a wide color gamut RGB (Red Green Blue) color space
  153. * created by Microsoft and HP that uses the same color primaries
  154. * and white/black points as the sRGB color space but allows
  155. * coordinates below zero and greater than one.
  156. */
  157. scRGBColorspace,
  158. /** */
  159. HSIColorspace,
  160. /* Alias for HSB. */
  161. HSVColorspace,
  162. /** */
  163. HCLpColorspace,
  164. /** */
  165. YDbDrColorspace,
  166. /**
  167. * In CIE xyY, Y is the luminance and x and y represents the chrominance
  168. * values derived from the tristimulus values X, Y and Z in the CIE XYZ
  169. * color space.
  170. */
  171. xyYColorspace,
  172. /**
  173. * A linear version ofGRAYColorspace.
  174. */
  175. LinearGRAYColorspace
  176. }
  177. static if ( MagickLibVersion >= 0x699 )
  178. {
  179. ColorspaceType GetImageColorspaceType(const(Image)* ,ExceptionInfo*);
  180. }
  181. MagickBooleanType RGBTransformImage(Image*, const ColorspaceType);
  182. MagickBooleanType SetImageColorspace(Image*, const ColorspaceType);
  183. static if ( MagickLibVersion >= 0x692 )
  184. {
  185. MagickBooleanType SetImageGray(Image*, ExceptionInfo*);
  186. MagickBooleanType SetImageMonochrome(Image*, ExceptionInfo*);
  187. }
  188. MagickBooleanType TransformImageColorspace(Image*, const ColorspaceType);
  189. MagickBooleanType TransformRGBImage(Image*, const ColorspaceType);
  190. }