/dmagick/c/composite.d

http://github.com/MikeWey/DMagick · D · 461 lines · 87 code · 75 blank · 299 comment · 0 complexity · c2e7f9c24d9f7c8d5301b0767d2f720c MD5 · raw file

  1. module dmagick.c.composite;
  2. import dmagick.c.image;
  3. import dmagick.c.magickType;
  4. alias ptrdiff_t ssize_t;
  5. extern(C)
  6. {
  7. /**
  8. * Select the image composition algorithm used to compose a
  9. * composite image with a image.
  10. */
  11. enum CompositeOperator
  12. {
  13. /** */
  14. UndefinedCompositeOp,
  15. /**
  16. * No composite operator has been specified.
  17. */
  18. NoCompositeOp,
  19. /**
  20. * The result of composite image + image,
  21. * with overflow wrapping around (mod 256).
  22. */
  23. ModulusAddCompositeOp,
  24. /**
  25. * The result is the same shape as image, with composite image
  26. * obscuring image where the image shapes overlap. Note that this
  27. * differs from OverCompositeOp because the portion of composite
  28. * image outside of image's shape does not appear in the result.
  29. */
  30. AtopCompositeOp,
  31. /**
  32. * Merges images together such that both images are treated
  33. * equally (being just added together), according to the percentage
  34. * arguments given.
  35. */
  36. BlendCompositeOp,
  37. /**
  38. * The result image shaded by composite image.
  39. */
  40. BumpmapCompositeOp,
  41. /**
  42. * Replace any destination pixel that is the similar to the source
  43. * image's pixel (as defined by the current fuzz factor),
  44. * with transparency.
  45. */
  46. ChangeMaskCompositeOp,
  47. /**
  48. * Make the target image transparent. The composite image is ignored.
  49. */
  50. ClearCompositeOp,
  51. /**
  52. * Darkens the destination color to reflect the source color.
  53. * Painting with white produces no change.
  54. */
  55. ColorBurnCompositeOp,
  56. /**
  57. * Brightens the destination color to reflect the source color.
  58. * Painting with black produces no change.
  59. */
  60. ColorDodgeCompositeOp,
  61. /**
  62. * Each pixel in the result image is the combination of the
  63. * brightness of the target image and the saturation and hue of the
  64. * composite image. This is the opposite of LuminizeCompositeOp.
  65. */
  66. ColorizeCompositeOp,
  67. /**
  68. * Copy the black channel from the composite image to the target image.
  69. */
  70. CopyBlackCompositeOp,
  71. /**
  72. * Copy the blue channel from the composite image to the target image.
  73. */
  74. CopyBlueCompositeOp,
  75. /**
  76. * Replace the target image with the composite image.
  77. */
  78. CopyCompositeOp,
  79. /**
  80. * Copy the cyan channel from the composite image to the target image.
  81. */
  82. CopyCyanCompositeOp,
  83. /**
  84. * Copy the green channel from the composite image to the target image.
  85. */
  86. CopyGreenCompositeOp,
  87. /**
  88. * Copy the magenta channel from the composite image to the target image.
  89. */
  90. CopyMagentaCompositeOp,
  91. /**
  92. * If the composite image's matte attribute is true, copy the
  93. * opacity channel from the composite image to the target image.
  94. * Otherwise, set the target image pixel's opacity to the intensity
  95. * of the corresponding pixel in the composite image.
  96. */
  97. CopyOpacityCompositeOp,
  98. /**
  99. * Copy the red channel from the composite image to the target image.
  100. */
  101. CopyRedCompositeOp,
  102. /**
  103. * Copy the yellow channel from the composite image to the target image.
  104. */
  105. CopyYellowCompositeOp,
  106. /**
  107. * Replace target image pixels with darker
  108. * pixels from the composite image.
  109. */
  110. DarkenCompositeOp,
  111. /**
  112. * The part of the destination lying inside of the source is
  113. * composited over the source and replaces the destination.
  114. */
  115. DstAtopCompositeOp,
  116. /**
  117. * The destination is left untouched.
  118. */
  119. DstCompositeOp,
  120. /**
  121. * The part of the destination lying inside of
  122. * the source replaces the destination.
  123. */
  124. DstInCompositeOp,
  125. /**
  126. * The part of the destination lying outside of
  127. * the source replaces the destination.
  128. */
  129. DstOutCompositeOp,
  130. /**
  131. * The destination is composited over the source
  132. * and the result replaces the destination.
  133. */
  134. DstOverCompositeOp,
  135. /**
  136. * The result of abs(composite image - image). This is useful
  137. * for comparing two very similar images.
  138. */
  139. DifferenceCompositeOp,
  140. /**
  141. * Displace target image pixels as defined by a displacement map.
  142. * The operator used by the displace method.
  143. */
  144. DisplaceCompositeOp,
  145. /**
  146. * The operator used in the dissolve method.
  147. */
  148. DissolveCompositeOp,
  149. /**
  150. * Produces an effect similar to that of 'difference', but appears
  151. * as lower contrast. Painting with white inverts the destination
  152. * color. Painting with black produces no change.
  153. */
  154. ExclusionCompositeOp,
  155. /**
  156. * Multiplies or screens the colors, dependent on the source color
  157. * value. If the source color is lighter than 0.5, the destination
  158. * is lightened as if it were screened. If the source color is darker
  159. * than 0.5, the destination is darkened, as if it were multiplied.
  160. * The degree of lightening or darkening is proportional to the
  161. * difference between the source color and 0.5. If it is equal to
  162. * 0.5 the destination is unchanged. Painting with pure black or
  163. * white produces black or white.
  164. */
  165. HardLightCompositeOp,
  166. /**
  167. * Each pixel in the result image is the combination of the hue of
  168. * the target image and the saturation and brightness of the
  169. * composite image.
  170. */
  171. HueCompositeOp,
  172. /**
  173. * The result is simply composite image cut by the shape of image.
  174. * None of the image data of image is included in the result.
  175. */
  176. InCompositeOp,
  177. /**
  178. * Replace target image pixels with lighter
  179. * pixels from the composite image.
  180. */
  181. LightenCompositeOp,
  182. /**
  183. * Increase contrast slightly with an impact on the foreground's
  184. * tonal values.
  185. */
  186. LinearLightCompositeOp,
  187. /**
  188. * Each pixel in the result image is the combination of the
  189. * brightness of the composite image and the saturation and hue
  190. * of the target image. This is the opposite of ColorizeCompositeOp.
  191. */
  192. LuminizeCompositeOp,
  193. /**
  194. * The result of composite image - image, with overflow cropped
  195. * to zero. The matte chanel is ignored (set to 255, full coverage).
  196. */
  197. MinusDstCompositeOp,
  198. /**
  199. * Used by the watermark method.
  200. */
  201. ModulateCompositeOp,
  202. /**
  203. * Multiplies the color of each target image pixel by the color
  204. * of the corresponding composite image pixel. The result color
  205. * is always darker.
  206. */
  207. MultiplyCompositeOp,
  208. /**
  209. * The resulting image is composite image
  210. * with the shape of image cut out.
  211. */
  212. OutCompositeOp,
  213. /**
  214. * The result is the union of the the two image shapes with composite
  215. * image obscuring image in the region of overlap. The matte channel
  216. * of the composite image is respected, so that if the composite
  217. * pixel is part or all transparent, the corresponding image pixel
  218. * will show through.
  219. */
  220. OverCompositeOp,
  221. /**
  222. * Multiplies or screens the colors, dependent on the destination
  223. * color. Source colors overlay the destination whilst preserving
  224. * its highlights and shadows. The destination color is not replaced,
  225. * but is mixed with the source color to reflect the lightness or
  226. * darkness of the destination.
  227. */
  228. OverlayCompositeOp,
  229. /**
  230. * The result is just the sum of the image data. Output values are
  231. * cropped to 255 (no overflow). This operation is independent of
  232. * the matte channels.
  233. */
  234. PlusCompositeOp,
  235. /**
  236. * The resulting image is image replaced with composite image.
  237. * Here the matte information is ignored.
  238. */
  239. ReplaceCompositeOp,
  240. /**
  241. * Each pixel in the result image is the combination of the
  242. * saturation of the target image and the hue and brightness
  243. * of the composite image.
  244. */
  245. SaturateCompositeOp,
  246. /**
  247. * Multiplies the inverse of each image's color information.
  248. */
  249. ScreenCompositeOp,
  250. /**
  251. * Darkens or lightens the colors, dependent on the source color
  252. * value. If the source color is lighter than 0.5, the destination
  253. * is lightened. If the source color is darker than 0.5, the
  254. * destination is darkened, as if it were burned in. The degree of
  255. * darkening or lightening is proportional to the difference between
  256. * the source color and 0.5. If it is equal to 0.5, the destination
  257. * is unchanged. Painting with pure black or white produces a
  258. * distinctly darker or lighter area, but does not result in pure
  259. * black or white.
  260. */
  261. SoftLightCompositeOp,
  262. /**
  263. * The part of the source lying inside of the destination is
  264. * composited onto the destination.
  265. */
  266. SrcAtopCompositeOp,
  267. /**
  268. * The source is copied to the destination.
  269. * The destination is not used as input.
  270. */
  271. SrcCompositeOp,
  272. /**
  273. * The part of the source lying inside of the destination
  274. * replaces the destination.
  275. */
  276. SrcInCompositeOp,
  277. /**
  278. * The part of the source lying outside of the destination
  279. * replaces the destination.
  280. */
  281. SrcOutCompositeOp,
  282. /**
  283. * The source is composited over the destination.
  284. */
  285. SrcOverCompositeOp,
  286. /**
  287. * The result of composite image - image, with underflow wrapping
  288. * around (mod 256). The add and subtract operators can be used to
  289. * perform reversable transformations.
  290. */
  291. ModulusSubtractCompositeOp,
  292. /** */
  293. ThresholdCompositeOp,
  294. /**
  295. * The result is the image data from both composite image and image
  296. * that is outside the overlap region. The overlap region will
  297. * be blank.
  298. */
  299. XorCompositeOp,
  300. /*
  301. * These are new operators, added after the above was last sorted.
  302. * The list should be re-sorted only when a new library version is
  303. * created.
  304. */
  305. /**
  306. * The two images are divided from each other, Src / Dest.
  307. */
  308. DivideDstCompositeOp,
  309. /**
  310. * Distort an image, using the given method
  311. * and its required arguments.
  312. */
  313. DistortCompositeOp,
  314. /**
  315. * Provides you with a method of replacing each individual pixel by
  316. * a Elliptical Gaussian Average (a blur) of the neighbouring pixels,
  317. * according to a mapping image.
  318. */
  319. BlurCompositeOp,
  320. /**
  321. * Almost equivalent to SoftLightCompositeOp, but using
  322. * a continuious mathematical formula rather than two conditionally
  323. * selected formulae.
  324. */
  325. PegtopLightCompositeOp,
  326. /**
  327. * A modified LinearLightCompositeOp designed to preserve very
  328. * stong primary and secondary colors in the image.
  329. */
  330. VividLightCompositeOp,
  331. /**
  332. * Similar to HardLightCompositeOp, but using sharp linear shadings,
  333. * to similate the effects of a strong 'pinhole' light source.
  334. */
  335. PinLightCompositeOp,
  336. /**
  337. * This is equivelent to PlusCompositeOp in that the color channels
  338. * are simply added, however it does not "plus" the alpha channel,
  339. * but uses the normal OverCompositeOp alpha blending, which
  340. * transparencies are involved. Produces a sort of additive
  341. * multiply-like result.
  342. */
  343. LinearDodgeCompositeOp,
  344. /**
  345. * Same as LinearDodgeCompositeOp, but also subtract one from the
  346. * result. Sort of a additive 'Screen' of the images
  347. */
  348. LinearBurnCompositeOp,
  349. /**
  350. * This composite method takes 4 numerical values to allow the user
  351. * to define many different Mathematical Compose Methods.
  352. */
  353. MathematicsCompositeOp,
  354. /**
  355. * The two images are divided from each other, Dest / Src.
  356. */
  357. DivideSrcCompositeOp,
  358. /**
  359. * The result of image - composite image, with overflow cropped
  360. * to zero. The matte chanel is ignored (set to 255, full coverage).
  361. */
  362. MinusSrcCompositeOp,
  363. /**
  364. * Compare the source and destination image color values and
  365. * take the darker value.
  366. */
  367. DarkenIntensityCompositeOp,
  368. /**
  369. * Compare the source and destination image color values and
  370. * take the lighter value.
  371. */
  372. LightenIntensityCompositeOp,
  373. /** */
  374. HardMixCompositeOp,
  375. /** */
  376. StereoCompositeOp,
  377. /* Depreciated (renamed) Method Names for backward compatibility */
  378. AddCompositeOp = ModulusAddCompositeOp,
  379. SubtractCompositeOp = ModulusSubtractCompositeOp,
  380. MinusCompositeOp = MinusDstCompositeOp,
  381. DivideCompositeOp = DivideDstCompositeOp
  382. }
  383. MagickBooleanType CompositeImage(Image*, const CompositeOperator, const(Image)*, const ssize_t, const ssize_t);
  384. MagickBooleanType CompositeImageChannel(Image*, const ChannelType, const CompositeOperator, const(Image)*, const ssize_t, const ssize_t);
  385. MagickBooleanType TextureImage(Image*, const(Image)*);
  386. }