cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 | % % |
| 4 | % % |
| 5 | % % |
| 6 | % M M AAA GGGG IIIII CCCC K K % |
| 7 | % MM MM A A G I C K K % |
| 8 | % M M M AAAAA G GGG I C KKK % |
| 9 | % M M A A G G I C K K % |
| 10 | % M M A A GGGG IIIII CCCC K K % |
| 11 | % % |
| 12 | % IIIII M M AAA GGGG EEEEE % |
| 13 | % I MM MM A A G E % |
| 14 | % I M M M AAAAA G GG EEE % |
| 15 | % I M M A A G G E % |
| 16 | % IIIII M M A A GGGG EEEEE % |
| 17 | % % |
| 18 | % % |
| 19 | % MagickWand Image Methods % |
| 20 | % % |
| 21 | % Software Design % |
| 22 | % John Cristy % |
| 23 | % August 2003 % |
| 24 | % % |
| 25 | % % |
cristy | 7e41fe8 | 2010-12-04 23:12:08 +0000 | [diff] [blame] | 26 | % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 27 | % dedicated to making software imaging solutions freely available. % |
| 28 | % % |
| 29 | % You may not use this file except in compliance with the License. You may % |
| 30 | % obtain a copy of the License at % |
| 31 | % % |
| 32 | % http://www.imagemagick.org/script/license.php % |
| 33 | % % |
| 34 | % Unless required by applicable law or agreed to in writing, software % |
| 35 | % distributed under the License is distributed on an "AS IS" BASIS, % |
| 36 | % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % |
| 37 | % See the License for the specific language governing permissions and % |
| 38 | % limitations under the License. % |
| 39 | % % |
| 40 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 41 | % |
| 42 | % |
| 43 | % |
| 44 | */ |
| 45 | |
| 46 | /* |
| 47 | Include declarations. |
| 48 | */ |
| 49 | #include "wand/studio.h" |
| 50 | #include "wand/MagickWand.h" |
| 51 | #include "wand/magick-wand-private.h" |
| 52 | #include "wand/wand.h" |
| 53 | #include "wand/pixel-wand-private.h" |
| 54 | |
| 55 | /* |
| 56 | Define declarations. |
| 57 | */ |
| 58 | #define ThrowWandException(severity,tag,context) \ |
| 59 | { \ |
| 60 | (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \ |
| 61 | tag,"`%s'",context); \ |
| 62 | return(MagickFalse); \ |
| 63 | } |
| 64 | #define MagickWandId "MagickWand" |
| 65 | |
| 66 | /* |
| 67 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 68 | % % |
| 69 | % % |
| 70 | % % |
| 71 | + C l o n e M a g i c k W a n d F r o m I m a g e s % |
| 72 | % % |
| 73 | % % |
| 74 | % % |
| 75 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 76 | % |
| 77 | % CloneMagickWandFromImages() clones the magick wand and inserts a new image |
| 78 | % list. |
| 79 | % |
| 80 | % The format of the CloneMagickWandFromImages method is: |
| 81 | % |
| 82 | % MagickWand *CloneMagickWandFromImages(const MagickWand *wand, |
| 83 | % Image *images) |
| 84 | % |
| 85 | % A description of each parameter follows: |
| 86 | % |
| 87 | % o wand: the magick wand. |
| 88 | % |
| 89 | % o images: replace the image list with these image(s). |
| 90 | % |
| 91 | */ |
| 92 | static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, |
| 93 | Image *images) |
| 94 | { |
| 95 | MagickWand |
| 96 | *clone_wand; |
| 97 | |
| 98 | assert(wand != (MagickWand *) NULL); |
| 99 | assert(wand->signature == WandSignature); |
| 100 | if (wand->debug != MagickFalse) |
| 101 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
cristy | 73bd4a5 | 2010-10-05 11:24:23 +0000 | [diff] [blame] | 102 | clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 103 | if (clone_wand == (MagickWand *) NULL) |
| 104 | ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", |
| 105 | images->filename); |
| 106 | (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand)); |
| 107 | clone_wand->id=AcquireWandId(); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 108 | (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g", |
cristy | e8c25f9 | 2010-06-03 00:53:06 +0000 | [diff] [blame] | 109 | MagickWandId,(double) clone_wand->id); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 110 | clone_wand->exception=AcquireExceptionInfo(); |
| 111 | InheritException(clone_wand->exception,wand->exception); |
| 112 | clone_wand->image_info=CloneImageInfo(wand->image_info); |
| 113 | clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info); |
| 114 | clone_wand->images=images; |
| 115 | clone_wand->debug=IsEventLogging(); |
| 116 | if (clone_wand->debug != MagickFalse) |
| 117 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name); |
| 118 | clone_wand->signature=WandSignature; |
| 119 | return(clone_wand); |
| 120 | } |
| 121 | |
| 122 | /* |
| 123 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 124 | % % |
| 125 | % % |
| 126 | % % |
| 127 | % G e t I m a g e F r o m M a g i c k W a n d % |
| 128 | % % |
| 129 | % % |
| 130 | % % |
| 131 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 132 | % |
| 133 | % GetImageFromMagickWand() returns the current image from the magick wand. |
| 134 | % |
| 135 | % The format of the GetImageFromMagickWand method is: |
| 136 | % |
| 137 | % Image *GetImageFromMagickWand(const MagickWand *wand) |
| 138 | % |
| 139 | % A description of each parameter follows: |
| 140 | % |
| 141 | % o wand: the magick wand. |
| 142 | % |
| 143 | */ |
| 144 | WandExport Image *GetImageFromMagickWand(const MagickWand *wand) |
| 145 | { |
| 146 | assert(wand != (MagickWand *) NULL); |
| 147 | assert(wand->signature == WandSignature); |
| 148 | if (wand->debug != MagickFalse) |
| 149 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 150 | if (wand->images == (Image *) NULL) |
| 151 | { |
| 152 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 153 | "ContainsNoImages","`%s'",wand->name); |
| 154 | return((Image *) NULL); |
| 155 | } |
| 156 | return(wand->images); |
| 157 | } |
| 158 | |
| 159 | /* |
| 160 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 161 | % % |
| 162 | % % |
| 163 | % % |
| 164 | % M a g i c k A d a p t i v e S h a r p e n I m a g e % |
| 165 | % % |
| 166 | % % |
| 167 | % % |
| 168 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 169 | % |
| 170 | % MagickAdaptiveBlurImage() adaptively blurs the image by blurring |
| 171 | % less intensely near image edges and more intensely far from edges. We |
| 172 | % blur the image with a Gaussian operator of the given radius and standard |
| 173 | % deviation (sigma). For reasonable results, radius should be larger than |
| 174 | % sigma. Use a radius of 0 and MagickAdaptiveBlurImage() selects a |
| 175 | % suitable radius for you. |
| 176 | % |
| 177 | % The format of the MagickAdaptiveBlurImage method is: |
| 178 | % |
| 179 | % MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand, |
| 180 | % const double radius,const double sigma) |
| 181 | % MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand, |
| 182 | % const ChannelType channel,const double radius,const double sigma) |
| 183 | % |
| 184 | % A description of each parameter follows: |
| 185 | % |
| 186 | % o wand: the magick wand. |
| 187 | % |
| 188 | % o channel: the image channel(s). |
| 189 | % |
| 190 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 191 | % pixel. |
| 192 | % |
| 193 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 194 | % |
| 195 | */ |
| 196 | |
| 197 | WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand, |
| 198 | const double radius,const double sigma) |
| 199 | { |
| 200 | MagickBooleanType |
| 201 | status; |
| 202 | |
| 203 | status=MagickAdaptiveBlurImageChannel(wand,DefaultChannels,radius,sigma); |
| 204 | return(status); |
| 205 | } |
| 206 | |
| 207 | WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand, |
| 208 | const ChannelType channel,const double radius,const double sigma) |
| 209 | { |
| 210 | Image |
| 211 | *sharp_image; |
| 212 | |
| 213 | assert(wand != (MagickWand *) NULL); |
| 214 | assert(wand->signature == WandSignature); |
| 215 | if (wand->debug != MagickFalse) |
| 216 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 217 | if (wand->images == (Image *) NULL) |
| 218 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 219 | sharp_image=AdaptiveBlurImageChannel(wand->images,channel,radius,sigma, |
| 220 | wand->exception); |
| 221 | if (sharp_image == (Image *) NULL) |
| 222 | return(MagickFalse); |
| 223 | ReplaceImageInList(&wand->images,sharp_image); |
| 224 | return(MagickTrue); |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 229 | % % |
| 230 | % % |
| 231 | % % |
| 232 | % M a g i c k A d a p t i v e R e s i z e I m a g e % |
| 233 | % % |
| 234 | % % |
| 235 | % % |
| 236 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 237 | % |
| 238 | % MagickAdaptiveResizeImage() adaptively resize image with data dependent |
| 239 | % triangulation. |
| 240 | % |
| 241 | % MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 242 | % const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 243 | % |
| 244 | % A description of each parameter follows: |
| 245 | % |
| 246 | % o wand: the magick wand. |
| 247 | % |
| 248 | % o columns: the number of columns in the scaled image. |
| 249 | % |
| 250 | % o rows: the number of rows in the scaled image. |
| 251 | % |
| 252 | */ |
| 253 | WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 254 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 255 | { |
| 256 | Image |
| 257 | *resize_image; |
| 258 | |
| 259 | assert(wand != (MagickWand *) NULL); |
| 260 | assert(wand->signature == WandSignature); |
| 261 | if (wand->debug != MagickFalse) |
| 262 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 263 | if (wand->images == (Image *) NULL) |
| 264 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 265 | resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception); |
| 266 | if (resize_image == (Image *) NULL) |
| 267 | return(MagickFalse); |
| 268 | ReplaceImageInList(&wand->images,resize_image); |
| 269 | return(MagickTrue); |
| 270 | } |
| 271 | |
| 272 | /* |
| 273 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 274 | % % |
| 275 | % % |
| 276 | % % |
| 277 | % M a g i c k A d a p t i v e S h a r p e n I m a g e % |
| 278 | % % |
| 279 | % % |
| 280 | % % |
| 281 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 282 | % |
| 283 | % MagickAdaptiveSharpenImage() adaptively sharpens the image by sharpening |
| 284 | % more intensely near image edges and less intensely far from edges. We |
| 285 | % sharpen the image with a Gaussian operator of the given radius and standard |
| 286 | % deviation (sigma). For reasonable results, radius should be larger than |
| 287 | % sigma. Use a radius of 0 and MagickAdaptiveSharpenImage() selects a |
| 288 | % suitable radius for you. |
| 289 | % |
| 290 | % The format of the MagickAdaptiveSharpenImage method is: |
| 291 | % |
| 292 | % MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand, |
| 293 | % const double radius,const double sigma) |
| 294 | % MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, |
| 295 | % const ChannelType channel,const double radius,const double sigma) |
| 296 | % |
| 297 | % A description of each parameter follows: |
| 298 | % |
| 299 | % o wand: the magick wand. |
| 300 | % |
| 301 | % o channel: the image channel(s). |
| 302 | % |
| 303 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 304 | % pixel. |
| 305 | % |
| 306 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 307 | % |
| 308 | */ |
| 309 | |
| 310 | WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand, |
| 311 | const double radius,const double sigma) |
| 312 | { |
| 313 | MagickBooleanType |
| 314 | status; |
| 315 | |
| 316 | status=MagickAdaptiveSharpenImageChannel(wand,DefaultChannels,radius,sigma); |
| 317 | return(status); |
| 318 | } |
| 319 | |
| 320 | WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, |
| 321 | const ChannelType channel,const double radius,const double sigma) |
| 322 | { |
| 323 | Image |
| 324 | *sharp_image; |
| 325 | |
| 326 | assert(wand != (MagickWand *) NULL); |
| 327 | assert(wand->signature == WandSignature); |
| 328 | if (wand->debug != MagickFalse) |
| 329 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 330 | if (wand->images == (Image *) NULL) |
| 331 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 332 | sharp_image=AdaptiveSharpenImageChannel(wand->images,channel,radius,sigma, |
| 333 | wand->exception); |
| 334 | if (sharp_image == (Image *) NULL) |
| 335 | return(MagickFalse); |
| 336 | ReplaceImageInList(&wand->images,sharp_image); |
| 337 | return(MagickTrue); |
| 338 | } |
| 339 | |
| 340 | /* |
| 341 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 342 | % % |
| 343 | % % |
| 344 | % % |
| 345 | % M a g i c k A d a p t i v e T h r e s h o l d I m a g e % |
| 346 | % % |
| 347 | % % |
| 348 | % % |
| 349 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 350 | % |
| 351 | % MagickAdaptiveThresholdImage() selects an individual threshold for each pixel |
| 352 | % based on the range of intensity values in its local neighborhood. This |
| 353 | % allows for thresholding of an image whose global intensity histogram |
| 354 | % doesn't contain distinctive peaks. |
| 355 | % |
| 356 | % The format of the AdaptiveThresholdImage method is: |
| 357 | % |
| 358 | % MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 359 | % const size_t width,const size_t height,const ssize_t offset) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 360 | % |
| 361 | % A description of each parameter follows: |
| 362 | % |
| 363 | % o wand: the magick wand. |
| 364 | % |
| 365 | % o width: the width of the local neighborhood. |
| 366 | % |
| 367 | % o height: the height of the local neighborhood. |
| 368 | % |
| 369 | % o offset: the mean offset. |
| 370 | % |
| 371 | */ |
| 372 | WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 373 | const size_t width,const size_t height,const ssize_t offset) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 374 | { |
| 375 | Image |
| 376 | *threshold_image; |
| 377 | |
| 378 | assert(wand != (MagickWand *) NULL); |
| 379 | assert(wand->signature == WandSignature); |
| 380 | if (wand->debug != MagickFalse) |
| 381 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 382 | if (wand->images == (Image *) NULL) |
| 383 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 384 | threshold_image=AdaptiveThresholdImage(wand->images,width,height,offset, |
| 385 | wand->exception); |
| 386 | if (threshold_image == (Image *) NULL) |
| 387 | return(MagickFalse); |
| 388 | ReplaceImageInList(&wand->images,threshold_image); |
| 389 | return(MagickTrue); |
| 390 | } |
| 391 | |
| 392 | /* |
| 393 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 394 | % % |
| 395 | % % |
| 396 | % % |
| 397 | % M a g i c k A d d I m a g e % |
| 398 | % % |
| 399 | % % |
| 400 | % % |
| 401 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 402 | % |
| 403 | % MagickAddImage() adds the specified images at the current image location. |
| 404 | % |
| 405 | % The format of the MagickAddImage method is: |
| 406 | % |
| 407 | % MagickBooleanType MagickAddImage(MagickWand *wand, |
| 408 | % const MagickWand *add_wand) |
| 409 | % |
| 410 | % A description of each parameter follows: |
| 411 | % |
| 412 | % o wand: the magick wand. |
| 413 | % |
| 414 | % o add_wand: A wand that contains images to add at the current image |
| 415 | % location. |
| 416 | % |
| 417 | */ |
| 418 | |
| 419 | static inline MagickBooleanType InsertImageInWand(MagickWand *wand, |
| 420 | Image *images) |
| 421 | { |
| 422 | Image |
| 423 | *sentinel; |
| 424 | |
| 425 | sentinel=wand->images; |
| 426 | if (sentinel == (Image *) NULL) |
| 427 | { |
| 428 | wand->images=GetFirstImageInList(images); |
| 429 | return(MagickTrue); |
| 430 | } |
| 431 | if (wand->active == MagickFalse) |
| 432 | { |
| 433 | if ((wand->pend != MagickFalse) && (sentinel->next == (Image *) NULL)) |
| 434 | { |
| 435 | AppendImageToList(&sentinel,images); |
| 436 | wand->images=GetLastImageInList(images); |
| 437 | return(MagickTrue); |
| 438 | } |
| 439 | if ((wand->pend != MagickFalse) && (sentinel->previous == (Image *) NULL)) |
| 440 | { |
| 441 | PrependImageToList(&sentinel,images); |
| 442 | wand->images=GetFirstImageInList(images); |
| 443 | return(MagickTrue); |
| 444 | } |
| 445 | } |
cristy | 2e74b0f | 2010-09-01 19:42:26 +0000 | [diff] [blame] | 446 | if (sentinel->next == (Image *) NULL) |
| 447 | { |
| 448 | InsertImageInList(&sentinel,images); |
| 449 | wand->images=GetLastImageInList(images); |
| 450 | return(MagickTrue); |
| 451 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 452 | InsertImageInList(&sentinel,images); |
| 453 | wand->images=GetFirstImageInList(images); |
| 454 | return(MagickTrue); |
| 455 | } |
| 456 | |
| 457 | WandExport MagickBooleanType MagickAddImage(MagickWand *wand, |
| 458 | const MagickWand *add_wand) |
| 459 | { |
| 460 | Image |
| 461 | *images; |
| 462 | |
| 463 | assert(wand != (MagickWand *) NULL); |
| 464 | assert(wand->signature == WandSignature); |
| 465 | if (wand->debug != MagickFalse) |
| 466 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 467 | assert(add_wand != (MagickWand *) NULL); |
| 468 | assert(add_wand->signature == WandSignature); |
| 469 | if (add_wand->images == (Image *) NULL) |
| 470 | ThrowWandException(WandError,"ContainsNoImages",add_wand->name); |
| 471 | images=CloneImageList(add_wand->images,wand->exception); |
| 472 | if (images == (Image *) NULL) |
| 473 | return(MagickFalse); |
| 474 | return(InsertImageInWand(wand,images)); |
| 475 | } |
| 476 | |
| 477 | /* |
| 478 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 479 | % % |
| 480 | % % |
| 481 | % % |
| 482 | % M a g i c k A d d N o i s e I m a g e % |
| 483 | % % |
| 484 | % % |
| 485 | % % |
| 486 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 487 | % |
| 488 | % MagickAddNoiseImage() adds random noise to the image. |
| 489 | % |
| 490 | % The format of the MagickAddNoiseImage method is: |
| 491 | % |
| 492 | % MagickBooleanType MagickAddNoiseImage(MagickWand *wand, |
| 493 | % const NoiseType noise_type) |
| 494 | % MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand, |
| 495 | % const ChannelType channel,const NoiseType noise_type) |
| 496 | % |
| 497 | % A description of each parameter follows: |
| 498 | % |
| 499 | % o wand: the magick wand. |
| 500 | % |
| 501 | % o channel: the image channel(s). |
| 502 | % |
| 503 | % o noise_type: The type of noise: Uniform, Gaussian, Multiplicative, |
| 504 | % Impulse, Laplacian, or Poisson. |
| 505 | % |
| 506 | */ |
| 507 | |
| 508 | WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand, |
| 509 | const NoiseType noise_type) |
| 510 | { |
| 511 | MagickBooleanType |
| 512 | status; |
| 513 | |
| 514 | status=MagickAddNoiseImageChannel(wand,DefaultChannels,noise_type); |
| 515 | return(status); |
| 516 | } |
| 517 | |
| 518 | WandExport MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand, |
| 519 | const ChannelType channel,const NoiseType noise_type) |
| 520 | { |
| 521 | Image |
| 522 | *noise_image; |
| 523 | |
| 524 | assert(wand != (MagickWand *) NULL); |
| 525 | assert(wand->signature == WandSignature); |
| 526 | if (wand->debug != MagickFalse) |
| 527 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 528 | if (wand->images == (Image *) NULL) |
| 529 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 530 | noise_image=AddNoiseImageChannel(wand->images,channel,noise_type, |
| 531 | wand->exception); |
| 532 | if (noise_image == (Image *) NULL) |
| 533 | return(MagickFalse); |
| 534 | ReplaceImageInList(&wand->images,noise_image); |
| 535 | return(MagickTrue); |
| 536 | } |
| 537 | |
| 538 | /* |
| 539 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 540 | % % |
| 541 | % % |
| 542 | % % |
| 543 | % M a g i c k A f f i n e T r a n s f o r m I m a g e % |
| 544 | % % |
| 545 | % % |
| 546 | % % |
| 547 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 548 | % |
| 549 | % MagickAffineTransformImage() transforms an image as dictated by the affine |
| 550 | % matrix of the drawing wand. |
| 551 | % |
| 552 | % The format of the MagickAffineTransformImage method is: |
| 553 | % |
| 554 | % MagickBooleanType MagickAffineTransformImage(MagickWand *wand, |
| 555 | % const DrawingWand *drawing_wand) |
| 556 | % |
| 557 | % A description of each parameter follows: |
| 558 | % |
| 559 | % o wand: the magick wand. |
| 560 | % |
| 561 | % o drawing_wand: the draw wand. |
| 562 | % |
| 563 | */ |
| 564 | WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand, |
| 565 | const DrawingWand *drawing_wand) |
| 566 | { |
| 567 | DrawInfo |
| 568 | *draw_info; |
| 569 | |
| 570 | Image |
| 571 | *affine_image; |
| 572 | |
| 573 | assert(wand != (MagickWand *) NULL); |
| 574 | assert(wand->signature == WandSignature); |
| 575 | if (wand->debug != MagickFalse) |
| 576 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 577 | if (wand->images == (Image *) NULL) |
| 578 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 579 | draw_info=PeekDrawingWand(drawing_wand); |
| 580 | if (draw_info == (DrawInfo *) NULL) |
| 581 | return(MagickFalse); |
| 582 | affine_image=AffineTransformImage(wand->images,&draw_info->affine, |
| 583 | wand->exception); |
| 584 | draw_info=DestroyDrawInfo(draw_info); |
| 585 | if (affine_image == (Image *) NULL) |
| 586 | return(MagickFalse); |
| 587 | ReplaceImageInList(&wand->images,affine_image); |
| 588 | return(MagickTrue); |
| 589 | } |
| 590 | |
| 591 | /* |
| 592 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 593 | % % |
| 594 | % % |
| 595 | % % |
| 596 | % M a g i c k A n n o t a t e I m a g e % |
| 597 | % % |
| 598 | % % |
| 599 | % % |
| 600 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 601 | % |
| 602 | % MagickAnnotateImage() annotates an image with text. |
| 603 | % |
| 604 | % The format of the MagickAnnotateImage method is: |
| 605 | % |
| 606 | % MagickBooleanType MagickAnnotateImage(MagickWand *wand, |
| 607 | % const DrawingWand *drawing_wand,const double x,const double y, |
| 608 | % const double angle,const char *text) |
| 609 | % |
| 610 | % A description of each parameter follows: |
| 611 | % |
| 612 | % o wand: the magick wand. |
| 613 | % |
| 614 | % o drawing_wand: the draw wand. |
| 615 | % |
| 616 | % o x: x ordinate to left of text |
| 617 | % |
| 618 | % o y: y ordinate to text baseline |
| 619 | % |
| 620 | % o angle: rotate text relative to this angle. |
| 621 | % |
| 622 | % o text: text to draw |
| 623 | % |
| 624 | */ |
| 625 | WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand, |
| 626 | const DrawingWand *drawing_wand,const double x,const double y, |
| 627 | const double angle,const char *text) |
| 628 | { |
| 629 | char |
| 630 | geometry[MaxTextExtent]; |
| 631 | |
| 632 | DrawInfo |
| 633 | *draw_info; |
| 634 | |
| 635 | MagickBooleanType |
| 636 | status; |
| 637 | |
| 638 | assert(wand != (MagickWand *) NULL); |
| 639 | assert(wand->signature == WandSignature); |
| 640 | if (wand->debug != MagickFalse) |
| 641 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 642 | if (wand->images == (Image *) NULL) |
| 643 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 644 | draw_info=PeekDrawingWand(drawing_wand); |
| 645 | if (draw_info == (DrawInfo *) NULL) |
| 646 | return(MagickFalse); |
| 647 | (void) CloneString(&draw_info->text,text); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 648 | (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",x,y); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 649 | draw_info->affine.sx=cos(DegreesToRadians(fmod(angle,360.0))); |
| 650 | draw_info->affine.rx=sin(DegreesToRadians(fmod(angle,360.0))); |
| 651 | draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0)))); |
| 652 | draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0))); |
| 653 | (void) CloneString(&draw_info->geometry,geometry); |
| 654 | status=AnnotateImage(wand->images,draw_info); |
| 655 | draw_info=DestroyDrawInfo(draw_info); |
| 656 | if (status == MagickFalse) |
| 657 | InheritException(wand->exception,&wand->images->exception); |
| 658 | return(status); |
| 659 | } |
| 660 | |
| 661 | /* |
| 662 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 663 | % % |
| 664 | % % |
| 665 | % % |
| 666 | % M a g i c k A n i m a t e I m a g e s % |
| 667 | % % |
| 668 | % % |
| 669 | % % |
| 670 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 671 | % |
| 672 | % MagickAnimateImages() animates an image or image sequence. |
| 673 | % |
| 674 | % The format of the MagickAnimateImages method is: |
| 675 | % |
| 676 | % MagickBooleanType MagickAnimateImages(MagickWand *wand, |
| 677 | % const char *server_name) |
| 678 | % |
| 679 | % A description of each parameter follows: |
| 680 | % |
| 681 | % o wand: the magick wand. |
| 682 | % |
| 683 | % o server_name: the X server name. |
| 684 | % |
| 685 | */ |
| 686 | WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand, |
| 687 | const char *server_name) |
| 688 | { |
| 689 | MagickBooleanType |
| 690 | status; |
| 691 | |
| 692 | assert(wand != (MagickWand *) NULL); |
| 693 | assert(wand->signature == WandSignature); |
| 694 | if (wand->debug != MagickFalse) |
| 695 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 696 | (void) CloneString(&wand->image_info->server_name,server_name); |
| 697 | status=AnimateImages(wand->image_info,wand->images); |
| 698 | if (status == MagickFalse) |
| 699 | InheritException(wand->exception,&wand->images->exception); |
| 700 | return(status); |
| 701 | } |
| 702 | |
| 703 | /* |
| 704 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 705 | % % |
| 706 | % % |
| 707 | % % |
| 708 | % M a g i c k A p p e n d I m a g e s % |
| 709 | % % |
| 710 | % % |
| 711 | % % |
| 712 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 713 | % |
| 714 | % MagickAppendImages() append a set of images. |
| 715 | % |
| 716 | % The format of the MagickAppendImages method is: |
| 717 | % |
| 718 | % MagickWand *MagickAppendImages(MagickWand *wand, |
| 719 | % const MagickBooleanType stack) |
| 720 | % |
| 721 | % A description of each parameter follows: |
| 722 | % |
| 723 | % o wand: the magick wand. |
| 724 | % |
| 725 | % o stack: By default, images are stacked left-to-right. Set stack to |
| 726 | % MagickTrue to stack them top-to-bottom. |
| 727 | % |
| 728 | */ |
| 729 | WandExport MagickWand *MagickAppendImages(MagickWand *wand, |
| 730 | const MagickBooleanType stack) |
| 731 | { |
| 732 | Image |
| 733 | *append_image; |
| 734 | |
| 735 | assert(wand != (MagickWand *) NULL); |
| 736 | assert(wand->signature == WandSignature); |
| 737 | if (wand->debug != MagickFalse) |
| 738 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 739 | if (wand->images == (Image *) NULL) |
| 740 | return((MagickWand *) NULL); |
| 741 | append_image=AppendImages(wand->images,stack,wand->exception); |
| 742 | if (append_image == (Image *) NULL) |
| 743 | return((MagickWand *) NULL); |
| 744 | return(CloneMagickWandFromImages(wand,append_image)); |
| 745 | } |
| 746 | |
| 747 | /* |
| 748 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 749 | % % |
| 750 | % % |
| 751 | % % |
| 752 | % M a g i c k A u t o G a m m a I m a g e % |
| 753 | % % |
| 754 | % % |
| 755 | % % |
| 756 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 757 | % |
| 758 | % MagickAutoGammaImage() extracts the 'mean' from the image and adjust the |
| 759 | % image to try make set its gamma appropriatally. |
| 760 | % |
| 761 | % The format of the MagickAutoGammaImage method is: |
| 762 | % |
| 763 | % MagickBooleanType MagickAutoGammaImage(MagickWand *wand) |
| 764 | % MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, |
| 765 | % const ChannelType channel) |
| 766 | % |
| 767 | % A description of each parameter follows: |
| 768 | % |
| 769 | % o wand: the magick wand. |
| 770 | % |
| 771 | % o channel: the image channel(s). |
| 772 | % |
| 773 | */ |
| 774 | WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand) |
| 775 | { |
| 776 | MagickBooleanType |
| 777 | status; |
| 778 | |
| 779 | status=MagickAutoGammaImageChannel(wand,DefaultChannels); |
| 780 | return(status); |
| 781 | } |
| 782 | |
| 783 | WandExport MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, |
| 784 | const ChannelType channel) |
| 785 | { |
| 786 | MagickBooleanType |
| 787 | status; |
| 788 | |
| 789 | assert(wand != (MagickWand *) NULL); |
| 790 | assert(wand->signature == WandSignature); |
| 791 | if (wand->debug != MagickFalse) |
| 792 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 793 | if (wand->images == (Image *) NULL) |
| 794 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 795 | status=AutoGammaImageChannel(wand->images,channel); |
| 796 | if (status == MagickFalse) |
| 797 | InheritException(wand->exception,&wand->images->exception); |
| 798 | return(status); |
| 799 | } |
| 800 | |
| 801 | /* |
| 802 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 803 | % % |
| 804 | % % |
| 805 | % % |
| 806 | % M a g i c k A u t o L e v e l I m a g e % |
| 807 | % % |
| 808 | % % |
| 809 | % % |
| 810 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 811 | % |
| 812 | % MagickAutoLevelImage() adjusts the levels of a particular image channel by |
| 813 | % scaling the minimum and maximum values to the full quantum range. |
| 814 | % |
| 815 | % The format of the MagickAutoLevelImage method is: |
| 816 | % |
| 817 | % MagickBooleanType MagickAutoLevelImage(MagickWand *wand) |
| 818 | % MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, |
| 819 | % const ChannelType channel) |
| 820 | % |
| 821 | % A description of each parameter follows: |
| 822 | % |
| 823 | % o wand: the magick wand. |
| 824 | % |
| 825 | % o channel: the image channel(s). |
| 826 | % |
| 827 | */ |
| 828 | WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand) |
| 829 | { |
| 830 | MagickBooleanType |
| 831 | status; |
| 832 | |
| 833 | status=MagickAutoLevelImageChannel(wand,DefaultChannels); |
| 834 | return(status); |
| 835 | } |
| 836 | |
| 837 | WandExport MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, |
| 838 | const ChannelType channel) |
| 839 | { |
| 840 | MagickBooleanType |
| 841 | status; |
| 842 | |
| 843 | assert(wand != (MagickWand *) NULL); |
| 844 | assert(wand->signature == WandSignature); |
| 845 | if (wand->debug != MagickFalse) |
| 846 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 847 | if (wand->images == (Image *) NULL) |
| 848 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 849 | status=AutoLevelImageChannel(wand->images,channel); |
| 850 | if (status == MagickFalse) |
| 851 | InheritException(wand->exception,&wand->images->exception); |
| 852 | return(status); |
| 853 | } |
| 854 | |
| 855 | /* |
| 856 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 857 | % % |
| 858 | % % |
| 859 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 860 | % M a g i c k B l a c k T h r e s h o l d I m a g e % |
| 861 | % % |
| 862 | % % |
| 863 | % % |
| 864 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 865 | % |
| 866 | % MagickBlackThresholdImage() is like MagickThresholdImage() but forces all |
| 867 | % pixels below the threshold into black while leaving all pixels above the |
| 868 | % threshold unchanged. |
| 869 | % |
| 870 | % The format of the MagickBlackThresholdImage method is: |
| 871 | % |
| 872 | % MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, |
| 873 | % const PixelWand *threshold) |
| 874 | % |
| 875 | % A description of each parameter follows: |
| 876 | % |
| 877 | % o wand: the magick wand. |
| 878 | % |
| 879 | % o threshold: the pixel wand. |
| 880 | % |
| 881 | */ |
| 882 | WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, |
| 883 | const PixelWand *threshold) |
| 884 | { |
| 885 | char |
| 886 | thresholds[MaxTextExtent]; |
| 887 | |
| 888 | MagickBooleanType |
| 889 | status; |
| 890 | |
| 891 | assert(wand != (MagickWand *) NULL); |
| 892 | assert(wand->signature == WandSignature); |
| 893 | if (wand->debug != MagickFalse) |
| 894 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 895 | if (wand->images == (Image *) NULL) |
| 896 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 897 | (void) FormatLocaleString(thresholds,MaxTextExtent, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 898 | QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, |
| 899 | PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), |
| 900 | PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold)); |
| 901 | status=BlackThresholdImage(wand->images,thresholds); |
| 902 | if (status == MagickFalse) |
| 903 | InheritException(wand->exception,&wand->images->exception); |
| 904 | return(status); |
| 905 | } |
| 906 | |
| 907 | /* |
| 908 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 909 | % % |
| 910 | % % |
| 911 | % % |
| 912 | % M a g i c k B l u e S h i f t I m a g e % |
| 913 | % % |
| 914 | % % |
| 915 | % % |
| 916 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 917 | % |
| 918 | % MagickBlueShiftImage() mutes the colors of the image to simulate a scene at |
| 919 | % nighttime in the moonlight. |
| 920 | % |
| 921 | % The format of the MagickBlueShiftImage method is: |
| 922 | % |
| 923 | % MagickBooleanType MagickBlueShiftImage(MagickWand *wand, |
| 924 | % const double factor) |
| 925 | % |
| 926 | % A description of each parameter follows: |
| 927 | % |
| 928 | % o wand: the magick wand. |
| 929 | % |
| 930 | % o factor: the blue shift factor (default 1.5) |
| 931 | % |
| 932 | */ |
| 933 | WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand, |
| 934 | const double factor) |
| 935 | { |
| 936 | Image |
| 937 | *shift_image; |
| 938 | |
| 939 | assert(wand != (MagickWand *) NULL); |
| 940 | assert(wand->signature == WandSignature); |
| 941 | if (wand->debug != MagickFalse) |
| 942 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 943 | if (wand->images == (Image *) NULL) |
| 944 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 945 | shift_image=BlueShiftImage(wand->images,factor,wand->exception); |
| 946 | if (shift_image == (Image *) NULL) |
| 947 | return(MagickFalse); |
| 948 | ReplaceImageInList(&wand->images,shift_image); |
| 949 | return(MagickTrue); |
| 950 | } |
| 951 | |
| 952 | /* |
| 953 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 954 | % % |
| 955 | % % |
| 956 | % % |
| 957 | % M a g i c k B l u r I m a g e % |
| 958 | % % |
| 959 | % % |
| 960 | % % |
| 961 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 962 | % |
| 963 | % MagickBlurImage() blurs an image. We convolve the image with a |
| 964 | % gaussian operator of the given radius and standard deviation (sigma). |
| 965 | % For reasonable results, the radius should be larger than sigma. Use a |
| 966 | % radius of 0 and BlurImage() selects a suitable radius for you. |
| 967 | % |
| 968 | % The format of the MagickBlurImage method is: |
| 969 | % |
| 970 | % MagickBooleanType MagickBlurImage(MagickWand *wand,const double radius, |
| 971 | % const double sigma) |
| 972 | % MagickBooleanType MagickBlurImageChannel(MagickWand *wand, |
| 973 | % const ChannelType channel,const double radius,const double sigma) |
| 974 | % |
| 975 | % A description of each parameter follows: |
| 976 | % |
| 977 | % o wand: the magick wand. |
| 978 | % |
| 979 | % o channel: the image channel(s). |
| 980 | % |
| 981 | % o radius: the radius of the , in pixels, not counting the center |
| 982 | % pixel. |
| 983 | % |
| 984 | % o sigma: the standard deviation of the , in pixels. |
| 985 | % |
| 986 | */ |
| 987 | |
| 988 | WandExport MagickBooleanType MagickBlurImage(MagickWand *wand, |
| 989 | const double radius,const double sigma) |
| 990 | { |
| 991 | MagickBooleanType |
| 992 | status; |
| 993 | |
| 994 | status=MagickBlurImageChannel(wand,DefaultChannels,radius,sigma); |
| 995 | return(status); |
| 996 | } |
| 997 | |
| 998 | WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand, |
| 999 | const ChannelType channel,const double radius,const double sigma) |
| 1000 | { |
| 1001 | Image |
| 1002 | *blur_image; |
| 1003 | |
| 1004 | assert(wand != (MagickWand *) NULL); |
| 1005 | assert(wand->signature == WandSignature); |
| 1006 | if (wand->debug != MagickFalse) |
| 1007 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1008 | if (wand->images == (Image *) NULL) |
| 1009 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1010 | blur_image=BlurImageChannel(wand->images,channel,radius,sigma, |
| 1011 | wand->exception); |
| 1012 | if (blur_image == (Image *) NULL) |
| 1013 | return(MagickFalse); |
| 1014 | ReplaceImageInList(&wand->images,blur_image); |
| 1015 | return(MagickTrue); |
| 1016 | } |
| 1017 | |
| 1018 | /* |
| 1019 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1020 | % % |
| 1021 | % % |
| 1022 | % % |
| 1023 | % M a g i c k B o r d e r I m a g e % |
| 1024 | % % |
| 1025 | % % |
| 1026 | % % |
| 1027 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1028 | % |
| 1029 | % MagickBorderImage() surrounds the image with a border of the color defined |
| 1030 | % by the bordercolor pixel wand. |
| 1031 | % |
| 1032 | % The format of the MagickBorderImage method is: |
| 1033 | % |
| 1034 | % MagickBooleanType MagickBorderImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1035 | % const PixelWand *bordercolor,const size_t width, |
| 1036 | % const size_t height) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1037 | % |
| 1038 | % A description of each parameter follows: |
| 1039 | % |
| 1040 | % o wand: the magick wand. |
| 1041 | % |
| 1042 | % o bordercolor: the border color pixel wand. |
| 1043 | % |
| 1044 | % o width: the border width. |
| 1045 | % |
| 1046 | % o height: the border height. |
| 1047 | % |
| 1048 | */ |
| 1049 | WandExport MagickBooleanType MagickBorderImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1050 | const PixelWand *bordercolor,const size_t width, |
| 1051 | const size_t height) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1052 | { |
| 1053 | Image |
| 1054 | *border_image; |
| 1055 | |
| 1056 | RectangleInfo |
| 1057 | border_info; |
| 1058 | |
| 1059 | assert(wand != (MagickWand *) NULL); |
| 1060 | assert(wand->signature == WandSignature); |
| 1061 | if (wand->debug != MagickFalse) |
| 1062 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1063 | if (wand->images == (Image *) NULL) |
| 1064 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1065 | border_info.width=width; |
| 1066 | border_info.height=height; |
| 1067 | border_info.x=0; |
| 1068 | border_info.y=0; |
| 1069 | PixelGetQuantumColor(bordercolor,&wand->images->border_color); |
| 1070 | border_image=BorderImage(wand->images,&border_info,wand->exception); |
| 1071 | if (border_image == (Image *) NULL) |
| 1072 | return(MagickFalse); |
| 1073 | ReplaceImageInList(&wand->images,border_image); |
| 1074 | return(MagickTrue); |
| 1075 | } |
| 1076 | |
| 1077 | /* |
| 1078 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1079 | % % |
| 1080 | % % |
| 1081 | % % |
cristy | a28d6b8 | 2010-01-11 20:03:47 +0000 | [diff] [blame] | 1082 | % M a g i c k B r i g h t n e s s C o n t r a s t S t r e t c h I m a g e % |
| 1083 | % % |
| 1084 | % % |
| 1085 | % % |
| 1086 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1087 | % |
| 1088 | % Use MagickBrightnessContrastImage() to change the brightness and/or contrast |
| 1089 | % of an image. It converts the brightness and contrast parameters into slope |
| 1090 | % and intercept and calls a polynomical function to apply to the image. |
| 1091 | |
| 1092 | % |
| 1093 | % The format of the MagickBrightnessContrastImage method is: |
| 1094 | % |
| 1095 | % MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand, |
| 1096 | % const double brightness,const double contrast) |
| 1097 | % MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand, |
| 1098 | % const ChannelType channel,const double brightness, |
| 1099 | % const double contrast) |
| 1100 | % |
| 1101 | % A description of each parameter follows: |
| 1102 | % |
| 1103 | % o wand: the magick wand. |
| 1104 | % |
| 1105 | % o channel: the image channel(s). |
| 1106 | % |
| 1107 | % o brightness: the brightness percent (-100 .. 100). |
| 1108 | % |
| 1109 | % o contrast: the contrast percent (-100 .. 100). |
| 1110 | % |
| 1111 | */ |
| 1112 | |
| 1113 | WandExport MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand, |
| 1114 | const double brightness,const double contrast) |
| 1115 | { |
| 1116 | MagickBooleanType |
| 1117 | status; |
| 1118 | |
| 1119 | status=MagickBrightnessContrastImageChannel(wand,DefaultChannels,brightness, |
| 1120 | contrast); |
| 1121 | return(status); |
| 1122 | } |
| 1123 | |
| 1124 | WandExport MagickBooleanType MagickBrightnessContrastImageChannel( |
| 1125 | MagickWand *wand,const ChannelType channel,const double brightness, |
| 1126 | const double contrast) |
| 1127 | { |
| 1128 | MagickBooleanType |
| 1129 | status; |
| 1130 | |
| 1131 | assert(wand != (MagickWand *) NULL); |
| 1132 | assert(wand->signature == WandSignature); |
| 1133 | if (wand->debug != MagickFalse) |
| 1134 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1135 | if (wand->images == (Image *) NULL) |
| 1136 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1137 | status=BrightnessContrastImageChannel(wand->images,channel,brightness, |
| 1138 | contrast); |
| 1139 | if (status == MagickFalse) |
| 1140 | InheritException(wand->exception,&wand->images->exception); |
| 1141 | return(status); |
| 1142 | } |
| 1143 | |
| 1144 | /* |
| 1145 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1146 | % % |
| 1147 | % % |
| 1148 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1149 | % M a g i c k C h a r c o a l I m a g e % |
| 1150 | % % |
| 1151 | % % |
| 1152 | % % |
| 1153 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1154 | % |
| 1155 | % MagickCharcoalImage() simulates a charcoal drawing. |
| 1156 | % |
| 1157 | % The format of the MagickCharcoalImage method is: |
| 1158 | % |
| 1159 | % MagickBooleanType MagickCharcoalImage(MagickWand *wand, |
| 1160 | % const double radius,const double sigma) |
| 1161 | % |
| 1162 | % A description of each parameter follows: |
| 1163 | % |
| 1164 | % o wand: the magick wand. |
| 1165 | % |
| 1166 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 1167 | % pixel. |
| 1168 | % |
| 1169 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 1170 | % |
| 1171 | */ |
| 1172 | WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand, |
| 1173 | const double radius,const double sigma) |
| 1174 | { |
| 1175 | Image |
| 1176 | *charcoal_image; |
| 1177 | |
| 1178 | assert(wand != (MagickWand *) NULL); |
| 1179 | assert(wand->signature == WandSignature); |
| 1180 | if (wand->debug != MagickFalse) |
| 1181 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1182 | if (wand->images == (Image *) NULL) |
| 1183 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1184 | charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception); |
| 1185 | if (charcoal_image == (Image *) NULL) |
| 1186 | return(MagickFalse); |
| 1187 | ReplaceImageInList(&wand->images,charcoal_image); |
| 1188 | return(MagickTrue); |
| 1189 | } |
| 1190 | |
| 1191 | /* |
| 1192 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1193 | % % |
| 1194 | % % |
| 1195 | % % |
| 1196 | % M a g i c k C h o p I m a g e % |
| 1197 | % % |
| 1198 | % % |
| 1199 | % % |
| 1200 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1201 | % |
| 1202 | % MagickChopImage() removes a region of an image and collapses the image to |
| 1203 | % occupy the removed portion |
| 1204 | % |
| 1205 | % The format of the MagickChopImage method is: |
| 1206 | % |
| 1207 | % MagickBooleanType MagickChopImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1208 | % const size_t width,const size_t height,const ssize_t x, |
| 1209 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1210 | % |
| 1211 | % A description of each parameter follows: |
| 1212 | % |
| 1213 | % o wand: the magick wand. |
| 1214 | % |
| 1215 | % o width: the region width. |
| 1216 | % |
| 1217 | % o height: the region height. |
| 1218 | % |
| 1219 | % o x: the region x offset. |
| 1220 | % |
| 1221 | % o y: the region y offset. |
| 1222 | % |
| 1223 | % |
| 1224 | */ |
| 1225 | WandExport MagickBooleanType MagickChopImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1226 | const size_t width,const size_t height,const ssize_t x, |
| 1227 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1228 | { |
| 1229 | Image |
| 1230 | *chop_image; |
| 1231 | |
| 1232 | RectangleInfo |
| 1233 | chop; |
| 1234 | |
| 1235 | assert(wand != (MagickWand *) NULL); |
| 1236 | assert(wand->signature == WandSignature); |
| 1237 | if (wand->debug != MagickFalse) |
| 1238 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1239 | if (wand->images == (Image *) NULL) |
| 1240 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1241 | chop.width=width; |
| 1242 | chop.height=height; |
| 1243 | chop.x=x; |
| 1244 | chop.y=y; |
| 1245 | chop_image=ChopImage(wand->images,&chop,wand->exception); |
| 1246 | if (chop_image == (Image *) NULL) |
| 1247 | return(MagickFalse); |
| 1248 | ReplaceImageInList(&wand->images,chop_image); |
| 1249 | return(MagickTrue); |
| 1250 | } |
| 1251 | |
| 1252 | /* |
| 1253 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1254 | % % |
| 1255 | % % |
| 1256 | % % |
cristy | 1eb45dd | 2009-09-25 16:38:06 +0000 | [diff] [blame] | 1257 | % M a g i c k C l a m p I m a g e % |
| 1258 | % % |
| 1259 | % % |
| 1260 | % % |
| 1261 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1262 | % |
cristy | ecb0c6d | 2009-09-25 16:50:09 +0000 | [diff] [blame] | 1263 | % MagickClampImage() restricts the color range from 0 to the quantum depth. |
cristy | 1eb45dd | 2009-09-25 16:38:06 +0000 | [diff] [blame] | 1264 | % |
| 1265 | % The format of the MagickClampImage method is: |
| 1266 | % |
| 1267 | % MagickBooleanType MagickClampImage(MagickWand *wand) |
| 1268 | % MagickBooleanType MagickClampImageChannel(MagickWand *wand, |
| 1269 | % const ChannelType channel) |
| 1270 | % |
| 1271 | % A description of each parameter follows: |
| 1272 | % |
| 1273 | % o wand: the magick wand. |
| 1274 | % |
| 1275 | % o channel: the channel. |
| 1276 | % |
| 1277 | */ |
| 1278 | |
| 1279 | WandExport MagickBooleanType MagickClampImage(MagickWand *wand) |
| 1280 | { |
| 1281 | MagickBooleanType |
| 1282 | status; |
| 1283 | |
| 1284 | status=MagickClampImageChannel(wand,DefaultChannels); |
| 1285 | return(status); |
| 1286 | } |
| 1287 | |
| 1288 | WandExport MagickBooleanType MagickClampImageChannel(MagickWand *wand, |
| 1289 | const ChannelType channel) |
| 1290 | { |
| 1291 | MagickBooleanType |
| 1292 | status; |
| 1293 | |
| 1294 | assert(wand != (MagickWand *) NULL); |
| 1295 | assert(wand->signature == WandSignature); |
| 1296 | if (wand->debug != MagickFalse) |
| 1297 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1298 | if (wand->images == (Image *) NULL) |
| 1299 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1300 | status=ClampImageChannel(wand->images,channel); |
| 1301 | if (status == MagickFalse) |
| 1302 | InheritException(wand->exception,&wand->images->exception); |
| 1303 | return(status); |
| 1304 | } |
| 1305 | |
| 1306 | /* |
| 1307 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1308 | % % |
| 1309 | % % |
| 1310 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1311 | % M a g i c k C l i p I m a g e % |
| 1312 | % % |
| 1313 | % % |
| 1314 | % % |
| 1315 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1316 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 1317 | % MagickClipImage() clips along the first path from the 8BIM profile, if |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1318 | % present. |
| 1319 | % |
| 1320 | % The format of the MagickClipImage method is: |
| 1321 | % |
| 1322 | % MagickBooleanType MagickClipImage(MagickWand *wand) |
| 1323 | % |
| 1324 | % A description of each parameter follows: |
| 1325 | % |
| 1326 | % o wand: the magick wand. |
| 1327 | % |
| 1328 | */ |
| 1329 | WandExport MagickBooleanType MagickClipImage(MagickWand *wand) |
| 1330 | { |
| 1331 | MagickBooleanType |
| 1332 | status; |
| 1333 | |
| 1334 | assert(wand != (MagickWand *) NULL); |
| 1335 | assert(wand->signature == WandSignature); |
| 1336 | if (wand->debug != MagickFalse) |
| 1337 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1338 | if (wand->images == (Image *) NULL) |
| 1339 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1340 | status=ClipImage(wand->images); |
| 1341 | if (status == MagickFalse) |
| 1342 | InheritException(wand->exception,&wand->images->exception); |
| 1343 | return(status); |
| 1344 | } |
| 1345 | |
| 1346 | /* |
| 1347 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1348 | % % |
| 1349 | % % |
| 1350 | % % |
| 1351 | % M a g i c k C l i p I m a g e P a t h % |
| 1352 | % % |
| 1353 | % % |
| 1354 | % % |
| 1355 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1356 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 1357 | % MagickClipImagePath() clips along the named paths from the 8BIM profile, if |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1358 | % present. Later operations take effect inside the path. Id may be a number |
| 1359 | % if preceded with #, to work on a numbered path, e.g., "#1" to use the first |
| 1360 | % path. |
| 1361 | % |
| 1362 | % The format of the MagickClipImagePath method is: |
| 1363 | % |
| 1364 | % MagickBooleanType MagickClipImagePath(MagickWand *wand, |
| 1365 | % const char *pathname,const MagickBooleanType inside) |
| 1366 | % |
| 1367 | % A description of each parameter follows: |
| 1368 | % |
| 1369 | % o wand: the magick wand. |
| 1370 | % |
| 1371 | % o pathname: name of clipping path resource. If name is preceded by #, use |
| 1372 | % clipping path numbered by name. |
| 1373 | % |
| 1374 | % o inside: if non-zero, later operations take effect inside clipping path. |
| 1375 | % Otherwise later operations take effect outside clipping path. |
| 1376 | % |
| 1377 | */ |
| 1378 | WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand, |
| 1379 | const char *pathname,const MagickBooleanType inside) |
| 1380 | { |
| 1381 | MagickBooleanType |
| 1382 | status; |
| 1383 | |
| 1384 | assert(wand != (MagickWand *) NULL); |
| 1385 | assert(wand->signature == WandSignature); |
| 1386 | if (wand->debug != MagickFalse) |
| 1387 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1388 | if (wand->images == (Image *) NULL) |
| 1389 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1390 | status=ClipImagePath(wand->images,pathname,inside); |
| 1391 | if (status == MagickFalse) |
| 1392 | InheritException(wand->exception,&wand->images->exception); |
| 1393 | return(status); |
| 1394 | } |
| 1395 | |
| 1396 | /* |
| 1397 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1398 | % % |
| 1399 | % % |
| 1400 | % % |
| 1401 | % M a g i c k C l u t I m a g e % |
| 1402 | % % |
| 1403 | % % |
| 1404 | % % |
| 1405 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1406 | % |
| 1407 | % MagickClutImage() replaces colors in the image from a color lookup table. |
| 1408 | % |
| 1409 | % The format of the MagickClutImage method is: |
| 1410 | % |
| 1411 | % MagickBooleanType MagickClutImage(MagickWand *wand, |
| 1412 | % const MagickWand *clut_wand) |
| 1413 | % MagickBooleanType MagickClutImageChannel(MagickWand *wand, |
| 1414 | % const ChannelType channel,const MagickWand *clut_wand) |
| 1415 | % |
| 1416 | % A description of each parameter follows: |
| 1417 | % |
| 1418 | % o wand: the magick wand. |
| 1419 | % |
| 1420 | % o clut_image: the clut image. |
| 1421 | % |
| 1422 | */ |
| 1423 | |
| 1424 | WandExport MagickBooleanType MagickClutImage(MagickWand *wand, |
| 1425 | const MagickWand *clut_wand) |
| 1426 | { |
| 1427 | MagickBooleanType |
| 1428 | status; |
| 1429 | |
| 1430 | status=MagickClutImageChannel(wand,DefaultChannels,clut_wand); |
| 1431 | return(status); |
| 1432 | } |
| 1433 | |
| 1434 | WandExport MagickBooleanType MagickClutImageChannel(MagickWand *wand, |
| 1435 | const ChannelType channel,const MagickWand *clut_wand) |
| 1436 | { |
| 1437 | MagickBooleanType |
| 1438 | status; |
| 1439 | |
| 1440 | assert(wand != (MagickWand *) NULL); |
| 1441 | assert(wand->signature == WandSignature); |
| 1442 | if (wand->debug != MagickFalse) |
| 1443 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1444 | if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL)) |
| 1445 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1446 | status=ClutImageChannel(wand->images,channel,clut_wand->images); |
| 1447 | if (status == MagickFalse) |
| 1448 | InheritException(wand->exception,&wand->images->exception); |
| 1449 | return(status); |
| 1450 | } |
| 1451 | |
| 1452 | /* |
| 1453 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1454 | % % |
| 1455 | % % |
| 1456 | % % |
| 1457 | % M a g i c k C o a l e s c e I m a g e s % |
| 1458 | % % |
| 1459 | % % |
| 1460 | % % |
| 1461 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1462 | % |
| 1463 | % MagickCoalesceImages() composites a set of images while respecting any page |
| 1464 | % offsets and disposal methods. GIF, MIFF, and MNG animation sequences |
| 1465 | % typically start with an image background and each subsequent image |
| 1466 | % varies in size and offset. MagickCoalesceImages() returns a new sequence |
| 1467 | % where each image in the sequence is the same size as the first and |
| 1468 | % composited with the next image in the sequence. |
| 1469 | % |
| 1470 | % The format of the MagickCoalesceImages method is: |
| 1471 | % |
| 1472 | % MagickWand *MagickCoalesceImages(MagickWand *wand) |
| 1473 | % |
| 1474 | % A description of each parameter follows: |
| 1475 | % |
| 1476 | % o wand: the magick wand. |
| 1477 | % |
| 1478 | */ |
| 1479 | WandExport MagickWand *MagickCoalesceImages(MagickWand *wand) |
| 1480 | { |
| 1481 | Image |
| 1482 | *coalesce_image; |
| 1483 | |
| 1484 | assert(wand != (MagickWand *) NULL); |
| 1485 | assert(wand->signature == WandSignature); |
| 1486 | if (wand->debug != MagickFalse) |
| 1487 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1488 | if (wand->images == (Image *) NULL) |
| 1489 | return((MagickWand *) NULL); |
| 1490 | coalesce_image=CoalesceImages(wand->images,wand->exception); |
| 1491 | if (coalesce_image == (Image *) NULL) |
| 1492 | return((MagickWand *) NULL); |
| 1493 | return(CloneMagickWandFromImages(wand,coalesce_image)); |
| 1494 | } |
| 1495 | |
| 1496 | /* |
| 1497 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1498 | % % |
| 1499 | % % |
| 1500 | % % |
| 1501 | % M a g i c k C o l o r D e c i s i o n I m a g e % |
| 1502 | % % |
| 1503 | % % |
| 1504 | % % |
| 1505 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1506 | % |
| 1507 | % MagickColorDecisionListImage() accepts a lightweight Color Correction |
| 1508 | % Collection (CCC) file which solely contains one or more color corrections |
| 1509 | % and applies the color correction to the image. Here is a sample CCC file: |
| 1510 | % |
| 1511 | % <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> |
| 1512 | % <ColorCorrection id="cc03345"> |
| 1513 | % <SOPNode> |
| 1514 | % <Slope> 0.9 1.2 0.5 </Slope> |
| 1515 | % <Offset> 0.4 -0.5 0.6 </Offset> |
| 1516 | % <Power> 1.0 0.8 1.5 </Power> |
| 1517 | % </SOPNode> |
| 1518 | % <SATNode> |
| 1519 | % <Saturation> 0.85 </Saturation> |
| 1520 | % </SATNode> |
| 1521 | % </ColorCorrection> |
| 1522 | % </ColorCorrectionCollection> |
| 1523 | % |
| 1524 | % which includes the offset, slope, and power for each of the RGB channels |
| 1525 | % as well as the saturation. |
| 1526 | % |
| 1527 | % The format of the MagickColorDecisionListImage method is: |
| 1528 | % |
| 1529 | % MagickBooleanType MagickColorDecisionListImage(MagickWand *wand, |
| 1530 | % const double gamma) |
| 1531 | % |
| 1532 | % A description of each parameter follows: |
| 1533 | % |
| 1534 | % o wand: the magick wand. |
| 1535 | % |
| 1536 | % o color_correction_collection: the color correction collection in XML. |
| 1537 | % |
| 1538 | */ |
| 1539 | WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand, |
| 1540 | const char *color_correction_collection) |
| 1541 | { |
| 1542 | MagickBooleanType |
| 1543 | status; |
| 1544 | |
| 1545 | assert(wand != (MagickWand *) NULL); |
| 1546 | assert(wand->signature == WandSignature); |
| 1547 | if (wand->debug != MagickFalse) |
| 1548 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1549 | if (wand->images == (Image *) NULL) |
| 1550 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1551 | status=ColorDecisionListImage(wand->images,color_correction_collection); |
| 1552 | if (status == MagickFalse) |
| 1553 | InheritException(wand->exception,&wand->images->exception); |
| 1554 | return(status); |
| 1555 | } |
| 1556 | |
| 1557 | /* |
| 1558 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1559 | % % |
| 1560 | % % |
| 1561 | % % |
| 1562 | % M a g i c k C o l o r i z e I m a g e % |
| 1563 | % % |
| 1564 | % % |
| 1565 | % % |
| 1566 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1567 | % |
| 1568 | % MagickColorizeImage() blends the fill color with each pixel in the image. |
| 1569 | % |
| 1570 | % The format of the MagickColorizeImage method is: |
| 1571 | % |
| 1572 | % MagickBooleanType MagickColorizeImage(MagickWand *wand, |
| 1573 | % const PixelWand *colorize,const PixelWand *opacity) |
| 1574 | % |
| 1575 | % A description of each parameter follows: |
| 1576 | % |
| 1577 | % o wand: the magick wand. |
| 1578 | % |
| 1579 | % o colorize: the colorize pixel wand. |
| 1580 | % |
| 1581 | % o opacity: the opacity pixel wand. |
| 1582 | % |
| 1583 | */ |
| 1584 | WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand, |
| 1585 | const PixelWand *colorize,const PixelWand *opacity) |
| 1586 | { |
| 1587 | char |
| 1588 | percent_opaque[MaxTextExtent]; |
| 1589 | |
| 1590 | Image |
| 1591 | *colorize_image; |
| 1592 | |
| 1593 | PixelPacket |
| 1594 | target; |
| 1595 | |
| 1596 | assert(wand != (MagickWand *) NULL); |
| 1597 | assert(wand->signature == WandSignature); |
| 1598 | if (wand->debug != MagickFalse) |
| 1599 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1600 | if (wand->images == (Image *) NULL) |
| 1601 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 1602 | (void) FormatLocaleString(percent_opaque,MaxTextExtent, |
cristy | e7f5109 | 2010-01-17 00:39:37 +0000 | [diff] [blame] | 1603 | "%g,%g,%g,%g",(double) (100.0*QuantumScale* |
cristy | 8cd5b31 | 2010-01-07 01:10:24 +0000 | [diff] [blame] | 1604 | PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale* |
| 1605 | PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale* |
| 1606 | PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale* |
| 1607 | PixelGetOpacityQuantum(opacity))); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1608 | PixelGetQuantumColor(colorize,&target); |
| 1609 | colorize_image=ColorizeImage(wand->images,percent_opaque,target, |
| 1610 | wand->exception); |
| 1611 | if (colorize_image == (Image *) NULL) |
| 1612 | return(MagickFalse); |
| 1613 | ReplaceImageInList(&wand->images,colorize_image); |
| 1614 | return(MagickTrue); |
| 1615 | } |
| 1616 | |
| 1617 | /* |
| 1618 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1619 | % % |
| 1620 | % % |
| 1621 | % % |
cristy | e636559 | 2010-04-02 17:31:23 +0000 | [diff] [blame] | 1622 | % M a g i c k C o l o r M a t r i x I m a g e % |
| 1623 | % % |
| 1624 | % % |
| 1625 | % % |
| 1626 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1627 | % |
| 1628 | % MagickColorMatrixImage() apply color transformation to an image. The method |
| 1629 | % permits saturation changes, hue rotation, luminance to alpha, and various |
| 1630 | % other effects. Although variable-sized transformation matrices can be used, |
| 1631 | % typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA |
| 1632 | % (or RGBA with offsets). The matrix is similar to those used by Adobe Flash |
| 1633 | % except offsets are in column 6 rather than 5 (in support of CMYKA images) |
| 1634 | % and offsets are normalized (divide Flash offset by 255). |
| 1635 | % |
| 1636 | % The format of the MagickColorMatrixImage method is: |
| 1637 | % |
| 1638 | % MagickBooleanType MagickColorMatrixImage(MagickWand *wand, |
| 1639 | % const KernelInfo *color_matrix) |
| 1640 | % |
| 1641 | % A description of each parameter follows: |
| 1642 | % |
| 1643 | % o wand: the magick wand. |
| 1644 | % |
| 1645 | % o color_matrix: the color matrix. |
| 1646 | % |
| 1647 | */ |
| 1648 | WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand, |
| 1649 | const KernelInfo *color_matrix) |
| 1650 | { |
| 1651 | Image |
| 1652 | *color_image; |
| 1653 | |
| 1654 | assert(wand != (MagickWand *) NULL); |
| 1655 | assert(wand->signature == WandSignature); |
| 1656 | if (wand->debug != MagickFalse) |
| 1657 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1658 | if (color_matrix == (const KernelInfo *) NULL) |
| 1659 | return(MagickFalse); |
| 1660 | if (wand->images == (Image *) NULL) |
| 1661 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1662 | color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception); |
| 1663 | if (color_image == (Image *) NULL) |
| 1664 | return(MagickFalse); |
| 1665 | ReplaceImageInList(&wand->images,color_image); |
| 1666 | return(MagickTrue); |
| 1667 | } |
| 1668 | |
| 1669 | /* |
| 1670 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1671 | % % |
| 1672 | % % |
| 1673 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1674 | % M a g i c k C o m b i n e I m a g e s % |
| 1675 | % % |
| 1676 | % % |
| 1677 | % % |
| 1678 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1679 | % |
| 1680 | % MagickCombineImages() combines one or more images into a single image. The |
| 1681 | % grayscale value of the pixels of each image in the sequence is assigned in |
| 1682 | % order to the specified hannels of the combined image. The typical |
| 1683 | % ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc. |
| 1684 | % |
| 1685 | % The format of the MagickCombineImages method is: |
| 1686 | % |
| 1687 | % MagickWand *MagickCombineImages(MagickWand *wand, |
| 1688 | % const ChannelType channel) |
| 1689 | % |
| 1690 | % A description of each parameter follows: |
| 1691 | % |
| 1692 | % o wand: the magick wand. |
| 1693 | % |
| 1694 | % o channel: the channel. |
| 1695 | % |
| 1696 | */ |
| 1697 | WandExport MagickWand *MagickCombineImages(MagickWand *wand, |
| 1698 | const ChannelType channel) |
| 1699 | { |
| 1700 | Image |
| 1701 | *combine_image; |
| 1702 | |
| 1703 | assert(wand != (MagickWand *) NULL); |
| 1704 | assert(wand->signature == WandSignature); |
| 1705 | if (wand->debug != MagickFalse) |
| 1706 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1707 | if (wand->images == (Image *) NULL) |
| 1708 | return((MagickWand *) NULL); |
| 1709 | combine_image=CombineImages(wand->images,channel,wand->exception); |
| 1710 | if (combine_image == (Image *) NULL) |
| 1711 | return((MagickWand *) NULL); |
| 1712 | return(CloneMagickWandFromImages(wand,combine_image)); |
| 1713 | } |
| 1714 | |
| 1715 | /* |
| 1716 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1717 | % % |
| 1718 | % % |
| 1719 | % % |
| 1720 | % M a g i c k C o m m e n t I m a g e % |
| 1721 | % % |
| 1722 | % % |
| 1723 | % % |
| 1724 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1725 | % |
| 1726 | % MagickCommentImage() adds a comment to your image. |
| 1727 | % |
| 1728 | % The format of the MagickCommentImage method is: |
| 1729 | % |
| 1730 | % MagickBooleanType MagickCommentImage(MagickWand *wand, |
| 1731 | % const char *comment) |
| 1732 | % |
| 1733 | % A description of each parameter follows: |
| 1734 | % |
| 1735 | % o wand: the magick wand. |
| 1736 | % |
| 1737 | % o comment: the image comment. |
| 1738 | % |
| 1739 | */ |
| 1740 | WandExport MagickBooleanType MagickCommentImage(MagickWand *wand, |
| 1741 | const char *comment) |
| 1742 | { |
| 1743 | MagickBooleanType |
| 1744 | status; |
| 1745 | |
| 1746 | assert(wand != (MagickWand *) NULL); |
| 1747 | assert(wand->signature == WandSignature); |
| 1748 | if (wand->debug != MagickFalse) |
| 1749 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1750 | if (wand->images == (Image *) NULL) |
| 1751 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1752 | status=SetImageProperty(wand->images,"comment",comment); |
| 1753 | if (status == MagickFalse) |
| 1754 | InheritException(wand->exception,&wand->images->exception); |
| 1755 | return(status); |
| 1756 | } |
| 1757 | |
| 1758 | /* |
| 1759 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1760 | % % |
| 1761 | % % |
| 1762 | % % |
| 1763 | % M a g i c k C o m p a r e I m a g e C h a n n e l s % |
| 1764 | % % |
| 1765 | % % |
| 1766 | % % |
| 1767 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1768 | % |
| 1769 | % MagickCompareImageChannels() compares one or more image channels of an image |
| 1770 | % to a reconstructed image and returns the difference image. |
| 1771 | % |
| 1772 | % The format of the MagickCompareImageChannels method is: |
| 1773 | % |
| 1774 | % MagickWand *MagickCompareImageChannels(MagickWand *wand, |
| 1775 | % const MagickWand *reference,const ChannelType channel, |
| 1776 | % const MetricType metric,double *distortion) |
| 1777 | % |
| 1778 | % A description of each parameter follows: |
| 1779 | % |
| 1780 | % o wand: the magick wand. |
| 1781 | % |
| 1782 | % o reference: the reference wand. |
| 1783 | % |
| 1784 | % o channel: the channel. |
| 1785 | % |
| 1786 | % o metric: the metric. |
| 1787 | % |
| 1788 | % o distortion: the computed distortion between the images. |
| 1789 | % |
| 1790 | */ |
| 1791 | WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand, |
| 1792 | const MagickWand *reference,const ChannelType channel,const MetricType metric, |
| 1793 | double *distortion) |
| 1794 | { |
| 1795 | Image |
| 1796 | *compare_image; |
| 1797 | |
| 1798 | assert(wand != (MagickWand *) NULL); |
| 1799 | assert(wand->signature == WandSignature); |
| 1800 | if (wand->debug != MagickFalse) |
| 1801 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1802 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 1803 | { |
| 1804 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 1805 | "ContainsNoImages","`%s'",wand->name); |
| 1806 | return((MagickWand *) NULL); |
| 1807 | } |
| 1808 | compare_image=CompareImageChannels(wand->images,reference->images,channel, |
| 1809 | metric,distortion,&wand->images->exception); |
| 1810 | if (compare_image == (Image *) NULL) |
| 1811 | return((MagickWand *) NULL); |
| 1812 | return(CloneMagickWandFromImages(wand,compare_image)); |
| 1813 | } |
| 1814 | |
| 1815 | /* |
| 1816 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1817 | % % |
| 1818 | % % |
| 1819 | % % |
| 1820 | % M a g i c k C o m p a r e I m a g e L a y e r s % |
| 1821 | % % |
| 1822 | % % |
| 1823 | % % |
| 1824 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1825 | % |
| 1826 | % MagickCompareImageLayers() compares each image with the next in a sequence |
| 1827 | % and returns the maximum bounding region of any pixel differences it |
| 1828 | % discovers. |
| 1829 | % |
| 1830 | % The format of the MagickCompareImageLayers method is: |
| 1831 | % |
| 1832 | % MagickWand *MagickCompareImageLayers(MagickWand *wand, |
| 1833 | % const ImageLayerMethod method) |
| 1834 | % |
| 1835 | % A description of each parameter follows: |
| 1836 | % |
| 1837 | % o wand: the magick wand. |
| 1838 | % |
| 1839 | % o method: the compare method. |
| 1840 | % |
| 1841 | */ |
| 1842 | WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand, |
| 1843 | const ImageLayerMethod method) |
| 1844 | { |
| 1845 | Image |
| 1846 | *layers_image; |
| 1847 | |
| 1848 | assert(wand != (MagickWand *) NULL); |
| 1849 | assert(wand->signature == WandSignature); |
| 1850 | if (wand->debug != MagickFalse) |
| 1851 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1852 | if (wand->images == (Image *) NULL) |
| 1853 | return((MagickWand *) NULL); |
| 1854 | layers_image=CompareImageLayers(wand->images,method,wand->exception); |
| 1855 | if (layers_image == (Image *) NULL) |
| 1856 | return((MagickWand *) NULL); |
| 1857 | return(CloneMagickWandFromImages(wand,layers_image)); |
| 1858 | } |
| 1859 | |
| 1860 | /* |
| 1861 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1862 | % % |
| 1863 | % % |
| 1864 | % % |
| 1865 | % M a g i c k C o m p a r e I m a g e s % |
| 1866 | % % |
| 1867 | % % |
| 1868 | % % |
| 1869 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1870 | % |
| 1871 | % MagickCompareImages() compares an image to a reconstructed image and returns |
| 1872 | % the specified difference image. |
| 1873 | % |
| 1874 | % The format of the MagickCompareImages method is: |
| 1875 | % |
| 1876 | % MagickWand *MagickCompareImages(MagickWand *wand, |
| 1877 | % const MagickWand *reference,const MetricType metric, |
| 1878 | % double *distortion) |
| 1879 | % |
| 1880 | % A description of each parameter follows: |
| 1881 | % |
| 1882 | % o wand: the magick wand. |
| 1883 | % |
| 1884 | % o reference: the reference wand. |
| 1885 | % |
| 1886 | % o metric: the metric. |
| 1887 | % |
| 1888 | % o distortion: the computed distortion between the images. |
| 1889 | % |
| 1890 | */ |
| 1891 | WandExport MagickWand *MagickCompareImages(MagickWand *wand, |
| 1892 | const MagickWand *reference,const MetricType metric,double *distortion) |
| 1893 | { |
| 1894 | Image |
| 1895 | *compare_image; |
| 1896 | |
| 1897 | |
| 1898 | assert(wand != (MagickWand *) NULL); |
| 1899 | assert(wand->signature == WandSignature); |
| 1900 | if (wand->debug != MagickFalse) |
| 1901 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1902 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 1903 | { |
| 1904 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 1905 | "ContainsNoImages","`%s'",wand->name); |
| 1906 | return((MagickWand *) NULL); |
| 1907 | } |
| 1908 | compare_image=CompareImages(wand->images,reference->images,metric,distortion, |
| 1909 | &wand->images->exception); |
| 1910 | if (compare_image == (Image *) NULL) |
| 1911 | return((MagickWand *) NULL); |
| 1912 | return(CloneMagickWandFromImages(wand,compare_image)); |
| 1913 | } |
| 1914 | |
| 1915 | /* |
| 1916 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1917 | % % |
| 1918 | % % |
| 1919 | % % |
| 1920 | % M a g i c k C o m p o s i t e I m a g e % |
| 1921 | % % |
| 1922 | % % |
| 1923 | % % |
| 1924 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1925 | % |
| 1926 | % MagickCompositeImage() composite one image onto another at the specified |
| 1927 | % offset. |
| 1928 | % |
| 1929 | % The format of the MagickCompositeImage method is: |
| 1930 | % |
| 1931 | % MagickBooleanType MagickCompositeImage(MagickWand *wand, |
| 1932 | % const MagickWand *composite_wand,const CompositeOperator compose, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1933 | % const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1934 | % MagickBooleanType MagickCompositeImageChannel(MagickWand *wand, |
| 1935 | % const ChannelType channel,const MagickWand *composite_wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1936 | % const CompositeOperator compose,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1937 | % |
| 1938 | % A description of each parameter follows: |
| 1939 | % |
| 1940 | % o wand: the magick wand. |
| 1941 | % |
| 1942 | % o composite_image: the composite image. |
| 1943 | % |
| 1944 | % o compose: This operator affects how the composite is applied to the |
| 1945 | % image. The default is Over. Choose from these operators: |
| 1946 | % |
| 1947 | % OverCompositeOp InCompositeOp OutCompositeOp |
| 1948 | % AtopCompositeOp XorCompositeOp PlusCompositeOp |
| 1949 | % MinusCompositeOp AddCompositeOp SubtractCompositeOp |
| 1950 | % DifferenceCompositeOp BumpmapCompositeOp CopyCompositeOp |
| 1951 | % DisplaceCompositeOp |
| 1952 | % |
| 1953 | % o x: the column offset of the composited image. |
| 1954 | % |
| 1955 | % o y: the row offset of the composited image. |
| 1956 | % |
| 1957 | */ |
| 1958 | |
| 1959 | WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1960 | const MagickWand *composite_wand,const CompositeOperator compose,const ssize_t x, |
| 1961 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1962 | { |
| 1963 | MagickBooleanType |
| 1964 | status; |
| 1965 | |
| 1966 | status=MagickCompositeImageChannel(wand,DefaultChannels,composite_wand, |
| 1967 | compose,x,y); |
| 1968 | return(status); |
| 1969 | } |
| 1970 | |
| 1971 | WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand, |
| 1972 | const ChannelType channel,const MagickWand *composite_wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1973 | const CompositeOperator compose,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1974 | { |
| 1975 | MagickBooleanType |
| 1976 | status; |
| 1977 | |
| 1978 | assert(wand != (MagickWand *) NULL); |
| 1979 | assert(wand->signature == WandSignature); |
| 1980 | if (wand->debug != MagickFalse) |
| 1981 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 1982 | if ((wand->images == (Image *) NULL) || |
| 1983 | (composite_wand->images == (Image *) NULL)) |
| 1984 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 1985 | status=CompositeImageChannel(wand->images,channel,compose, |
| 1986 | composite_wand->images,x,y); |
| 1987 | if (status == MagickFalse) |
| 1988 | InheritException(wand->exception,&wand->images->exception); |
| 1989 | return(status); |
| 1990 | } |
| 1991 | |
| 1992 | /* |
| 1993 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1994 | % % |
| 1995 | % % |
| 1996 | % % |
| 1997 | % M a g i c k C o n t r a s t I m a g e % |
| 1998 | % % |
| 1999 | % % |
| 2000 | % % |
| 2001 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2002 | % |
| 2003 | % MagickContrastImage() enhances the intensity differences between the lighter |
| 2004 | % and darker elements of the image. Set sharpen to a value other than 0 to |
| 2005 | % increase the image contrast otherwise the contrast is reduced. |
| 2006 | % |
| 2007 | % The format of the MagickContrastImage method is: |
| 2008 | % |
| 2009 | % MagickBooleanType MagickContrastImage(MagickWand *wand, |
| 2010 | % const MagickBooleanType sharpen) |
| 2011 | % |
| 2012 | % A description of each parameter follows: |
| 2013 | % |
| 2014 | % o wand: the magick wand. |
| 2015 | % |
| 2016 | % o sharpen: Increase or decrease image contrast. |
| 2017 | % |
| 2018 | % |
| 2019 | */ |
| 2020 | WandExport MagickBooleanType MagickContrastImage(MagickWand *wand, |
| 2021 | const MagickBooleanType sharpen) |
| 2022 | { |
| 2023 | MagickBooleanType |
| 2024 | status; |
| 2025 | |
| 2026 | assert(wand != (MagickWand *) NULL); |
| 2027 | assert(wand->signature == WandSignature); |
| 2028 | if (wand->debug != MagickFalse) |
| 2029 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2030 | if (wand->images == (Image *) NULL) |
| 2031 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2032 | status=ContrastImage(wand->images,sharpen); |
| 2033 | if (status == MagickFalse) |
| 2034 | InheritException(wand->exception,&wand->images->exception); |
| 2035 | return(status); |
| 2036 | } |
| 2037 | |
| 2038 | /* |
| 2039 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2040 | % % |
| 2041 | % % |
| 2042 | % % |
| 2043 | % M a g i c k C o n t r a s t S t r e t c h I m a g e % |
| 2044 | % % |
| 2045 | % % |
| 2046 | % % |
| 2047 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2048 | % |
| 2049 | % MagickContrastStretchImage() enhances the contrast of a color image by |
| 2050 | % adjusting the pixels color to span the entire range of colors available. |
| 2051 | % You can also reduce the influence of a particular channel with a gamma |
| 2052 | % value of 0. |
| 2053 | % |
| 2054 | % The format of the MagickContrastStretchImage method is: |
| 2055 | % |
| 2056 | % MagickBooleanType MagickContrastStretchImage(MagickWand *wand, |
| 2057 | % const double black_point,const double white_point) |
| 2058 | % MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand, |
| 2059 | % const ChannelType channel,const double black_point, |
| 2060 | % const double white_point) |
| 2061 | % |
| 2062 | % A description of each parameter follows: |
| 2063 | % |
| 2064 | % o wand: the magick wand. |
| 2065 | % |
| 2066 | % o channel: the image channel(s). |
| 2067 | % |
| 2068 | % o black_point: the black point. |
| 2069 | % |
| 2070 | % o white_point: the white point. |
| 2071 | % |
| 2072 | */ |
| 2073 | |
| 2074 | WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand, |
| 2075 | const double black_point,const double white_point) |
| 2076 | { |
| 2077 | MagickBooleanType |
| 2078 | status; |
| 2079 | |
| 2080 | status=MagickContrastStretchImageChannel(wand,DefaultChannels,black_point, |
| 2081 | white_point); |
| 2082 | return(status); |
| 2083 | } |
| 2084 | |
| 2085 | WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand, |
| 2086 | const ChannelType channel,const double black_point,const double white_point) |
| 2087 | { |
| 2088 | MagickBooleanType |
| 2089 | status; |
| 2090 | |
| 2091 | assert(wand != (MagickWand *) NULL); |
| 2092 | assert(wand->signature == WandSignature); |
| 2093 | if (wand->debug != MagickFalse) |
| 2094 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2095 | if (wand->images == (Image *) NULL) |
| 2096 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2097 | status=ContrastStretchImageChannel(wand->images,channel,black_point, |
| 2098 | white_point); |
| 2099 | if (status == MagickFalse) |
| 2100 | InheritException(wand->exception,&wand->images->exception); |
| 2101 | return(status); |
| 2102 | } |
| 2103 | |
| 2104 | /* |
| 2105 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2106 | % % |
| 2107 | % % |
| 2108 | % % |
| 2109 | % M a g i c k C o n v o l v e I m a g e % |
| 2110 | % % |
| 2111 | % % |
| 2112 | % % |
| 2113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2114 | % |
| 2115 | % MagickConvolveImage() applies a custom convolution kernel to the image. |
| 2116 | % |
| 2117 | % The format of the MagickConvolveImage method is: |
| 2118 | % |
| 2119 | % MagickBooleanType MagickConvolveImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2120 | % const size_t order,const double *kernel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2121 | % MagickBooleanType MagickConvolveImageChannel(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2122 | % const ChannelType channel,const size_t order, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2123 | % const double *kernel) |
| 2124 | % |
| 2125 | % A description of each parameter follows: |
| 2126 | % |
| 2127 | % o wand: the magick wand. |
| 2128 | % |
| 2129 | % o channel: the image channel(s). |
| 2130 | % |
| 2131 | % o order: the number of columns and rows in the filter kernel. |
| 2132 | % |
| 2133 | % o kernel: An array of doubles representing the convolution kernel. |
| 2134 | % |
| 2135 | */ |
| 2136 | |
| 2137 | WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2138 | const size_t order,const double *kernel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2139 | { |
| 2140 | MagickBooleanType |
| 2141 | status; |
| 2142 | |
| 2143 | status=MagickConvolveImageChannel(wand,DefaultChannels,order,kernel); |
| 2144 | return(status); |
| 2145 | } |
| 2146 | |
| 2147 | WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2148 | const ChannelType channel,const size_t order,const double *kernel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2149 | { |
| 2150 | Image |
| 2151 | *convolve_image; |
| 2152 | |
| 2153 | assert(wand != (MagickWand *) NULL); |
| 2154 | assert(wand->signature == WandSignature); |
| 2155 | if (wand->debug != MagickFalse) |
| 2156 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2157 | if (kernel == (const double *) NULL) |
| 2158 | return(MagickFalse); |
| 2159 | if (wand->images == (Image *) NULL) |
| 2160 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2161 | convolve_image=ConvolveImageChannel(wand->images,channel,order,kernel, |
| 2162 | wand->exception); |
| 2163 | if (convolve_image == (Image *) NULL) |
| 2164 | return(MagickFalse); |
| 2165 | ReplaceImageInList(&wand->images,convolve_image); |
| 2166 | return(MagickTrue); |
| 2167 | } |
| 2168 | |
| 2169 | /* |
| 2170 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2171 | % % |
| 2172 | % % |
| 2173 | % % |
| 2174 | % M a g i c k C r o p I m a g e % |
| 2175 | % % |
| 2176 | % % |
| 2177 | % % |
| 2178 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2179 | % |
| 2180 | % MagickCropImage() extracts a region of the image. |
| 2181 | % |
| 2182 | % The format of the MagickCropImage method is: |
| 2183 | % |
| 2184 | % MagickBooleanType MagickCropImage(MagickWand *wand, |
cristy | 5ed838e | 2010-05-31 00:05:35 +0000 | [diff] [blame] | 2185 | % const size_t width,const size_t height,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2186 | % |
| 2187 | % A description of each parameter follows: |
| 2188 | % |
| 2189 | % o wand: the magick wand. |
| 2190 | % |
| 2191 | % o width: the region width. |
| 2192 | % |
| 2193 | % o height: the region height. |
| 2194 | % |
| 2195 | % o x: the region x-offset. |
| 2196 | % |
| 2197 | % o y: the region y-offset. |
| 2198 | % |
| 2199 | */ |
| 2200 | WandExport MagickBooleanType MagickCropImage(MagickWand *wand, |
cristy | 5ed838e | 2010-05-31 00:05:35 +0000 | [diff] [blame] | 2201 | const size_t width,const size_t height,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2202 | { |
| 2203 | Image |
| 2204 | *crop_image; |
| 2205 | |
| 2206 | RectangleInfo |
| 2207 | crop; |
| 2208 | |
| 2209 | assert(wand != (MagickWand *) NULL); |
| 2210 | assert(wand->signature == WandSignature); |
| 2211 | if (wand->debug != MagickFalse) |
| 2212 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2213 | if (wand->images == (Image *) NULL) |
| 2214 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2215 | crop.width=width; |
| 2216 | crop.height=height; |
| 2217 | crop.x=x; |
| 2218 | crop.y=y; |
| 2219 | crop_image=CropImage(wand->images,&crop,wand->exception); |
| 2220 | if (crop_image == (Image *) NULL) |
| 2221 | return(MagickFalse); |
| 2222 | ReplaceImageInList(&wand->images,crop_image); |
| 2223 | return(MagickTrue); |
| 2224 | } |
| 2225 | |
| 2226 | /* |
| 2227 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2228 | % % |
| 2229 | % % |
| 2230 | % % |
| 2231 | % M a g i c k C y c l e C o l o r m a p I m a g e % |
| 2232 | % % |
| 2233 | % % |
| 2234 | % % |
| 2235 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2236 | % |
| 2237 | % MagickCycleColormapImage() displaces an image's colormap by a given number |
| 2238 | % of positions. If you cycle the colormap a number of times you can produce |
| 2239 | % a psychodelic effect. |
| 2240 | % |
| 2241 | % The format of the MagickCycleColormapImage method is: |
| 2242 | % |
| 2243 | % MagickBooleanType MagickCycleColormapImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2244 | % const ssize_t displace) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2245 | % |
| 2246 | % A description of each parameter follows: |
| 2247 | % |
| 2248 | % o wand: the magick wand. |
| 2249 | % |
| 2250 | % o pixel_wand: the pixel wand. |
| 2251 | % |
| 2252 | */ |
| 2253 | WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2254 | const ssize_t displace) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2255 | { |
| 2256 | MagickBooleanType |
| 2257 | status; |
| 2258 | |
| 2259 | assert(wand != (MagickWand *) NULL); |
| 2260 | assert(wand->signature == WandSignature); |
| 2261 | if (wand->debug != MagickFalse) |
| 2262 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2263 | if (wand->images == (Image *) NULL) |
| 2264 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2265 | status=CycleColormapImage(wand->images,displace); |
| 2266 | if (status == MagickFalse) |
| 2267 | InheritException(wand->exception,&wand->images->exception); |
| 2268 | return(status); |
| 2269 | } |
| 2270 | |
| 2271 | /* |
| 2272 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2273 | % % |
| 2274 | % % |
| 2275 | % % |
| 2276 | % M a g i c k C o n s t i t u t e I m a g e % |
| 2277 | % % |
| 2278 | % % |
| 2279 | % % |
| 2280 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2281 | % |
| 2282 | % MagickConstituteImage() adds an image to the wand comprised of the pixel |
| 2283 | % data you supply. The pixel data must be in scanline order top-to-bottom. |
| 2284 | % The data can be char, short int, int, float, or double. Float and double |
| 2285 | % require the pixels to be normalized [0..1], otherwise [0..Max], where Max |
| 2286 | % is the maximum value the type can accomodate (e.g. 255 for char). For |
| 2287 | % example, to create a 640x480 image from unsigned red-green-blue character |
| 2288 | % data, use |
| 2289 | % |
| 2290 | % MagickConstituteImage(wand,640,640,"RGB",CharPixel,pixels); |
| 2291 | % |
| 2292 | % The format of the MagickConstituteImage method is: |
| 2293 | % |
| 2294 | % MagickBooleanType MagickConstituteImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2295 | % const size_t columns,const size_t rows,const char *map, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2296 | % const StorageType storage,void *pixels) |
| 2297 | % |
| 2298 | % A description of each parameter follows: |
| 2299 | % |
| 2300 | % o wand: the magick wand. |
| 2301 | % |
| 2302 | % o columns: width in pixels of the image. |
| 2303 | % |
| 2304 | % o rows: height in pixels of the image. |
| 2305 | % |
| 2306 | % o map: This string reflects the expected ordering of the pixel array. |
| 2307 | % It can be any combination or order of R = red, G = green, B = blue, |
| 2308 | % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, |
| 2309 | % Y = yellow, M = magenta, K = black, I = intensity (for grayscale), |
| 2310 | % P = pad. |
| 2311 | % |
| 2312 | % o storage: Define the data type of the pixels. Float and double types are |
| 2313 | % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from |
| 2314 | % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, |
| 2315 | % LongPixel, QuantumPixel, or ShortPixel. |
| 2316 | % |
| 2317 | % o pixels: This array of values contain the pixel components as defined by |
| 2318 | % map and type. You must preallocate this array where the expected |
| 2319 | % length varies depending on the values of width, height, map, and type. |
| 2320 | % |
| 2321 | % |
| 2322 | */ |
| 2323 | WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2324 | const size_t columns,const size_t rows,const char *map, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2325 | const StorageType storage,const void *pixels) |
| 2326 | { |
| 2327 | Image |
| 2328 | *images; |
| 2329 | |
| 2330 | assert(wand != (MagickWand *) NULL); |
| 2331 | assert(wand->signature == WandSignature); |
| 2332 | if (wand->debug != MagickFalse) |
| 2333 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2334 | images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception); |
| 2335 | if (images == (Image *) NULL) |
| 2336 | return(MagickFalse); |
| 2337 | return(InsertImageInWand(wand,images)); |
| 2338 | } |
| 2339 | |
| 2340 | /* |
| 2341 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2342 | % % |
| 2343 | % % |
| 2344 | % % |
| 2345 | % M a g i c k D e c i p h e r I m a g e % |
| 2346 | % % |
| 2347 | % % |
| 2348 | % % |
| 2349 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2350 | % |
| 2351 | % MagickDecipherImage() converts cipher pixels to plain pixels. |
| 2352 | % |
| 2353 | % The format of the MagickDecipherImage method is: |
| 2354 | % |
| 2355 | % MagickBooleanType MagickDecipherImage(MagickWand *wand, |
| 2356 | % const char *passphrase) |
| 2357 | % |
| 2358 | % A description of each parameter follows: |
| 2359 | % |
| 2360 | % o wand: the magick wand. |
| 2361 | % |
| 2362 | % o passphrase: the passphrase. |
| 2363 | % |
| 2364 | */ |
| 2365 | WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand, |
| 2366 | const char *passphrase) |
| 2367 | { |
| 2368 | assert(wand != (MagickWand *) NULL); |
| 2369 | assert(wand->signature == WandSignature); |
| 2370 | if (wand->debug != MagickFalse) |
| 2371 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2372 | if (wand->images == (Image *) NULL) |
| 2373 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2374 | return(DecipherImage(wand->images,passphrase,&wand->images->exception)); |
| 2375 | } |
| 2376 | |
| 2377 | /* |
| 2378 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2379 | % % |
| 2380 | % % |
| 2381 | % % |
| 2382 | % M a g i c k D e c o n s t r u c t I m a g e s % |
| 2383 | % % |
| 2384 | % % |
| 2385 | % % |
| 2386 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2387 | % |
| 2388 | % MagickDeconstructImages() compares each image with the next in a sequence |
| 2389 | % and returns the maximum bounding region of any pixel differences it |
| 2390 | % discovers. |
| 2391 | % |
| 2392 | % The format of the MagickDeconstructImages method is: |
| 2393 | % |
| 2394 | % MagickWand *MagickDeconstructImages(MagickWand *wand) |
| 2395 | % |
| 2396 | % A description of each parameter follows: |
| 2397 | % |
| 2398 | % o wand: the magick wand. |
| 2399 | % |
| 2400 | */ |
| 2401 | WandExport MagickWand *MagickDeconstructImages(MagickWand *wand) |
| 2402 | { |
| 2403 | Image |
| 2404 | *deconstruct_image; |
| 2405 | |
| 2406 | assert(wand != (MagickWand *) NULL); |
| 2407 | assert(wand->signature == WandSignature); |
| 2408 | if (wand->debug != MagickFalse) |
| 2409 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2410 | if (wand->images == (Image *) NULL) |
| 2411 | return((MagickWand *) NULL); |
| 2412 | deconstruct_image=DeconstructImages(wand->images,wand->exception); |
| 2413 | if (deconstruct_image == (Image *) NULL) |
| 2414 | return((MagickWand *) NULL); |
| 2415 | return(CloneMagickWandFromImages(wand,deconstruct_image)); |
| 2416 | } |
| 2417 | |
| 2418 | /* |
| 2419 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2420 | % % |
| 2421 | % % |
| 2422 | % % |
| 2423 | % M a g i c k D e s k e w I m a g e % |
| 2424 | % % |
| 2425 | % % |
| 2426 | % % |
| 2427 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2428 | % |
| 2429 | % MagickDeskewImage() removes skew from the image. Skew is an artifact that |
| 2430 | % occurs in scanned images because of the camera being misaligned, |
| 2431 | % imperfections in the scanning or surface, or simply because the paper was |
| 2432 | % not placed completely flat when scanned. |
| 2433 | % |
| 2434 | % The format of the MagickDeskewImage method is: |
| 2435 | % |
| 2436 | % MagickBooleanType MagickDeskewImage(MagickWand *wand, |
| 2437 | % const double threshold) |
| 2438 | % |
| 2439 | % A description of each parameter follows: |
| 2440 | % |
| 2441 | % o wand: the magick wand. |
| 2442 | % |
| 2443 | % o threshold: separate background from foreground. |
| 2444 | % |
| 2445 | */ |
| 2446 | WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand, |
| 2447 | const double threshold) |
| 2448 | { |
| 2449 | Image |
| 2450 | *sepia_image; |
| 2451 | |
| 2452 | assert(wand != (MagickWand *) NULL); |
| 2453 | assert(wand->signature == WandSignature); |
| 2454 | if (wand->debug != MagickFalse) |
| 2455 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2456 | if (wand->images == (Image *) NULL) |
| 2457 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2458 | sepia_image=DeskewImage(wand->images,threshold,wand->exception); |
| 2459 | if (sepia_image == (Image *) NULL) |
| 2460 | return(MagickFalse); |
| 2461 | ReplaceImageInList(&wand->images,sepia_image); |
| 2462 | return(MagickTrue); |
| 2463 | } |
| 2464 | |
| 2465 | /* |
| 2466 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2467 | % % |
| 2468 | % % |
| 2469 | % % |
| 2470 | % M a g i c k D e s p e c k l e I m a g e % |
| 2471 | % % |
| 2472 | % % |
| 2473 | % % |
| 2474 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2475 | % |
| 2476 | % MagickDespeckleImage() reduces the speckle noise in an image while |
| 2477 | % perserving the edges of the original image. |
| 2478 | % |
| 2479 | % The format of the MagickDespeckleImage method is: |
| 2480 | % |
| 2481 | % MagickBooleanType MagickDespeckleImage(MagickWand *wand) |
| 2482 | % |
| 2483 | % A description of each parameter follows: |
| 2484 | % |
| 2485 | % o wand: the magick wand. |
| 2486 | % |
| 2487 | */ |
| 2488 | WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand) |
| 2489 | { |
| 2490 | Image |
| 2491 | *despeckle_image; |
| 2492 | |
| 2493 | assert(wand != (MagickWand *) NULL); |
| 2494 | assert(wand->signature == WandSignature); |
| 2495 | if (wand->debug != MagickFalse) |
| 2496 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2497 | if (wand->images == (Image *) NULL) |
| 2498 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2499 | despeckle_image=DespeckleImage(wand->images,wand->exception); |
| 2500 | if (despeckle_image == (Image *) NULL) |
| 2501 | return(MagickFalse); |
| 2502 | ReplaceImageInList(&wand->images,despeckle_image); |
| 2503 | return(MagickTrue); |
| 2504 | } |
| 2505 | |
| 2506 | /* |
| 2507 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2508 | % % |
| 2509 | % % |
| 2510 | % % |
| 2511 | % M a g i c k D e s t r o y I m a g e % |
| 2512 | % % |
| 2513 | % % |
| 2514 | % % |
| 2515 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2516 | % |
| 2517 | % MagickDestroyImage() dereferences an image, deallocating memory associated |
| 2518 | % with the image if the reference count becomes zero. |
| 2519 | % |
| 2520 | % The format of the MagickDestroyImage method is: |
| 2521 | % |
| 2522 | % Image *MagickDestroyImage(Image *image) |
| 2523 | % |
| 2524 | % A description of each parameter follows: |
| 2525 | % |
| 2526 | % o image: the image. |
| 2527 | % |
| 2528 | */ |
| 2529 | WandExport Image *MagickDestroyImage(Image *image) |
| 2530 | { |
| 2531 | return(DestroyImage(image)); |
| 2532 | } |
| 2533 | |
| 2534 | /* |
| 2535 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2536 | % % |
| 2537 | % % |
| 2538 | % % |
| 2539 | % M a g i c k D i s p l a y I m a g e % |
| 2540 | % % |
| 2541 | % % |
| 2542 | % % |
| 2543 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2544 | % |
| 2545 | % MagickDisplayImage() displays an image. |
| 2546 | % |
| 2547 | % The format of the MagickDisplayImage method is: |
| 2548 | % |
| 2549 | % MagickBooleanType MagickDisplayImage(MagickWand *wand, |
| 2550 | % const char *server_name) |
| 2551 | % |
| 2552 | % A description of each parameter follows: |
| 2553 | % |
| 2554 | % o wand: the magick wand. |
| 2555 | % |
| 2556 | % o server_name: the X server name. |
| 2557 | % |
| 2558 | */ |
| 2559 | WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand, |
| 2560 | const char *server_name) |
| 2561 | { |
| 2562 | Image |
| 2563 | *image; |
| 2564 | |
| 2565 | MagickBooleanType |
| 2566 | status; |
| 2567 | |
| 2568 | assert(wand != (MagickWand *) NULL); |
| 2569 | assert(wand->signature == WandSignature); |
| 2570 | if (wand->debug != MagickFalse) |
| 2571 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2572 | if (wand->images == (Image *) NULL) |
| 2573 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2574 | image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 2575 | if (image == (Image *) NULL) |
| 2576 | return(MagickFalse); |
| 2577 | (void) CloneString(&wand->image_info->server_name,server_name); |
| 2578 | status=DisplayImages(wand->image_info,image); |
| 2579 | if (status == MagickFalse) |
| 2580 | InheritException(wand->exception,&image->exception); |
| 2581 | image=DestroyImage(image); |
| 2582 | return(status); |
| 2583 | } |
| 2584 | |
| 2585 | /* |
| 2586 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2587 | % % |
| 2588 | % % |
| 2589 | % % |
| 2590 | % M a g i c k D i s p l a y I m a g e s % |
| 2591 | % % |
| 2592 | % % |
| 2593 | % % |
| 2594 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2595 | % |
| 2596 | % MagickDisplayImages() displays an image or image sequence. |
| 2597 | % |
| 2598 | % The format of the MagickDisplayImages method is: |
| 2599 | % |
| 2600 | % MagickBooleanType MagickDisplayImages(MagickWand *wand, |
| 2601 | % const char *server_name) |
| 2602 | % |
| 2603 | % A description of each parameter follows: |
| 2604 | % |
| 2605 | % o wand: the magick wand. |
| 2606 | % |
| 2607 | % o server_name: the X server name. |
| 2608 | % |
| 2609 | */ |
| 2610 | WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand, |
| 2611 | const char *server_name) |
| 2612 | { |
| 2613 | MagickBooleanType |
| 2614 | status; |
| 2615 | |
| 2616 | assert(wand != (MagickWand *) NULL); |
| 2617 | assert(wand->signature == WandSignature); |
| 2618 | if (wand->debug != MagickFalse) |
| 2619 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2620 | (void) CloneString(&wand->image_info->server_name,server_name); |
| 2621 | status=DisplayImages(wand->image_info,wand->images); |
| 2622 | if (status == MagickFalse) |
| 2623 | InheritException(wand->exception,&wand->images->exception); |
| 2624 | return(status); |
| 2625 | } |
| 2626 | |
| 2627 | /* |
| 2628 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2629 | % % |
| 2630 | % % |
| 2631 | % % |
| 2632 | % M a g i c k D i s t o r t I m a g e % |
| 2633 | % % |
| 2634 | % % |
| 2635 | % % |
| 2636 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2637 | % |
| 2638 | % MagickDistortImage() distorts an image using various distortion methods, by |
| 2639 | % mapping color lookups of the source image to a new destination image |
| 2640 | % usally of the same size as the source image, unless 'bestfit' is set to |
| 2641 | % true. |
| 2642 | % |
| 2643 | % If 'bestfit' is enabled, and distortion allows it, the destination image is |
| 2644 | % adjusted to ensure the whole source 'image' will just fit within the final |
| 2645 | % destination image, which will be sized and offset accordingly. Also in |
| 2646 | % many cases the virtual offset of the source image will be taken into |
| 2647 | % account in the mapping. |
| 2648 | % |
| 2649 | % The format of the MagickDistortImage method is: |
| 2650 | % |
| 2651 | % MagickBooleanType MagickDistortImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2652 | % const DistortImageMethod method,const size_t number_arguments, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2653 | % const double *arguments,const MagickBooleanType bestfit) |
| 2654 | % |
| 2655 | % A description of each parameter follows: |
| 2656 | % |
| 2657 | % o image: the image to be distorted. |
| 2658 | % |
| 2659 | % o method: the method of image distortion. |
| 2660 | % |
| 2661 | % ArcDistortion always ignores the source image offset, and always |
| 2662 | % 'bestfit' the destination image with the top left corner offset |
| 2663 | % relative to the polar mapping center. |
| 2664 | % |
| 2665 | % Bilinear has no simple inverse mapping so it does not allow 'bestfit' |
| 2666 | % style of image distortion. |
| 2667 | % |
| 2668 | % Affine, Perspective, and Bilinear, do least squares fitting of the |
| 2669 | % distortion when more than the minimum number of control point pairs |
| 2670 | % are provided. |
| 2671 | % |
| 2672 | % Perspective, and Bilinear, falls back to a Affine distortion when less |
| 2673 | % that 4 control point pairs are provided. While Affine distortions let |
| 2674 | % you use any number of control point pairs, that is Zero pairs is a |
| 2675 | % no-Op (viewport only) distrotion, one pair is a translation and two |
| 2676 | % pairs of control points do a scale-rotate-translate, without any |
| 2677 | % shearing. |
| 2678 | % |
| 2679 | % o number_arguments: the number of arguments given for this distortion |
| 2680 | % method. |
| 2681 | % |
| 2682 | % o arguments: the arguments for this distortion method. |
| 2683 | % |
| 2684 | % o bestfit: Attempt to resize destination to fit distorted source. |
| 2685 | % |
| 2686 | */ |
| 2687 | WandExport MagickBooleanType MagickDistortImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 2688 | const DistortImageMethod method,const size_t number_arguments, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 2689 | const double *arguments,const MagickBooleanType bestfit) |
| 2690 | { |
| 2691 | Image |
| 2692 | *distort_image; |
| 2693 | |
| 2694 | assert(wand != (MagickWand *) NULL); |
| 2695 | assert(wand->signature == WandSignature); |
| 2696 | if (wand->debug != MagickFalse) |
| 2697 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2698 | if (wand->images == (Image *) NULL) |
| 2699 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2700 | distort_image=DistortImage(wand->images,method,number_arguments,arguments, |
| 2701 | bestfit,wand->exception); |
| 2702 | if (distort_image == (Image *) NULL) |
| 2703 | return(MagickFalse); |
| 2704 | ReplaceImageInList(&wand->images,distort_image); |
| 2705 | return(MagickTrue); |
| 2706 | } |
| 2707 | |
| 2708 | /* |
| 2709 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2710 | % % |
| 2711 | % % |
| 2712 | % % |
| 2713 | % M a g i c k D r a w I m a g e % |
| 2714 | % % |
| 2715 | % % |
| 2716 | % % |
| 2717 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2718 | % |
| 2719 | % MagickDrawImage() renders the drawing wand on the current image. |
| 2720 | % |
| 2721 | % The format of the MagickDrawImage method is: |
| 2722 | % |
| 2723 | % MagickBooleanType MagickDrawImage(MagickWand *wand, |
| 2724 | % const DrawingWand *drawing_wand) |
| 2725 | % |
| 2726 | % A description of each parameter follows: |
| 2727 | % |
| 2728 | % o wand: the magick wand. |
| 2729 | % |
| 2730 | % o drawing_wand: the draw wand. |
| 2731 | % |
| 2732 | */ |
| 2733 | WandExport MagickBooleanType MagickDrawImage(MagickWand *wand, |
| 2734 | const DrawingWand *drawing_wand) |
| 2735 | { |
| 2736 | char |
| 2737 | *primitive; |
| 2738 | |
| 2739 | DrawInfo |
| 2740 | *draw_info; |
| 2741 | |
| 2742 | MagickBooleanType |
| 2743 | status; |
| 2744 | |
| 2745 | assert(wand != (MagickWand *) NULL); |
| 2746 | assert(wand->signature == WandSignature); |
| 2747 | if (wand->debug != MagickFalse) |
| 2748 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2749 | if (wand->images == (Image *) NULL) |
| 2750 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2751 | draw_info=PeekDrawingWand(drawing_wand); |
| 2752 | if ((draw_info == (DrawInfo *) NULL) || |
| 2753 | (draw_info->primitive == (char *) NULL)) |
| 2754 | return(MagickFalse); |
| 2755 | primitive=AcquireString(draw_info->primitive); |
| 2756 | draw_info=DestroyDrawInfo(draw_info); |
| 2757 | draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); |
| 2758 | draw_info->primitive=primitive; |
| 2759 | status=DrawImage(wand->images,draw_info); |
| 2760 | if (status == MagickFalse) |
| 2761 | InheritException(wand->exception,&wand->images->exception); |
| 2762 | draw_info=DestroyDrawInfo(draw_info); |
| 2763 | return(status); |
| 2764 | } |
| 2765 | |
| 2766 | /* |
| 2767 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2768 | % % |
| 2769 | % % |
| 2770 | % % |
| 2771 | % M a g i c k E d g e I m a g e % |
| 2772 | % % |
| 2773 | % % |
| 2774 | % % |
| 2775 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2776 | % |
| 2777 | % MagickEdgeImage() enhance edges within the image with a convolution filter |
| 2778 | % of the given radius. Use a radius of 0 and Edge() selects a suitable |
| 2779 | % radius for you. |
| 2780 | % |
| 2781 | % The format of the MagickEdgeImage method is: |
| 2782 | % |
| 2783 | % MagickBooleanType MagickEdgeImage(MagickWand *wand,const double radius) |
| 2784 | % |
| 2785 | % A description of each parameter follows: |
| 2786 | % |
| 2787 | % o wand: the magick wand. |
| 2788 | % |
| 2789 | % o radius: the radius of the pixel neighborhood. |
| 2790 | % |
| 2791 | */ |
| 2792 | WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand, |
| 2793 | const double radius) |
| 2794 | { |
| 2795 | Image |
| 2796 | *edge_image; |
| 2797 | |
| 2798 | assert(wand != (MagickWand *) NULL); |
| 2799 | assert(wand->signature == WandSignature); |
| 2800 | if (wand->debug != MagickFalse) |
| 2801 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2802 | if (wand->images == (Image *) NULL) |
| 2803 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2804 | edge_image=EdgeImage(wand->images,radius,wand->exception); |
| 2805 | if (edge_image == (Image *) NULL) |
| 2806 | return(MagickFalse); |
| 2807 | ReplaceImageInList(&wand->images,edge_image); |
| 2808 | return(MagickTrue); |
| 2809 | } |
| 2810 | |
| 2811 | /* |
| 2812 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2813 | % % |
| 2814 | % % |
| 2815 | % % |
| 2816 | % M a g i c k E m b o s s I m a g e % |
| 2817 | % % |
| 2818 | % % |
| 2819 | % % |
| 2820 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2821 | % |
| 2822 | % MagickEmbossImage() returns a grayscale image with a three-dimensional |
| 2823 | % effect. We convolve the image with a Gaussian operator of the given radius |
| 2824 | % and standard deviation (sigma). For reasonable results, radius should be |
| 2825 | % larger than sigma. Use a radius of 0 and Emboss() selects a suitable |
| 2826 | % radius for you. |
| 2827 | % |
| 2828 | % The format of the MagickEmbossImage method is: |
| 2829 | % |
| 2830 | % MagickBooleanType MagickEmbossImage(MagickWand *wand,const double radius, |
| 2831 | % const double sigma) |
| 2832 | % |
| 2833 | % A description of each parameter follows: |
| 2834 | % |
| 2835 | % o wand: the magick wand. |
| 2836 | % |
| 2837 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 2838 | % pixel. |
| 2839 | % |
| 2840 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 2841 | % |
| 2842 | */ |
| 2843 | WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand, |
| 2844 | const double radius,const double sigma) |
| 2845 | { |
| 2846 | Image |
| 2847 | *emboss_image; |
| 2848 | |
| 2849 | assert(wand != (MagickWand *) NULL); |
| 2850 | assert(wand->signature == WandSignature); |
| 2851 | if (wand->debug != MagickFalse) |
| 2852 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2853 | if (wand->images == (Image *) NULL) |
| 2854 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2855 | emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception); |
| 2856 | if (emboss_image == (Image *) NULL) |
| 2857 | return(MagickFalse); |
| 2858 | ReplaceImageInList(&wand->images,emboss_image); |
| 2859 | return(MagickTrue); |
| 2860 | } |
| 2861 | |
| 2862 | /* |
| 2863 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2864 | % % |
| 2865 | % % |
| 2866 | % % |
| 2867 | % M a g i c k E n c i p h e r I m a g e % |
| 2868 | % % |
| 2869 | % % |
| 2870 | % % |
| 2871 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2872 | % |
| 2873 | % MagickEncipherImage() converts plaint pixels to cipher pixels. |
| 2874 | % |
| 2875 | % The format of the MagickEncipherImage method is: |
| 2876 | % |
| 2877 | % MagickBooleanType MagickEncipherImage(MagickWand *wand, |
| 2878 | % const char *passphrase) |
| 2879 | % |
| 2880 | % A description of each parameter follows: |
| 2881 | % |
| 2882 | % o wand: the magick wand. |
| 2883 | % |
| 2884 | % o passphrase: the passphrase. |
| 2885 | % |
| 2886 | */ |
| 2887 | WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand, |
| 2888 | const char *passphrase) |
| 2889 | { |
| 2890 | assert(wand != (MagickWand *) NULL); |
| 2891 | assert(wand->signature == WandSignature); |
| 2892 | if (wand->debug != MagickFalse) |
| 2893 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2894 | if (wand->images == (Image *) NULL) |
| 2895 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2896 | return(EncipherImage(wand->images,passphrase,&wand->images->exception)); |
| 2897 | } |
| 2898 | |
| 2899 | /* |
| 2900 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2901 | % % |
| 2902 | % % |
| 2903 | % % |
| 2904 | % M a g i c k E n h a n c e I m a g e % |
| 2905 | % % |
| 2906 | % % |
| 2907 | % % |
| 2908 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2909 | % |
| 2910 | % MagickEnhanceImage() applies a digital filter that improves the quality of a |
| 2911 | % noisy image. |
| 2912 | % |
| 2913 | % The format of the MagickEnhanceImage method is: |
| 2914 | % |
| 2915 | % MagickBooleanType MagickEnhanceImage(MagickWand *wand) |
| 2916 | % |
| 2917 | % A description of each parameter follows: |
| 2918 | % |
| 2919 | % o wand: the magick wand. |
| 2920 | % |
| 2921 | */ |
| 2922 | WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand) |
| 2923 | { |
| 2924 | Image |
| 2925 | *enhance_image; |
| 2926 | |
| 2927 | assert(wand != (MagickWand *) NULL); |
| 2928 | assert(wand->signature == WandSignature); |
| 2929 | if (wand->debug != MagickFalse) |
| 2930 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2931 | if (wand->images == (Image *) NULL) |
| 2932 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2933 | enhance_image=EnhanceImage(wand->images,wand->exception); |
| 2934 | if (enhance_image == (Image *) NULL) |
| 2935 | return(MagickFalse); |
| 2936 | ReplaceImageInList(&wand->images,enhance_image); |
| 2937 | return(MagickTrue); |
| 2938 | } |
| 2939 | |
| 2940 | /* |
| 2941 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2942 | % % |
| 2943 | % % |
| 2944 | % % |
| 2945 | % M a g i c k E q u a l i z e I m a g e % |
| 2946 | % % |
| 2947 | % % |
| 2948 | % % |
| 2949 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2950 | % |
| 2951 | % MagickEqualizeImage() equalizes the image histogram. |
| 2952 | % |
| 2953 | % The format of the MagickEqualizeImage method is: |
| 2954 | % |
| 2955 | % MagickBooleanType MagickEqualizeImage(MagickWand *wand) |
| 2956 | % MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand, |
| 2957 | % const ChannelType channel) |
| 2958 | % |
| 2959 | % A description of each parameter follows: |
| 2960 | % |
| 2961 | % o wand: the magick wand. |
| 2962 | % |
| 2963 | % o channel: the image channel(s). |
| 2964 | % |
| 2965 | */ |
| 2966 | |
| 2967 | WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand) |
| 2968 | { |
| 2969 | MagickBooleanType |
| 2970 | status; |
| 2971 | |
| 2972 | status=MagickEqualizeImageChannel(wand,DefaultChannels); |
| 2973 | return(status); |
| 2974 | } |
| 2975 | |
| 2976 | WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand, |
| 2977 | const ChannelType channel) |
| 2978 | { |
| 2979 | MagickBooleanType |
| 2980 | status; |
| 2981 | |
| 2982 | assert(wand != (MagickWand *) NULL); |
| 2983 | assert(wand->signature == WandSignature); |
| 2984 | if (wand->debug != MagickFalse) |
| 2985 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 2986 | if (wand->images == (Image *) NULL) |
| 2987 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 2988 | status=EqualizeImageChannel(wand->images,channel); |
| 2989 | if (status == MagickFalse) |
| 2990 | InheritException(wand->exception,&wand->images->exception); |
| 2991 | return(status); |
| 2992 | } |
| 2993 | |
| 2994 | /* |
| 2995 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2996 | % % |
| 2997 | % % |
| 2998 | % % |
| 2999 | % M a g i c k E v a l u a t e I m a g e % |
| 3000 | % % |
| 3001 | % % |
| 3002 | % % |
| 3003 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3004 | % |
| 3005 | % MagickEvaluateImage() applys an arithmetic, relational, or logical |
| 3006 | % expression to an image. Use these operators to lighten or darken an image, |
| 3007 | % to increase or decrease contrast in an image, or to produce the "negative" |
| 3008 | % of an image. |
| 3009 | % |
| 3010 | % The format of the MagickEvaluateImage method is: |
| 3011 | % |
| 3012 | % MagickBooleanType MagickEvaluateImage(MagickWand *wand, |
| 3013 | % const MagickEvaluateOperator operator,const double value) |
cristy | d18ae7c | 2010-03-07 17:39:52 +0000 | [diff] [blame] | 3014 | % MagickBooleanType MagickEvaluateImages(MagickWand *wand, |
| 3015 | % const MagickEvaluateOperator operator) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3016 | % MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, |
| 3017 | % const ChannelType channel,const MagickEvaluateOperator op, |
| 3018 | % const double value) |
| 3019 | % |
| 3020 | % A description of each parameter follows: |
| 3021 | % |
| 3022 | % o wand: the magick wand. |
| 3023 | % |
| 3024 | % o channel: the channel(s). |
| 3025 | % |
| 3026 | % o op: A channel operator. |
| 3027 | % |
| 3028 | % o value: A value value. |
| 3029 | % |
| 3030 | */ |
| 3031 | |
| 3032 | WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand, |
| 3033 | const MagickEvaluateOperator op,const double value) |
| 3034 | { |
| 3035 | MagickBooleanType |
| 3036 | status; |
| 3037 | |
| 3038 | assert(wand != (MagickWand *) NULL); |
| 3039 | assert(wand->signature == WandSignature); |
| 3040 | if (wand->debug != MagickFalse) |
| 3041 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3042 | if (wand->images == (Image *) NULL) |
| 3043 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3044 | status=EvaluateImage(wand->images,op,value,&wand->images->exception); |
| 3045 | if (status == MagickFalse) |
| 3046 | InheritException(wand->exception,&wand->images->exception); |
| 3047 | return(status); |
| 3048 | } |
| 3049 | |
cristy | d18ae7c | 2010-03-07 17:39:52 +0000 | [diff] [blame] | 3050 | WandExport MagickWand *MagickEvaluateImages(MagickWand *wand, |
| 3051 | const MagickEvaluateOperator op) |
| 3052 | { |
| 3053 | Image |
| 3054 | *evaluate_image; |
| 3055 | |
| 3056 | assert(wand != (MagickWand *) NULL); |
| 3057 | assert(wand->signature == WandSignature); |
| 3058 | if (wand->debug != MagickFalse) |
| 3059 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3060 | if (wand->images == (Image *) NULL) |
| 3061 | return((MagickWand *) NULL); |
| 3062 | evaluate_image=EvaluateImages(wand->images,op,wand->exception); |
| 3063 | if (evaluate_image == (Image *) NULL) |
| 3064 | return((MagickWand *) NULL); |
| 3065 | return(CloneMagickWandFromImages(wand,evaluate_image)); |
| 3066 | } |
| 3067 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3068 | WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, |
| 3069 | const ChannelType channel,const MagickEvaluateOperator op,const double value) |
| 3070 | { |
| 3071 | MagickBooleanType |
| 3072 | status; |
| 3073 | |
| 3074 | assert(wand != (MagickWand *) NULL); |
| 3075 | assert(wand->signature == WandSignature); |
| 3076 | if (wand->debug != MagickFalse) |
| 3077 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3078 | if (wand->images == (Image *) NULL) |
| 3079 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3080 | status=EvaluateImageChannel(wand->images,channel,op,value, |
| 3081 | &wand->images->exception); |
| 3082 | return(status); |
| 3083 | } |
| 3084 | |
| 3085 | /* |
| 3086 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3087 | % % |
| 3088 | % % |
| 3089 | % % |
| 3090 | % M a g i c k E x p o r t I m a g e P i x e l s % |
| 3091 | % % |
| 3092 | % % |
| 3093 | % % |
| 3094 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3095 | % |
| 3096 | % MagickExportImagePixels() extracts pixel data from an image and returns it |
| 3097 | % to you. The method returns MagickTrue on success otherwise MagickFalse if |
| 3098 | % an error is encountered. The data is returned as char, short int, int, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3099 | % ssize_t, float, or double in the order specified by map. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3100 | % |
| 3101 | % Suppose you want to extract the first scanline of a 640x480 image as |
| 3102 | % character data in red-green-blue order: |
| 3103 | % |
| 3104 | % MagickExportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels); |
| 3105 | % |
| 3106 | % The format of the MagickExportImagePixels method is: |
| 3107 | % |
| 3108 | % MagickBooleanType MagickExportImagePixels(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3109 | % const ssize_t x,const ssize_t y,const size_t columns, |
| 3110 | % const size_t rows,const char *map,const StorageType storage, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3111 | % void *pixels) |
| 3112 | % |
| 3113 | % A description of each parameter follows: |
| 3114 | % |
| 3115 | % o wand: the magick wand. |
| 3116 | % |
| 3117 | % o x, y, columns, rows: These values define the perimeter |
| 3118 | % of a region of pixels you want to extract. |
| 3119 | % |
| 3120 | % o map: This string reflects the expected ordering of the pixel array. |
| 3121 | % It can be any combination or order of R = red, G = green, B = blue, |
| 3122 | % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, |
| 3123 | % Y = yellow, M = magenta, K = black, I = intensity (for grayscale), |
| 3124 | % P = pad. |
| 3125 | % |
| 3126 | % o storage: Define the data type of the pixels. Float and double types are |
| 3127 | % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from |
| 3128 | % these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, |
| 3129 | % LongPixel, QuantumPixel, or ShortPixel. |
| 3130 | % |
| 3131 | % o pixels: This array of values contain the pixel components as defined by |
| 3132 | % map and type. You must preallocate this array where the expected |
| 3133 | % length varies depending on the values of width, height, map, and type. |
| 3134 | % |
| 3135 | */ |
| 3136 | WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3137 | const ssize_t x,const ssize_t y,const size_t columns, |
| 3138 | const size_t rows,const char *map,const StorageType storage, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3139 | void *pixels) |
| 3140 | { |
| 3141 | MagickBooleanType |
| 3142 | status; |
| 3143 | |
| 3144 | assert(wand != (MagickWand *) NULL); |
| 3145 | assert(wand->signature == WandSignature); |
| 3146 | if (wand->debug != MagickFalse) |
| 3147 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3148 | if (wand->images == (Image *) NULL) |
| 3149 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3150 | status=ExportImagePixels(wand->images,x,y,columns,rows,map, |
| 3151 | storage,pixels,wand->exception); |
| 3152 | if (status == MagickFalse) |
| 3153 | InheritException(wand->exception,&wand->images->exception); |
| 3154 | return(status); |
| 3155 | } |
| 3156 | |
| 3157 | /* |
| 3158 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3159 | % % |
| 3160 | % % |
| 3161 | % % |
| 3162 | % M a g i c k E x t e n t I m a g e % |
| 3163 | % % |
| 3164 | % % |
| 3165 | % % |
| 3166 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3167 | % |
| 3168 | % MagickExtentImage() extends the image as defined by the geometry, gravity, |
| 3169 | % and wand background color. Set the (x,y) offset of the geometry to move |
| 3170 | % the original wand relative to the extended wand. |
| 3171 | % |
| 3172 | % The format of the MagickExtentImage method is: |
| 3173 | % |
| 3174 | % MagickBooleanType MagickExtentImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3175 | % const size_t width,const size_t height,const ssize_t x, |
| 3176 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3177 | % |
| 3178 | % A description of each parameter follows: |
| 3179 | % |
| 3180 | % o wand: the magick wand. |
| 3181 | % |
| 3182 | % o width: the region width. |
| 3183 | % |
| 3184 | % o height: the region height. |
| 3185 | % |
| 3186 | % o x: the region x offset. |
| 3187 | % |
| 3188 | % o y: the region y offset. |
| 3189 | % |
| 3190 | */ |
| 3191 | WandExport MagickBooleanType MagickExtentImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3192 | const size_t width,const size_t height,const ssize_t x, |
| 3193 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3194 | { |
| 3195 | Image |
| 3196 | *extent_image; |
| 3197 | |
| 3198 | RectangleInfo |
| 3199 | extent; |
| 3200 | |
| 3201 | assert(wand != (MagickWand *) NULL); |
| 3202 | assert(wand->signature == WandSignature); |
| 3203 | if (wand->debug != MagickFalse) |
| 3204 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3205 | if (wand->images == (Image *) NULL) |
| 3206 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3207 | extent.width=width; |
| 3208 | extent.height=height; |
| 3209 | extent.x=x; |
| 3210 | extent.y=y; |
| 3211 | extent_image=ExtentImage(wand->images,&extent,wand->exception); |
| 3212 | if (extent_image == (Image *) NULL) |
| 3213 | return(MagickFalse); |
| 3214 | ReplaceImageInList(&wand->images,extent_image); |
| 3215 | return(MagickTrue); |
| 3216 | } |
| 3217 | |
| 3218 | /* |
| 3219 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3220 | % % |
| 3221 | % % |
| 3222 | % % |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3223 | % M a g i c k F i l t e r I m a g e % |
| 3224 | % % |
| 3225 | % % |
| 3226 | % % |
| 3227 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3228 | % |
| 3229 | % MagickFilterImage() applies a custom convolution kernel to the image. |
| 3230 | % |
| 3231 | % The format of the MagickFilterImage method is: |
| 3232 | % |
| 3233 | % MagickBooleanType MagickFilterImage(MagickWand *wand, |
cristy | 2be1538 | 2010-01-21 02:38:03 +0000 | [diff] [blame] | 3234 | % const KernelInfo *kernel) |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3235 | % MagickBooleanType MagickFilterImageChannel(MagickWand *wand, |
cristy | 2be1538 | 2010-01-21 02:38:03 +0000 | [diff] [blame] | 3236 | % const ChannelType channel,const KernelInfo *kernel) |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3237 | % |
| 3238 | % A description of each parameter follows: |
| 3239 | % |
| 3240 | % o wand: the magick wand. |
| 3241 | % |
| 3242 | % o channel: the image channel(s). |
| 3243 | % |
| 3244 | % o kernel: An array of doubles representing the convolution kernel. |
| 3245 | % |
| 3246 | */ |
| 3247 | |
| 3248 | WandExport MagickBooleanType MagickFilterImage(MagickWand *wand, |
cristy | 2be1538 | 2010-01-21 02:38:03 +0000 | [diff] [blame] | 3249 | const KernelInfo *kernel) |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3250 | { |
| 3251 | MagickBooleanType |
| 3252 | status; |
| 3253 | |
| 3254 | status=MagickFilterImageChannel(wand,DefaultChannels,kernel); |
| 3255 | return(status); |
| 3256 | } |
| 3257 | |
| 3258 | WandExport MagickBooleanType MagickFilterImageChannel(MagickWand *wand, |
cristy | 2be1538 | 2010-01-21 02:38:03 +0000 | [diff] [blame] | 3259 | const ChannelType channel,const KernelInfo *kernel) |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3260 | { |
| 3261 | Image |
| 3262 | *filter_image; |
| 3263 | |
| 3264 | assert(wand != (MagickWand *) NULL); |
| 3265 | assert(wand->signature == WandSignature); |
| 3266 | if (wand->debug != MagickFalse) |
| 3267 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
cristy | 2be1538 | 2010-01-21 02:38:03 +0000 | [diff] [blame] | 3268 | if (kernel == (const KernelInfo *) NULL) |
cristy | a7a3ef9 | 2010-01-06 18:50:42 +0000 | [diff] [blame] | 3269 | return(MagickFalse); |
| 3270 | if (wand->images == (Image *) NULL) |
| 3271 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3272 | filter_image=FilterImageChannel(wand->images,channel,kernel,wand->exception); |
| 3273 | if (filter_image == (Image *) NULL) |
| 3274 | return(MagickFalse); |
| 3275 | ReplaceImageInList(&wand->images,filter_image); |
| 3276 | return(MagickTrue); |
| 3277 | } |
| 3278 | |
| 3279 | /* |
| 3280 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3281 | % % |
| 3282 | % % |
| 3283 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3284 | % M a g i c k F l i p I m a g e % |
| 3285 | % % |
| 3286 | % % |
| 3287 | % % |
| 3288 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3289 | % |
| 3290 | % MagickFlipImage() creates a vertical mirror image by reflecting the pixels |
| 3291 | % around the central x-axis. |
| 3292 | % |
| 3293 | % The format of the MagickFlipImage method is: |
| 3294 | % |
| 3295 | % MagickBooleanType MagickFlipImage(MagickWand *wand) |
| 3296 | % |
| 3297 | % A description of each parameter follows: |
| 3298 | % |
| 3299 | % o wand: the magick wand. |
| 3300 | % |
| 3301 | */ |
| 3302 | WandExport MagickBooleanType MagickFlipImage(MagickWand *wand) |
| 3303 | { |
| 3304 | Image |
| 3305 | *flip_image; |
| 3306 | |
| 3307 | assert(wand != (MagickWand *) NULL); |
| 3308 | assert(wand->signature == WandSignature); |
| 3309 | if (wand->debug != MagickFalse) |
| 3310 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3311 | if (wand->images == (Image *) NULL) |
| 3312 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3313 | flip_image=FlipImage(wand->images,wand->exception); |
| 3314 | if (flip_image == (Image *) NULL) |
| 3315 | return(MagickFalse); |
| 3316 | ReplaceImageInList(&wand->images,flip_image); |
| 3317 | return(MagickTrue); |
| 3318 | } |
| 3319 | |
| 3320 | /* |
| 3321 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3322 | % % |
| 3323 | % % |
| 3324 | % % |
| 3325 | % M a g i c k F l o o d f i l l P a i n t I m a g e % |
| 3326 | % % |
| 3327 | % % |
| 3328 | % % |
| 3329 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3330 | % |
| 3331 | % MagickFloodfillPaintImage() changes the color value of any pixel that matches |
| 3332 | % target and is an immediate neighbor. If the method FillToBorderMethod is |
| 3333 | % specified, the color value is changed for any neighbor pixel that does not |
| 3334 | % match the bordercolor member of image. |
| 3335 | % |
| 3336 | % The format of the MagickFloodfillPaintImage method is: |
| 3337 | % |
| 3338 | % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, |
| 3339 | % const ChannelType channel,const PixelWand *fill,const double fuzz, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3340 | % const PixelWand *bordercolor,const ssize_t x,const ssize_t y, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3341 | % const MagickBooleanType invert) |
| 3342 | % |
| 3343 | % A description of each parameter follows: |
| 3344 | % |
| 3345 | % o wand: the magick wand. |
| 3346 | % |
| 3347 | % o channel: the channel(s). |
| 3348 | % |
| 3349 | % o fill: the floodfill color pixel wand. |
| 3350 | % |
| 3351 | % o fuzz: By default target must match a particular pixel color |
| 3352 | % exactly. However, in many cases two colors may differ by a small amount. |
| 3353 | % The fuzz member of image defines how much tolerance is acceptable to |
| 3354 | % consider two colors as the same. For example, set fuzz to 10 and the |
| 3355 | % color red at intensities of 100 and 102 respectively are now interpreted |
| 3356 | % as the same color for the purposes of the floodfill. |
| 3357 | % |
| 3358 | % o bordercolor: the border color pixel wand. |
| 3359 | % |
| 3360 | % o x,y: the starting location of the operation. |
| 3361 | % |
| 3362 | % o invert: paint any pixel that does not match the target color. |
| 3363 | % |
| 3364 | */ |
| 3365 | WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, |
| 3366 | const ChannelType channel,const PixelWand *fill,const double fuzz, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3367 | const PixelWand *bordercolor,const ssize_t x,const ssize_t y, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3368 | const MagickBooleanType invert) |
| 3369 | { |
| 3370 | DrawInfo |
| 3371 | *draw_info; |
| 3372 | |
| 3373 | MagickBooleanType |
| 3374 | status; |
| 3375 | |
| 3376 | MagickPixelPacket |
| 3377 | target; |
| 3378 | |
| 3379 | assert(wand != (MagickWand *) NULL); |
| 3380 | assert(wand->signature == WandSignature); |
| 3381 | if (wand->debug != MagickFalse) |
| 3382 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3383 | if (wand->images == (Image *) NULL) |
| 3384 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3385 | draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); |
| 3386 | PixelGetQuantumColor(fill,&draw_info->fill); |
| 3387 | (void) GetOneVirtualMagickPixel(wand->images,x % wand->images->columns, |
| 3388 | y % wand->images->rows,&target,wand->exception); |
| 3389 | if (bordercolor != (PixelWand *) NULL) |
| 3390 | PixelGetMagickColor(bordercolor,&target); |
| 3391 | wand->images->fuzz=fuzz; |
| 3392 | status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y, |
| 3393 | invert); |
| 3394 | if (status == MagickFalse) |
| 3395 | InheritException(wand->exception,&wand->images->exception); |
| 3396 | draw_info=DestroyDrawInfo(draw_info); |
| 3397 | return(status); |
| 3398 | } |
| 3399 | |
| 3400 | /* |
| 3401 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3402 | % % |
| 3403 | % % |
| 3404 | % % |
| 3405 | % M a g i c k F l o p I m a g e % |
| 3406 | % % |
| 3407 | % % |
| 3408 | % % |
| 3409 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3410 | % |
| 3411 | % MagickFlopImage() creates a horizontal mirror image by reflecting the pixels |
| 3412 | % around the central y-axis. |
| 3413 | % |
| 3414 | % The format of the MagickFlopImage method is: |
| 3415 | % |
| 3416 | % MagickBooleanType MagickFlopImage(MagickWand *wand) |
| 3417 | % |
| 3418 | % A description of each parameter follows: |
| 3419 | % |
| 3420 | % o wand: the magick wand. |
| 3421 | % |
| 3422 | */ |
| 3423 | WandExport MagickBooleanType MagickFlopImage(MagickWand *wand) |
| 3424 | { |
| 3425 | Image |
| 3426 | *flop_image; |
| 3427 | |
| 3428 | assert(wand != (MagickWand *) NULL); |
| 3429 | assert(wand->signature == WandSignature); |
| 3430 | if (wand->debug != MagickFalse) |
| 3431 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3432 | if (wand->images == (Image *) NULL) |
| 3433 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3434 | flop_image=FlopImage(wand->images,wand->exception); |
| 3435 | if (flop_image == (Image *) NULL) |
| 3436 | return(MagickFalse); |
| 3437 | ReplaceImageInList(&wand->images,flop_image); |
| 3438 | return(MagickTrue); |
| 3439 | } |
| 3440 | |
| 3441 | /* |
| 3442 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3443 | % % |
| 3444 | % % |
| 3445 | % % |
| 3446 | % M a g i c k F o u r i e r T r a n s f o r m I m a g e % |
| 3447 | % % |
| 3448 | % % |
| 3449 | % % |
| 3450 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3451 | % |
| 3452 | % MagickForwardFourierTransformImage() implements the discrete Fourier |
| 3453 | % transform (DFT) of the image either as a magnitude / phase or real / |
| 3454 | % imaginary image pair. |
| 3455 | % |
| 3456 | % The format of the MagickForwardFourierTransformImage method is: |
| 3457 | % |
| 3458 | % MagickBooleanType MagickForwardFourierTransformImage(MagickWand *wand, |
| 3459 | % const MagickBooleanType magnitude) |
| 3460 | % |
| 3461 | % A description of each parameter follows: |
| 3462 | % |
| 3463 | % o wand: the magick wand. |
| 3464 | % |
| 3465 | % o magnitude: if true, return as magnitude / phase pair otherwise a real / |
| 3466 | % imaginary image pair. |
| 3467 | % |
| 3468 | */ |
| 3469 | WandExport MagickBooleanType MagickForwardFourierTransformImage( |
| 3470 | MagickWand *wand,const MagickBooleanType magnitude) |
| 3471 | { |
| 3472 | Image |
| 3473 | *forward_image; |
| 3474 | |
| 3475 | assert(wand != (MagickWand *) NULL); |
| 3476 | assert(wand->signature == WandSignature); |
| 3477 | if (wand->debug != MagickFalse) |
| 3478 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3479 | if (wand->images == (Image *) NULL) |
| 3480 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3481 | forward_image=ForwardFourierTransformImage(wand->images,magnitude, |
| 3482 | wand->exception); |
| 3483 | if (forward_image == (Image *) NULL) |
| 3484 | return(MagickFalse); |
| 3485 | ReplaceImageInList(&wand->images,forward_image); |
| 3486 | return(MagickTrue); |
| 3487 | } |
| 3488 | |
| 3489 | /* |
| 3490 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3491 | % % |
| 3492 | % % |
| 3493 | % % |
| 3494 | % M a g i c k F r a m e I m a g e % |
| 3495 | % % |
| 3496 | % % |
| 3497 | % % |
| 3498 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3499 | % |
| 3500 | % MagickFrameImage() adds a simulated three-dimensional border around the |
| 3501 | % image. The width and height specify the border width of the vertical and |
| 3502 | % horizontal sides of the frame. The inner and outer bevels indicate the |
| 3503 | % width of the inner and outer shadows of the frame. |
| 3504 | % |
| 3505 | % The format of the MagickFrameImage method is: |
| 3506 | % |
| 3507 | % MagickBooleanType MagickFrameImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3508 | % const PixelWand *matte_color,const size_t width, |
| 3509 | % const size_t height,const ssize_t inner_bevel, |
| 3510 | % const ssize_t outer_bevel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3511 | % |
| 3512 | % A description of each parameter follows: |
| 3513 | % |
| 3514 | % o wand: the magick wand. |
| 3515 | % |
| 3516 | % o matte_color: the frame color pixel wand. |
| 3517 | % |
| 3518 | % o width: the border width. |
| 3519 | % |
| 3520 | % o height: the border height. |
| 3521 | % |
| 3522 | % o inner_bevel: the inner bevel width. |
| 3523 | % |
| 3524 | % o outer_bevel: the outer bevel width. |
| 3525 | % |
| 3526 | */ |
| 3527 | WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3528 | const PixelWand *matte_color,const size_t width, |
| 3529 | const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3530 | { |
| 3531 | Image |
| 3532 | *frame_image; |
| 3533 | |
| 3534 | FrameInfo |
| 3535 | frame_info; |
| 3536 | |
| 3537 | assert(wand != (MagickWand *) NULL); |
| 3538 | assert(wand->signature == WandSignature); |
| 3539 | if (wand->debug != MagickFalse) |
| 3540 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3541 | if (wand->images == (Image *) NULL) |
| 3542 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3543 | (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info)); |
| 3544 | frame_info.width=wand->images->columns+2*width; |
| 3545 | frame_info.height=wand->images->rows+2*height; |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3546 | frame_info.x=(ssize_t) width; |
| 3547 | frame_info.y=(ssize_t) height; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3548 | frame_info.inner_bevel=inner_bevel; |
| 3549 | frame_info.outer_bevel=outer_bevel; |
| 3550 | PixelGetQuantumColor(matte_color,&wand->images->matte_color); |
| 3551 | frame_image=FrameImage(wand->images,&frame_info,wand->exception); |
| 3552 | if (frame_image == (Image *) NULL) |
| 3553 | return(MagickFalse); |
| 3554 | ReplaceImageInList(&wand->images,frame_image); |
| 3555 | return(MagickTrue); |
| 3556 | } |
| 3557 | |
| 3558 | /* |
| 3559 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3560 | % % |
| 3561 | % % |
| 3562 | % % |
| 3563 | % M a g i c k F u n c t i o n I m a g e % |
| 3564 | % % |
| 3565 | % % |
| 3566 | % % |
| 3567 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3568 | % |
| 3569 | % MagickFunctionImage() applys an arithmetic, relational, or logical |
| 3570 | % expression to an image. Use these operators to lighten or darken an image, |
| 3571 | % to increase or decrease contrast in an image, or to produce the "negative" |
| 3572 | % of an image. |
| 3573 | % |
| 3574 | % The format of the MagickFunctionImage method is: |
| 3575 | % |
| 3576 | % MagickBooleanType MagickFunctionImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3577 | % const MagickFunction function,const size_t number_arguments, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3578 | % const double *arguments) |
| 3579 | % MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, |
| 3580 | % const ChannelType channel,const MagickFunction function, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3581 | % const size_t number_arguments,const double *arguments) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3582 | % |
| 3583 | % A description of each parameter follows: |
| 3584 | % |
| 3585 | % o wand: the magick wand. |
| 3586 | % |
| 3587 | % o channel: the channel(s). |
| 3588 | % |
| 3589 | % o function: the image function. |
| 3590 | % |
| 3591 | % o number_arguments: the number of function arguments. |
| 3592 | % |
| 3593 | % o arguments: the function arguments. |
| 3594 | % |
| 3595 | */ |
| 3596 | |
| 3597 | WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3598 | const MagickFunction function,const size_t number_arguments, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3599 | const double *arguments) |
| 3600 | { |
| 3601 | MagickBooleanType |
| 3602 | status; |
| 3603 | |
| 3604 | assert(wand != (MagickWand *) NULL); |
| 3605 | assert(wand->signature == WandSignature); |
| 3606 | if (wand->debug != MagickFalse) |
| 3607 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3608 | if (wand->images == (Image *) NULL) |
| 3609 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3610 | status=FunctionImage(wand->images,function,number_arguments,arguments, |
| 3611 | &wand->images->exception); |
| 3612 | if (status == MagickFalse) |
| 3613 | InheritException(wand->exception,&wand->images->exception); |
| 3614 | return(status); |
| 3615 | } |
| 3616 | |
| 3617 | WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, |
| 3618 | const ChannelType channel,const MagickFunction function, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3619 | const size_t number_arguments,const double *arguments) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3620 | { |
| 3621 | MagickBooleanType |
| 3622 | status; |
| 3623 | |
| 3624 | assert(wand != (MagickWand *) NULL); |
| 3625 | assert(wand->signature == WandSignature); |
| 3626 | if (wand->debug != MagickFalse) |
| 3627 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3628 | if (wand->images == (Image *) NULL) |
| 3629 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3630 | status=FunctionImageChannel(wand->images,channel,function,number_arguments, |
| 3631 | arguments,&wand->images->exception); |
| 3632 | return(status); |
| 3633 | } |
| 3634 | |
| 3635 | /* |
| 3636 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3637 | % % |
| 3638 | % % |
| 3639 | % % |
| 3640 | % M a g i c k F x I m a g e % |
| 3641 | % % |
| 3642 | % % |
| 3643 | % % |
| 3644 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3645 | % |
| 3646 | % MagickFxImage() evaluate expression for each pixel in the image. |
| 3647 | % |
| 3648 | % The format of the MagickFxImage method is: |
| 3649 | % |
| 3650 | % MagickWand *MagickFxImage(MagickWand *wand,const char *expression) |
| 3651 | % MagickWand *MagickFxImageChannel(MagickWand *wand, |
| 3652 | % const ChannelType channel,const char *expression) |
| 3653 | % |
| 3654 | % A description of each parameter follows: |
| 3655 | % |
| 3656 | % o wand: the magick wand. |
| 3657 | % |
| 3658 | % o channel: the image channel(s). |
| 3659 | % |
| 3660 | % o expression: the expression. |
| 3661 | % |
| 3662 | */ |
| 3663 | |
| 3664 | WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression) |
| 3665 | { |
| 3666 | MagickWand |
| 3667 | *fx_wand; |
| 3668 | |
| 3669 | fx_wand=MagickFxImageChannel(wand,DefaultChannels,expression); |
| 3670 | return(fx_wand); |
| 3671 | } |
| 3672 | |
| 3673 | WandExport MagickWand *MagickFxImageChannel(MagickWand *wand, |
| 3674 | const ChannelType channel,const char *expression) |
| 3675 | { |
| 3676 | Image |
| 3677 | *fx_image; |
| 3678 | |
| 3679 | assert(wand != (MagickWand *) NULL); |
| 3680 | assert(wand->signature == WandSignature); |
| 3681 | if (wand->debug != MagickFalse) |
| 3682 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3683 | if (wand->images == (Image *) NULL) |
| 3684 | return((MagickWand *) NULL); |
| 3685 | fx_image=FxImageChannel(wand->images,channel,expression,wand->exception); |
| 3686 | if (fx_image == (Image *) NULL) |
| 3687 | return((MagickWand *) NULL); |
| 3688 | return(CloneMagickWandFromImages(wand,fx_image)); |
| 3689 | } |
| 3690 | |
| 3691 | /* |
| 3692 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3693 | % % |
| 3694 | % % |
| 3695 | % % |
| 3696 | % M a g i c k G a m m a I m a g e % |
| 3697 | % % |
| 3698 | % % |
| 3699 | % % |
| 3700 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3701 | % |
| 3702 | % MagickGammaImage() gamma-corrects an image. The same image viewed on |
| 3703 | % different devices will have perceptual differences in the way the image's |
| 3704 | % intensities are represented on the screen. Specify individual gamma levels |
| 3705 | % for the red, green, and blue channels, or adjust all three with the gamma |
| 3706 | % parameter. Values typically range from 0.8 to 2.3. |
| 3707 | % |
| 3708 | % You can also reduce the influence of a particular channel with a gamma |
| 3709 | % value of 0. |
| 3710 | % |
| 3711 | % The format of the MagickGammaImage method is: |
| 3712 | % |
| 3713 | % MagickBooleanType MagickGammaImage(MagickWand *wand,const double gamma) |
| 3714 | % MagickBooleanType MagickGammaImageChannel(MagickWand *wand, |
| 3715 | % const ChannelType channel,const double gamma) |
| 3716 | % |
| 3717 | % A description of each parameter follows: |
| 3718 | % |
| 3719 | % o wand: the magick wand. |
| 3720 | % |
| 3721 | % o channel: the channel. |
| 3722 | % |
| 3723 | % o level: Define the level of gamma correction. |
| 3724 | % |
| 3725 | */ |
| 3726 | |
| 3727 | WandExport MagickBooleanType MagickGammaImage(MagickWand *wand, |
| 3728 | const double gamma) |
| 3729 | { |
| 3730 | MagickBooleanType |
| 3731 | status; |
| 3732 | |
| 3733 | status=MagickGammaImageChannel(wand,DefaultChannels,gamma); |
| 3734 | return(status); |
| 3735 | } |
| 3736 | |
| 3737 | WandExport MagickBooleanType MagickGammaImageChannel(MagickWand *wand, |
| 3738 | const ChannelType channel,const double gamma) |
| 3739 | { |
| 3740 | MagickBooleanType |
| 3741 | status; |
| 3742 | |
| 3743 | assert(wand != (MagickWand *) NULL); |
| 3744 | assert(wand->signature == WandSignature); |
| 3745 | if (wand->debug != MagickFalse) |
| 3746 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3747 | if (wand->images == (Image *) NULL) |
| 3748 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3749 | status=GammaImageChannel(wand->images,channel,gamma); |
| 3750 | if (status == MagickFalse) |
| 3751 | InheritException(wand->exception,&wand->images->exception); |
| 3752 | return(status); |
| 3753 | } |
| 3754 | |
| 3755 | /* |
| 3756 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3757 | % % |
| 3758 | % % |
| 3759 | % % |
| 3760 | % M a g i c k G a u s s i a n B l u r I m a g e % |
| 3761 | % % |
| 3762 | % % |
| 3763 | % % |
| 3764 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3765 | % |
| 3766 | % MagickGaussianBlurImage() blurs an image. We convolve the image with a |
| 3767 | % Gaussian operator of the given radius and standard deviation (sigma). |
| 3768 | % For reasonable results, the radius should be larger than sigma. Use a |
| 3769 | % radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you. |
| 3770 | % |
| 3771 | % The format of the MagickGaussianBlurImage method is: |
| 3772 | % |
| 3773 | % MagickBooleanType MagickGaussianBlurImage(MagickWand *wand, |
| 3774 | % const double radius,const double sigma) |
| 3775 | % MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand, |
| 3776 | % const ChannelType channel,const double radius,const double sigma) |
| 3777 | % |
| 3778 | % A description of each parameter follows: |
| 3779 | % |
| 3780 | % o wand: the magick wand. |
| 3781 | % |
| 3782 | % o channel: the image channel(s). |
| 3783 | % |
| 3784 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 3785 | % pixel. |
| 3786 | % |
| 3787 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 3788 | % |
| 3789 | */ |
| 3790 | |
| 3791 | WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand, |
| 3792 | const double radius,const double sigma) |
| 3793 | { |
| 3794 | MagickBooleanType |
| 3795 | status; |
| 3796 | |
| 3797 | status=MagickGaussianBlurImageChannel(wand,DefaultChannels,radius,sigma); |
| 3798 | return(status); |
| 3799 | } |
| 3800 | |
| 3801 | WandExport MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand, |
| 3802 | const ChannelType channel,const double radius,const double sigma) |
| 3803 | { |
| 3804 | Image |
| 3805 | *blur_image; |
| 3806 | |
| 3807 | assert(wand != (MagickWand *) NULL); |
| 3808 | assert(wand->signature == WandSignature); |
| 3809 | if (wand->debug != MagickFalse) |
| 3810 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3811 | if (wand->images == (Image *) NULL) |
| 3812 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3813 | blur_image=GaussianBlurImageChannel(wand->images,channel,radius,sigma, |
| 3814 | wand->exception); |
| 3815 | if (blur_image == (Image *) NULL) |
| 3816 | return(MagickFalse); |
| 3817 | ReplaceImageInList(&wand->images,blur_image); |
| 3818 | return(MagickTrue); |
| 3819 | } |
| 3820 | |
| 3821 | /* |
| 3822 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3823 | % % |
| 3824 | % % |
| 3825 | % % |
| 3826 | % M a g i c k G e t I m a g e % |
| 3827 | % % |
| 3828 | % % |
| 3829 | % % |
| 3830 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3831 | % |
| 3832 | % MagickGetImage() gets the image at the current image index. |
| 3833 | % |
| 3834 | % The format of the MagickGetImage method is: |
| 3835 | % |
| 3836 | % MagickWand *MagickGetImage(MagickWand *wand) |
| 3837 | % |
| 3838 | % A description of each parameter follows: |
| 3839 | % |
| 3840 | % o wand: the magick wand. |
| 3841 | % |
| 3842 | */ |
| 3843 | WandExport MagickWand *MagickGetImage(MagickWand *wand) |
| 3844 | { |
| 3845 | Image |
| 3846 | *image; |
| 3847 | |
| 3848 | assert(wand != (MagickWand *) NULL); |
| 3849 | assert(wand->signature == WandSignature); |
| 3850 | if (wand->debug != MagickFalse) |
| 3851 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3852 | if (wand->images == (Image *) NULL) |
| 3853 | { |
| 3854 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 3855 | "ContainsNoImages","`%s'",wand->name); |
| 3856 | return((MagickWand *) NULL); |
| 3857 | } |
| 3858 | image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 3859 | if (image == (Image *) NULL) |
| 3860 | return((MagickWand *) NULL); |
| 3861 | return(CloneMagickWandFromImages(wand,image)); |
| 3862 | } |
| 3863 | |
| 3864 | /* |
| 3865 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3866 | % % |
| 3867 | % % |
| 3868 | % % |
| 3869 | % M a g i c k G e t I m a g e A l p h a C h a n n e l % |
| 3870 | % % |
| 3871 | % % |
| 3872 | % % |
| 3873 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3874 | % |
| 3875 | % MagickGetImageAlphaChannel() returns MagickFalse if the image alpha channel |
| 3876 | % is not activated. That is, the image is RGB rather than RGBA or CMYK rather |
| 3877 | % than CMYKA. |
| 3878 | % |
| 3879 | % The format of the MagickGetImageAlphaChannel method is: |
| 3880 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 3881 | % size_t MagickGetImageAlphaChannel(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3882 | % |
| 3883 | % A description of each parameter follows: |
| 3884 | % |
| 3885 | % o wand: the magick wand. |
| 3886 | % |
| 3887 | */ |
| 3888 | WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand) |
| 3889 | { |
| 3890 | assert(wand != (MagickWand *) NULL); |
| 3891 | assert(wand->signature == WandSignature); |
| 3892 | if (wand->debug != MagickFalse) |
| 3893 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3894 | if (wand->images == (Image *) NULL) |
| 3895 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3896 | return(GetImageAlphaChannel(wand->images)); |
| 3897 | } |
| 3898 | |
| 3899 | /* |
| 3900 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3901 | % % |
| 3902 | % % |
| 3903 | % % |
| 3904 | % M a g i c k G e t I m a g e C l i p M a s k % |
| 3905 | % % |
| 3906 | % % |
| 3907 | % % |
| 3908 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3909 | % |
| 3910 | % MagickGetImageClipMask() gets the image clip mask at the current image index. |
| 3911 | % |
| 3912 | % The format of the MagickGetImageClipMask method is: |
| 3913 | % |
| 3914 | % MagickWand *MagickGetImageClipMask(MagickWand *wand) |
| 3915 | % |
| 3916 | % A description of each parameter follows: |
| 3917 | % |
| 3918 | % o wand: the magick wand. |
| 3919 | % |
| 3920 | */ |
| 3921 | WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand) |
| 3922 | { |
| 3923 | Image |
| 3924 | *image; |
| 3925 | |
| 3926 | assert(wand != (MagickWand *) NULL); |
| 3927 | assert(wand->signature == WandSignature); |
| 3928 | if (wand->debug != MagickFalse) |
| 3929 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3930 | if (wand->images == (Image *) NULL) |
| 3931 | { |
| 3932 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 3933 | "ContainsNoImages","`%s'",wand->name); |
| 3934 | return((MagickWand *) NULL); |
| 3935 | } |
| 3936 | image=GetImageClipMask(wand->images,wand->exception); |
| 3937 | if (image == (Image *) NULL) |
| 3938 | return((MagickWand *) NULL); |
| 3939 | return(CloneMagickWandFromImages(wand,image)); |
| 3940 | } |
| 3941 | |
| 3942 | /* |
| 3943 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3944 | % % |
| 3945 | % % |
| 3946 | % % |
| 3947 | % M a g i c k G e t I m a g e B a c k g r o u n d C o l o r % |
| 3948 | % % |
| 3949 | % % |
| 3950 | % % |
| 3951 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3952 | % |
| 3953 | % MagickGetImageBackgroundColor() returns the image background color. |
| 3954 | % |
| 3955 | % The format of the MagickGetImageBackgroundColor method is: |
| 3956 | % |
| 3957 | % MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand, |
| 3958 | % PixelWand *background_color) |
| 3959 | % |
| 3960 | % A description of each parameter follows: |
| 3961 | % |
| 3962 | % o wand: the magick wand. |
| 3963 | % |
| 3964 | % o background_color: Return the background color. |
| 3965 | % |
| 3966 | */ |
| 3967 | WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand, |
| 3968 | PixelWand *background_color) |
| 3969 | { |
| 3970 | assert(wand != (MagickWand *) NULL); |
| 3971 | assert(wand->signature == WandSignature); |
| 3972 | if (wand->debug != MagickFalse) |
| 3973 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 3974 | if (wand->images == (Image *) NULL) |
| 3975 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 3976 | PixelSetQuantumColor(background_color,&wand->images->background_color); |
| 3977 | return(MagickTrue); |
| 3978 | } |
| 3979 | |
| 3980 | /* |
| 3981 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3982 | % % |
| 3983 | % % |
| 3984 | % % |
| 3985 | % M a g i c k G e t I m a g e B l o b % |
| 3986 | % % |
| 3987 | % % |
| 3988 | % % |
| 3989 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3990 | % |
cristy | 1a1b562 | 2011-02-15 02:40:42 +0000 | [diff] [blame] | 3991 | % MagickGetImageBlob() implements direct to memory image formats. It returns |
| 3992 | % the image as a blob (a formatted "file" in memory) and its length, starting |
| 3993 | % from the current position in the image sequence. Use MagickSetImageFormat() |
| 3994 | % to set the format to write to the blob (GIF, JPEG, PNG, etc.). |
| 3995 | % |
| 3996 | % Utilize MagickResetIterator() to ensure the write is from the beginning of |
| 3997 | % the image sequence. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3998 | % |
| 3999 | % Use MagickRelinquishMemory() to free the blob when you are done with it. |
| 4000 | % |
| 4001 | % The format of the MagickGetImageBlob method is: |
| 4002 | % |
| 4003 | % unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length) |
| 4004 | % |
| 4005 | % A description of each parameter follows: |
| 4006 | % |
| 4007 | % o wand: the magick wand. |
| 4008 | % |
| 4009 | % o length: the length of the blob. |
| 4010 | % |
| 4011 | */ |
| 4012 | WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length) |
| 4013 | { |
| 4014 | assert(wand != (MagickWand *) NULL); |
| 4015 | assert(wand->signature == WandSignature); |
| 4016 | if (wand->debug != MagickFalse) |
| 4017 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4018 | if (wand->images == (Image *) NULL) |
| 4019 | { |
| 4020 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4021 | "ContainsNoImages","`%s'",wand->name); |
| 4022 | return((unsigned char *) NULL); |
| 4023 | } |
| 4024 | return(ImageToBlob(wand->image_info,wand->images,length,wand->exception)); |
| 4025 | } |
| 4026 | |
| 4027 | /* |
| 4028 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4029 | % % |
| 4030 | % % |
| 4031 | % % |
| 4032 | % M a g i c k G e t I m a g e s B l o b % |
| 4033 | % % |
| 4034 | % % |
| 4035 | % % |
| 4036 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4037 | % |
| 4038 | % MagickGetImageBlob() implements direct to memory image formats. It |
| 4039 | % returns the image sequence as a blob and its length. The format of the image |
| 4040 | % determines the format of the returned blob (GIF, JPEG, PNG, etc.). To |
| 4041 | % return a different image format, use MagickSetImageFormat(). |
| 4042 | % |
| 4043 | % Note, some image formats do not permit multiple images to the same image |
| 4044 | % stream (e.g. JPEG). in this instance, just the first image of the |
| 4045 | % sequence is returned as a blob. |
| 4046 | % |
| 4047 | % The format of the MagickGetImagesBlob method is: |
| 4048 | % |
| 4049 | % unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length) |
| 4050 | % |
| 4051 | % A description of each parameter follows: |
| 4052 | % |
| 4053 | % o wand: the magick wand. |
| 4054 | % |
| 4055 | % o length: the length of the blob. |
| 4056 | % |
| 4057 | */ |
| 4058 | WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length) |
| 4059 | { |
| 4060 | unsigned char |
| 4061 | *blob; |
| 4062 | |
| 4063 | assert(wand != (MagickWand *) NULL); |
| 4064 | assert(wand->signature == WandSignature); |
| 4065 | if (wand->debug != MagickFalse) |
| 4066 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4067 | if (wand->images == (Image *) NULL) |
| 4068 | { |
| 4069 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4070 | "ContainsNoImages","`%s'",wand->name); |
| 4071 | return((unsigned char *) NULL); |
| 4072 | } |
| 4073 | blob=ImagesToBlob(wand->image_info,GetFirstImageInList(wand->images),length, |
| 4074 | wand->exception); |
| 4075 | return(blob); |
| 4076 | } |
| 4077 | |
| 4078 | /* |
| 4079 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4080 | % % |
| 4081 | % % |
| 4082 | % % |
| 4083 | % M a g i c k G e t I m a g e B l u e P r i m a r y % |
| 4084 | % % |
| 4085 | % % |
| 4086 | % % |
| 4087 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4088 | % |
| 4089 | % MagickGetImageBluePrimary() returns the chromaticy blue primary point for the |
| 4090 | % image. |
| 4091 | % |
| 4092 | % The format of the MagickGetImageBluePrimary method is: |
| 4093 | % |
| 4094 | % MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand,double *x, |
| 4095 | % double *y) |
| 4096 | % |
| 4097 | % A description of each parameter follows: |
| 4098 | % |
| 4099 | % o wand: the magick wand. |
| 4100 | % |
| 4101 | % o x: the chromaticity blue primary x-point. |
| 4102 | % |
| 4103 | % o y: the chromaticity blue primary y-point. |
| 4104 | % |
| 4105 | */ |
| 4106 | WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand, |
| 4107 | double *x,double *y) |
| 4108 | { |
| 4109 | assert(wand != (MagickWand *) NULL); |
| 4110 | assert(wand->signature == WandSignature); |
| 4111 | if (wand->debug != MagickFalse) |
| 4112 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4113 | if (wand->images == (Image *) NULL) |
| 4114 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4115 | *x=wand->images->chromaticity.blue_primary.x; |
| 4116 | *y=wand->images->chromaticity.blue_primary.y; |
| 4117 | return(MagickTrue); |
| 4118 | } |
| 4119 | |
| 4120 | /* |
| 4121 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4122 | % % |
| 4123 | % % |
| 4124 | % % |
| 4125 | % M a g i c k G e t I m a g e B o r d e r C o l o r % |
| 4126 | % % |
| 4127 | % % |
| 4128 | % % |
| 4129 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4130 | % |
| 4131 | % MagickGetImageBorderColor() returns the image border color. |
| 4132 | % |
| 4133 | % The format of the MagickGetImageBorderColor method is: |
| 4134 | % |
| 4135 | % MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, |
| 4136 | % PixelWand *border_color) |
| 4137 | % |
| 4138 | % A description of each parameter follows: |
| 4139 | % |
| 4140 | % o wand: the magick wand. |
| 4141 | % |
| 4142 | % o border_color: Return the border color. |
| 4143 | % |
| 4144 | */ |
| 4145 | WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, |
| 4146 | PixelWand *border_color) |
| 4147 | { |
| 4148 | assert(wand != (MagickWand *) NULL); |
| 4149 | assert(wand->signature == WandSignature); |
| 4150 | if (wand->debug != MagickFalse) |
| 4151 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4152 | if (wand->images == (Image *) NULL) |
| 4153 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4154 | PixelSetQuantumColor(border_color,&wand->images->border_color); |
| 4155 | return(MagickTrue); |
| 4156 | } |
| 4157 | |
| 4158 | /* |
| 4159 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4160 | % % |
| 4161 | % % |
| 4162 | % % |
| 4163 | % M a g i c k G e t I m a g e C h a n n e l D e p t h % |
| 4164 | % % |
| 4165 | % % |
| 4166 | % % |
| 4167 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4168 | % |
| 4169 | % MagickGetImageChannelDepth() gets the depth for one or more image channels. |
| 4170 | % |
| 4171 | % The format of the MagickGetImageChannelDepth method is: |
| 4172 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4173 | % size_t MagickGetImageChannelDepth(MagickWand *wand, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4174 | % const ChannelType channel) |
| 4175 | % |
| 4176 | % A description of each parameter follows: |
| 4177 | % |
| 4178 | % o wand: the magick wand. |
| 4179 | % |
| 4180 | % o channel: the image channel(s). |
| 4181 | % |
| 4182 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4183 | WandExport size_t MagickGetImageChannelDepth(MagickWand *wand, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4184 | const ChannelType channel) |
| 4185 | { |
| 4186 | assert(wand != (MagickWand *) NULL); |
| 4187 | assert(wand->signature == WandSignature); |
| 4188 | if (wand->debug != MagickFalse) |
| 4189 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4190 | if (wand->images == (Image *) NULL) |
| 4191 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4192 | return(GetImageChannelDepth(wand->images,channel,wand->exception)); |
| 4193 | } |
| 4194 | |
| 4195 | /* |
| 4196 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4197 | % % |
| 4198 | % % |
| 4199 | % % |
| 4200 | % M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n % |
| 4201 | % % |
| 4202 | % % |
| 4203 | % % |
| 4204 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4205 | % |
| 4206 | % MagickGetImageChannelDistortion() compares one or more image channels of an |
| 4207 | % image to a reconstructed image and returns the specified distortion metric. |
| 4208 | % |
| 4209 | % The format of the MagickGetImageChannelDistortion method is: |
| 4210 | % |
| 4211 | % MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand, |
| 4212 | % const MagickWand *reference,const ChannelType channel, |
| 4213 | % const MetricType metric,double *distortion) |
| 4214 | % |
| 4215 | % A description of each parameter follows: |
| 4216 | % |
| 4217 | % o wand: the magick wand. |
| 4218 | % |
| 4219 | % o reference: the reference wand. |
| 4220 | % |
| 4221 | % o channel: the channel. |
| 4222 | % |
| 4223 | % o metric: the metric. |
| 4224 | % |
| 4225 | % o distortion: the computed distortion between the images. |
| 4226 | % |
| 4227 | */ |
| 4228 | WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand, |
| 4229 | const MagickWand *reference,const ChannelType channel,const MetricType metric, |
| 4230 | double *distortion) |
| 4231 | { |
| 4232 | MagickBooleanType |
| 4233 | status; |
| 4234 | |
| 4235 | assert(wand != (MagickWand *) NULL); |
| 4236 | assert(wand->signature == WandSignature); |
| 4237 | if (wand->debug != MagickFalse) |
| 4238 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4239 | assert(reference != (MagickWand *) NULL); |
| 4240 | assert(reference->signature == WandSignature); |
| 4241 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 4242 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4243 | status=GetImageChannelDistortion(wand->images,reference->images,channel, |
| 4244 | metric,distortion,&wand->images->exception); |
| 4245 | return(status); |
| 4246 | } |
| 4247 | |
| 4248 | /* |
| 4249 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4250 | % % |
| 4251 | % % |
| 4252 | % % |
| 4253 | % M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n s % |
| 4254 | % % |
| 4255 | % % |
| 4256 | % % |
| 4257 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4258 | % |
| 4259 | % MagickGetImageChannelDistortions() compares one or more image channels of an |
| 4260 | % image to a reconstructed image and returns the specified distortion metrics. |
| 4261 | % |
| 4262 | % Use MagickRelinquishMemory() to free the metrics when you are done with them. |
| 4263 | % |
| 4264 | % The format of the MagickGetImageChannelDistortion method is: |
| 4265 | % |
| 4266 | % double *MagickGetImageChannelDistortion(MagickWand *wand, |
| 4267 | % const MagickWand *reference,const MetricType metric) |
| 4268 | % |
| 4269 | % A description of each parameter follows: |
| 4270 | % |
| 4271 | % o wand: the magick wand. |
| 4272 | % |
| 4273 | % o reference: the reference wand. |
| 4274 | % |
| 4275 | % o metric: the metric. |
| 4276 | % |
| 4277 | */ |
| 4278 | WandExport double *MagickGetImageChannelDistortions(MagickWand *wand, |
| 4279 | const MagickWand *reference,const MetricType metric) |
| 4280 | { |
| 4281 | double |
| 4282 | *channel_distortion; |
| 4283 | |
| 4284 | assert(wand != (MagickWand *) NULL); |
| 4285 | assert(wand->signature == WandSignature); |
| 4286 | if (wand->debug != MagickFalse) |
| 4287 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4288 | assert(reference != (MagickWand *) NULL); |
| 4289 | assert(reference->signature == WandSignature); |
| 4290 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 4291 | { |
| 4292 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4293 | "ContainsNoImages","`%s'",wand->name); |
| 4294 | return((double *) NULL); |
| 4295 | } |
| 4296 | channel_distortion=GetImageChannelDistortions(wand->images,reference->images, |
| 4297 | metric,&wand->images->exception); |
| 4298 | return(channel_distortion); |
| 4299 | } |
| 4300 | |
| 4301 | /* |
| 4302 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4303 | % % |
| 4304 | % % |
| 4305 | % % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4306 | % M a g i c k G e t I m a g e C h a n n e l F e a t u r e s % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4307 | % % |
| 4308 | % % |
| 4309 | % % |
| 4310 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4311 | % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4312 | % MagickGetImageChannelFeatures() returns features for each channel in the |
cristy | 7396d88 | 2010-01-27 02:37:56 +0000 | [diff] [blame] | 4313 | % image in each of four directions (horizontal, vertical, left and right |
| 4314 | % diagonals) for the specified distance. The features include the angular |
| 4315 | % second moment, contrast, correlation, sum of squares: variance, inverse |
| 4316 | % difference moment, sum average, sum varience, sum entropy, entropy, |
| 4317 | % difference variance, difference entropy, information measures of |
| 4318 | % correlation 1, information measures of correlation 2, and maximum |
| 4319 | % correlation coefficient. You can access the red channel contrast, for |
| 4320 | % example, like this: |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4321 | % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4322 | % channel_features=MagickGetImageChannelFeatures(wand,1); |
| 4323 | % contrast=channel_features[RedChannel].contrast[0]; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4324 | % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4325 | % Use MagickRelinquishMemory() to free the statistics buffer. |
| 4326 | % |
| 4327 | % The format of the MagickGetImageChannelFeatures method is: |
| 4328 | % |
| 4329 | % ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4330 | % const size_t distance) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4331 | % |
| 4332 | % A description of each parameter follows: |
| 4333 | % |
| 4334 | % o wand: the magick wand. |
| 4335 | % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4336 | % o distance: the distance. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4337 | % |
| 4338 | */ |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4339 | WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4340 | const size_t distance) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4341 | { |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4342 | assert(wand != (MagickWand *) NULL); |
| 4343 | assert(wand->signature == WandSignature); |
| 4344 | if (wand->debug != MagickFalse) |
| 4345 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4346 | if (wand->images == (Image *) NULL) |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4347 | { |
| 4348 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4349 | "ContainsNoImages","`%s'",wand->name); |
| 4350 | return((ChannelFeatures *) NULL); |
| 4351 | } |
| 4352 | return(GetImageChannelFeatures(wand->images,distance,wand->exception)); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4353 | } |
| 4354 | |
| 4355 | /* |
| 4356 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4357 | % % |
| 4358 | % % |
| 4359 | % % |
| 4360 | % M a g i c k G e t I m a g e C h a n n e l K u r t o s i s % |
| 4361 | % % |
| 4362 | % % |
| 4363 | % % |
| 4364 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4365 | % |
| 4366 | % MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or |
| 4367 | % more image channels. |
| 4368 | % |
| 4369 | % The format of the MagickGetImageChannelKurtosis method is: |
| 4370 | % |
| 4371 | % MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, |
| 4372 | % const ChannelType channel,double *kurtosis,double *skewness) |
| 4373 | % |
| 4374 | % A description of each parameter follows: |
| 4375 | % |
| 4376 | % o wand: the magick wand. |
| 4377 | % |
| 4378 | % o channel: the image channel(s). |
| 4379 | % |
| 4380 | % o kurtosis: The kurtosis for the specified channel(s). |
| 4381 | % |
| 4382 | % o skewness: The skewness for the specified channel(s). |
| 4383 | % |
| 4384 | */ |
| 4385 | WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, |
| 4386 | const ChannelType channel,double *kurtosis,double *skewness) |
| 4387 | { |
| 4388 | MagickBooleanType |
| 4389 | status; |
| 4390 | |
| 4391 | assert(wand != (MagickWand *) NULL); |
| 4392 | assert(wand->signature == WandSignature); |
| 4393 | if (wand->debug != MagickFalse) |
| 4394 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4395 | if (wand->images == (Image *) NULL) |
| 4396 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4397 | status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness, |
| 4398 | wand->exception); |
| 4399 | return(status); |
| 4400 | } |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4401 | |
| 4402 | /* |
| 4403 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4404 | % % |
| 4405 | % % |
| 4406 | % % |
| 4407 | % M a g i c k G e t I m a g e C h a n n e l M e a n % |
| 4408 | % % |
| 4409 | % % |
| 4410 | % % |
| 4411 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4412 | % |
| 4413 | % MagickGetImageChannelMean() gets the mean and standard deviation of one or |
| 4414 | % more image channels. |
| 4415 | % |
| 4416 | % The format of the MagickGetImageChannelMean method is: |
| 4417 | % |
| 4418 | % MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, |
| 4419 | % const ChannelType channel,double *mean,double *standard_deviation) |
| 4420 | % |
| 4421 | % A description of each parameter follows: |
| 4422 | % |
| 4423 | % o wand: the magick wand. |
| 4424 | % |
| 4425 | % o channel: the image channel(s). |
| 4426 | % |
| 4427 | % o mean: The mean pixel value for the specified channel(s). |
| 4428 | % |
| 4429 | % o standard_deviation: The standard deviation for the specified channel(s). |
| 4430 | % |
| 4431 | */ |
| 4432 | WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, |
| 4433 | const ChannelType channel,double *mean,double *standard_deviation) |
| 4434 | { |
| 4435 | MagickBooleanType |
| 4436 | status; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4437 | |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4438 | assert(wand != (MagickWand *) NULL); |
| 4439 | assert(wand->signature == WandSignature); |
| 4440 | if (wand->debug != MagickFalse) |
| 4441 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4442 | if (wand->images == (Image *) NULL) |
| 4443 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4444 | status=GetImageChannelMean(wand->images,channel,mean,standard_deviation, |
| 4445 | wand->exception); |
| 4446 | return(status); |
| 4447 | } |
| 4448 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4449 | /* |
| 4450 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4451 | % % |
| 4452 | % % |
| 4453 | % % |
| 4454 | % M a g i c k G e t I m a g e C h a n n e l R a n g e % |
| 4455 | % % |
| 4456 | % % |
| 4457 | % % |
| 4458 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4459 | % |
| 4460 | % MagickGetImageChannelRange() gets the range for one or more image channels. |
| 4461 | % |
| 4462 | % The format of the MagickGetImageChannelRange method is: |
| 4463 | % |
| 4464 | % MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, |
| 4465 | % const ChannelType channel,double *minima,double *maxima) |
| 4466 | % |
| 4467 | % A description of each parameter follows: |
| 4468 | % |
| 4469 | % o wand: the magick wand. |
| 4470 | % |
| 4471 | % o channel: the image channel(s). |
| 4472 | % |
| 4473 | % o minima: The minimum pixel value for the specified channel(s). |
| 4474 | % |
| 4475 | % o maxima: The maximum pixel value for the specified channel(s). |
| 4476 | % |
| 4477 | */ |
| 4478 | WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, |
| 4479 | const ChannelType channel,double *minima,double *maxima) |
| 4480 | { |
| 4481 | MagickBooleanType |
| 4482 | status; |
| 4483 | |
| 4484 | assert(wand != (MagickWand *) NULL); |
| 4485 | assert(wand->signature == WandSignature); |
| 4486 | if (wand->debug != MagickFalse) |
| 4487 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4488 | if (wand->images == (Image *) NULL) |
| 4489 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4490 | status=GetImageChannelRange(wand->images,channel,minima,maxima, |
| 4491 | wand->exception); |
| 4492 | return(status); |
| 4493 | } |
| 4494 | |
| 4495 | /* |
| 4496 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4497 | % % |
| 4498 | % % |
| 4499 | % % |
| 4500 | % M a g i c k G e t I m a g e C h a n n e l S t a t i s t i c s % |
| 4501 | % % |
| 4502 | % % |
| 4503 | % % |
| 4504 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4505 | % |
| 4506 | % MagickGetImageChannelStatistics() returns statistics for each channel in the |
| 4507 | % image. The statistics include the channel depth, its minima and |
| 4508 | % maxima, the mean, the standard deviation, the kurtosis and the skewness. |
| 4509 | % You can access the red channel mean, for example, like this: |
| 4510 | % |
cristy | 549a37e | 2010-01-26 15:24:15 +0000 | [diff] [blame] | 4511 | % channel_statistics=MagickGetImageChannelStatistics(wand); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4512 | % red_mean=channel_statistics[RedChannel].mean; |
| 4513 | % |
| 4514 | % Use MagickRelinquishMemory() to free the statistics buffer. |
| 4515 | % |
| 4516 | % The format of the MagickGetImageChannelStatistics method is: |
| 4517 | % |
| 4518 | % ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) |
| 4519 | % |
| 4520 | % A description of each parameter follows: |
| 4521 | % |
| 4522 | % o wand: the magick wand. |
| 4523 | % |
| 4524 | */ |
| 4525 | WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) |
| 4526 | { |
| 4527 | assert(wand != (MagickWand *) NULL); |
| 4528 | assert(wand->signature == WandSignature); |
| 4529 | if (wand->debug != MagickFalse) |
| 4530 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4531 | if (wand->images == (Image *) NULL) |
| 4532 | { |
| 4533 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4534 | "ContainsNoImages","`%s'",wand->name); |
| 4535 | return((ChannelStatistics *) NULL); |
| 4536 | } |
| 4537 | return(GetImageChannelStatistics(wand->images,wand->exception)); |
| 4538 | } |
| 4539 | |
| 4540 | /* |
| 4541 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4542 | % % |
| 4543 | % % |
| 4544 | % % |
| 4545 | % M a g i c k G e t I m a g e C o l o r m a p C o l o r % |
| 4546 | % % |
| 4547 | % % |
| 4548 | % % |
| 4549 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4550 | % |
| 4551 | % MagickGetImageColormapColor() returns the color of the specified colormap |
| 4552 | % index. |
| 4553 | % |
| 4554 | % The format of the MagickGetImageColormapColor method is: |
| 4555 | % |
| 4556 | % MagickBooleanType MagickGetImageColormapColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4557 | % const size_t index,PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4558 | % |
| 4559 | % A description of each parameter follows: |
| 4560 | % |
| 4561 | % o wand: the magick wand. |
| 4562 | % |
| 4563 | % o index: the offset into the image colormap. |
| 4564 | % |
| 4565 | % o color: Return the colormap color in this wand. |
| 4566 | % |
| 4567 | */ |
| 4568 | WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4569 | const size_t index,PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4570 | { |
| 4571 | assert(wand != (MagickWand *) NULL); |
| 4572 | assert(wand->signature == WandSignature); |
| 4573 | if (wand->debug != MagickFalse) |
| 4574 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4575 | if (wand->images == (Image *) NULL) |
| 4576 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4577 | if ((wand->images->colormap == (PixelPacket *) NULL) || |
| 4578 | (index >= wand->images->colors)) |
| 4579 | { |
| 4580 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4581 | "InvalidColormapIndex","`%s'",wand->name); |
| 4582 | return(MagickFalse); |
| 4583 | } |
| 4584 | PixelSetQuantumColor(color,wand->images->colormap+index); |
| 4585 | return(MagickTrue); |
| 4586 | } |
| 4587 | |
| 4588 | /* |
| 4589 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4590 | % % |
| 4591 | % % |
| 4592 | % % |
| 4593 | % M a g i c k G e t I m a g e C o l o r s % |
| 4594 | % % |
| 4595 | % % |
| 4596 | % % |
| 4597 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4598 | % |
| 4599 | % MagickGetImageColors() gets the number of unique colors in the image. |
| 4600 | % |
| 4601 | % The format of the MagickGetImageColors method is: |
| 4602 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4603 | % size_t MagickGetImageColors(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4604 | % |
| 4605 | % A description of each parameter follows: |
| 4606 | % |
| 4607 | % o wand: the magick wand. |
| 4608 | % |
| 4609 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4610 | WandExport size_t MagickGetImageColors(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4611 | { |
| 4612 | assert(wand != (MagickWand *) NULL); |
| 4613 | assert(wand->signature == WandSignature); |
| 4614 | if (wand->debug != MagickFalse) |
| 4615 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4616 | if (wand->images == (Image *) NULL) |
| 4617 | { |
| 4618 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4619 | "ContainsNoImages","`%s'",wand->name); |
| 4620 | return(0); |
| 4621 | } |
| 4622 | return(GetNumberColors(wand->images,(FILE *) NULL,wand->exception)); |
| 4623 | } |
| 4624 | |
| 4625 | /* |
| 4626 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4627 | % % |
| 4628 | % % |
| 4629 | % % |
| 4630 | % M a g i c k G e t I m a g e C o l o r s p a c e % |
| 4631 | % % |
| 4632 | % % |
| 4633 | % % |
| 4634 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4635 | % |
| 4636 | % MagickGetImageColorspace() gets the image colorspace. |
| 4637 | % |
| 4638 | % The format of the MagickGetImageColorspace method is: |
| 4639 | % |
| 4640 | % ColorspaceType MagickGetImageColorspace(MagickWand *wand) |
| 4641 | % |
| 4642 | % A description of each parameter follows: |
| 4643 | % |
| 4644 | % o wand: the magick wand. |
| 4645 | % |
| 4646 | */ |
| 4647 | WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand) |
| 4648 | { |
| 4649 | assert(wand != (MagickWand *) NULL); |
| 4650 | assert(wand->signature == WandSignature); |
| 4651 | if (wand->debug != MagickFalse) |
| 4652 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4653 | if (wand->images == (Image *) NULL) |
| 4654 | { |
| 4655 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4656 | "ContainsNoImages","`%s'",wand->name); |
| 4657 | return(UndefinedColorspace); |
| 4658 | } |
| 4659 | return(wand->images->colorspace); |
| 4660 | } |
| 4661 | |
| 4662 | /* |
| 4663 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4664 | % % |
| 4665 | % % |
| 4666 | % % |
| 4667 | % M a g i c k G e t I m a g e C o m p o s e % |
| 4668 | % % |
| 4669 | % % |
| 4670 | % % |
| 4671 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4672 | % |
| 4673 | % MagickGetImageCompose() returns the composite operator associated with the |
| 4674 | % image. |
| 4675 | % |
| 4676 | % The format of the MagickGetImageCompose method is: |
| 4677 | % |
| 4678 | % CompositeOperator MagickGetImageCompose(MagickWand *wand) |
| 4679 | % |
| 4680 | % A description of each parameter follows: |
| 4681 | % |
| 4682 | % o wand: the magick wand. |
| 4683 | % |
| 4684 | */ |
| 4685 | WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand) |
| 4686 | { |
| 4687 | assert(wand != (MagickWand *) NULL); |
| 4688 | assert(wand->signature == WandSignature); |
| 4689 | if (wand->debug != MagickFalse) |
| 4690 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4691 | if (wand->images == (Image *) NULL) |
| 4692 | { |
| 4693 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4694 | "ContainsNoImages","`%s'",wand->name); |
| 4695 | return(UndefinedCompositeOp); |
| 4696 | } |
| 4697 | return(wand->images->compose); |
| 4698 | } |
| 4699 | |
| 4700 | /* |
| 4701 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4702 | % % |
| 4703 | % % |
| 4704 | % % |
| 4705 | % M a g i c k G e t I m a g e C o m p r e s s i o n % |
| 4706 | % % |
| 4707 | % % |
| 4708 | % % |
| 4709 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4710 | % |
| 4711 | % MagickGetImageCompression() gets the image compression. |
| 4712 | % |
| 4713 | % The format of the MagickGetImageCompression method is: |
| 4714 | % |
| 4715 | % CompressionType MagickGetImageCompression(MagickWand *wand) |
| 4716 | % |
| 4717 | % A description of each parameter follows: |
| 4718 | % |
| 4719 | % o wand: the magick wand. |
| 4720 | % |
| 4721 | */ |
| 4722 | WandExport CompressionType MagickGetImageCompression(MagickWand *wand) |
| 4723 | { |
| 4724 | assert(wand != (MagickWand *) NULL); |
| 4725 | assert(wand->signature == WandSignature); |
| 4726 | if (wand->debug != MagickFalse) |
| 4727 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4728 | if (wand->images == (Image *) NULL) |
| 4729 | { |
| 4730 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4731 | "ContainsNoImages","`%s'",wand->name); |
| 4732 | return(UndefinedCompression); |
| 4733 | } |
| 4734 | return(wand->images->compression); |
| 4735 | } |
| 4736 | |
| 4737 | /* |
| 4738 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4739 | % % |
| 4740 | % % |
| 4741 | % % |
| 4742 | % M a g i c k G e t I m a g e C o m p r e s s i o n Q u a l i t y % |
| 4743 | % % |
| 4744 | % % |
| 4745 | % % |
| 4746 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4747 | % |
| 4748 | % MagickGetImageCompression() gets the image compression quality. |
| 4749 | % |
| 4750 | % The format of the MagickGetImageCompression method is: |
| 4751 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4752 | % size_t MagickGetImageCompression(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4753 | % |
| 4754 | % A description of each parameter follows: |
| 4755 | % |
| 4756 | % o wand: the magick wand. |
| 4757 | % |
| 4758 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4759 | WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4760 | { |
| 4761 | assert(wand != (MagickWand *) NULL); |
| 4762 | assert(wand->signature == WandSignature); |
| 4763 | if (wand->debug != MagickFalse) |
| 4764 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4765 | if (wand->images == (Image *) NULL) |
| 4766 | { |
| 4767 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4768 | "ContainsNoImages","`%s'",wand->name); |
| 4769 | return(0UL); |
| 4770 | } |
| 4771 | return(wand->images->quality); |
| 4772 | } |
| 4773 | |
| 4774 | /* |
| 4775 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4776 | % % |
| 4777 | % % |
| 4778 | % % |
| 4779 | % M a g i c k G e t I m a g e D e l a y % |
| 4780 | % % |
| 4781 | % % |
| 4782 | % % |
| 4783 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4784 | % |
| 4785 | % MagickGetImageDelay() gets the image delay. |
| 4786 | % |
| 4787 | % The format of the MagickGetImageDelay method is: |
| 4788 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4789 | % size_t MagickGetImageDelay(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4790 | % |
| 4791 | % A description of each parameter follows: |
| 4792 | % |
| 4793 | % o wand: the magick wand. |
| 4794 | % |
| 4795 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4796 | WandExport size_t MagickGetImageDelay(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4797 | { |
| 4798 | assert(wand != (MagickWand *) NULL); |
| 4799 | assert(wand->signature == WandSignature); |
| 4800 | if (wand->debug != MagickFalse) |
| 4801 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4802 | if (wand->images == (Image *) NULL) |
| 4803 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4804 | return(wand->images->delay); |
| 4805 | } |
| 4806 | |
| 4807 | /* |
| 4808 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4809 | % % |
| 4810 | % % |
| 4811 | % % |
| 4812 | % M a g i c k G e t I m a g e D e p t h % |
| 4813 | % % |
| 4814 | % % |
| 4815 | % % |
| 4816 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4817 | % |
| 4818 | % MagickGetImageDepth() gets the image depth. |
| 4819 | % |
| 4820 | % The format of the MagickGetImageDepth method is: |
| 4821 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4822 | % size_t MagickGetImageDepth(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4823 | % |
| 4824 | % A description of each parameter follows: |
| 4825 | % |
| 4826 | % o wand: the magick wand. |
| 4827 | % |
| 4828 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 4829 | WandExport size_t MagickGetImageDepth(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4830 | { |
| 4831 | assert(wand != (MagickWand *) NULL); |
| 4832 | assert(wand->signature == WandSignature); |
| 4833 | if (wand->debug != MagickFalse) |
| 4834 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4835 | if (wand->images == (Image *) NULL) |
| 4836 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4837 | return(wand->images->depth); |
| 4838 | } |
| 4839 | |
| 4840 | /* |
| 4841 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4842 | % % |
| 4843 | % % |
| 4844 | % % |
| 4845 | % M a g i c k G e t I m a g e D i s t o r t i o n % |
| 4846 | % % |
| 4847 | % % |
| 4848 | % % |
| 4849 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4850 | % |
| 4851 | % MagickGetImageDistortion() compares an image to a reconstructed image and |
| 4852 | % returns the specified distortion metric. |
| 4853 | % |
| 4854 | % The format of the MagickGetImageDistortion method is: |
| 4855 | % |
| 4856 | % MagickBooleanType MagickGetImageDistortion(MagickWand *wand, |
| 4857 | % const MagickWand *reference,const MetricType metric, |
| 4858 | % double *distortion) |
| 4859 | % |
| 4860 | % A description of each parameter follows: |
| 4861 | % |
| 4862 | % o wand: the magick wand. |
| 4863 | % |
| 4864 | % o reference: the reference wand. |
| 4865 | % |
| 4866 | % o metric: the metric. |
| 4867 | % |
| 4868 | % o distortion: the computed distortion between the images. |
| 4869 | % |
| 4870 | */ |
| 4871 | WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand, |
| 4872 | const MagickWand *reference,const MetricType metric,double *distortion) |
| 4873 | { |
| 4874 | MagickBooleanType |
| 4875 | status; |
| 4876 | |
| 4877 | |
| 4878 | assert(wand != (MagickWand *) NULL); |
| 4879 | assert(wand->signature == WandSignature); |
| 4880 | if (wand->debug != MagickFalse) |
| 4881 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4882 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 4883 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 4884 | status=GetImageDistortion(wand->images,reference->images,metric,distortion, |
| 4885 | &wand->images->exception); |
| 4886 | return(status); |
| 4887 | } |
| 4888 | |
| 4889 | /* |
| 4890 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4891 | % % |
| 4892 | % % |
| 4893 | % % |
| 4894 | % M a g i c k G e t I m a g e D i s p o s e % |
| 4895 | % % |
| 4896 | % % |
| 4897 | % % |
| 4898 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4899 | % |
| 4900 | % MagickGetImageDispose() gets the image disposal method. |
| 4901 | % |
| 4902 | % The format of the MagickGetImageDispose method is: |
| 4903 | % |
| 4904 | % DisposeType MagickGetImageDispose(MagickWand *wand) |
| 4905 | % |
| 4906 | % A description of each parameter follows: |
| 4907 | % |
| 4908 | % o wand: the magick wand. |
| 4909 | % |
| 4910 | */ |
| 4911 | WandExport DisposeType MagickGetImageDispose(MagickWand *wand) |
| 4912 | { |
| 4913 | assert(wand != (MagickWand *) NULL); |
| 4914 | assert(wand->signature == WandSignature); |
| 4915 | if (wand->debug != MagickFalse) |
| 4916 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4917 | if (wand->images == (Image *) NULL) |
| 4918 | { |
| 4919 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4920 | "ContainsNoImages","`%s'",wand->name); |
| 4921 | return(UndefinedDispose); |
| 4922 | } |
| 4923 | return((DisposeType) wand->images->dispose); |
| 4924 | } |
| 4925 | |
| 4926 | /* |
| 4927 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4928 | % % |
| 4929 | % % |
| 4930 | % % |
| 4931 | % M a g i c k G e t I m a g e F i l e n a m e % |
| 4932 | % % |
| 4933 | % % |
| 4934 | % % |
| 4935 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4936 | % |
| 4937 | % MagickGetImageFilename() returns the filename of a particular image in a |
| 4938 | % sequence. |
| 4939 | % |
| 4940 | % The format of the MagickGetImageFilename method is: |
| 4941 | % |
| 4942 | % char *MagickGetImageFilename(MagickWand *wand) |
| 4943 | % |
| 4944 | % A description of each parameter follows: |
| 4945 | % |
| 4946 | % o wand: the magick wand. |
| 4947 | % |
| 4948 | */ |
| 4949 | WandExport char *MagickGetImageFilename(MagickWand *wand) |
| 4950 | { |
| 4951 | assert(wand != (MagickWand *) NULL); |
| 4952 | assert(wand->signature == WandSignature); |
| 4953 | if (wand->debug != MagickFalse) |
| 4954 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4955 | if (wand->images == (Image *) NULL) |
| 4956 | { |
| 4957 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4958 | "ContainsNoImages","`%s'",wand->name); |
| 4959 | return((char *) NULL); |
| 4960 | } |
| 4961 | return(AcquireString(wand->images->filename)); |
| 4962 | } |
| 4963 | |
| 4964 | /* |
| 4965 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4966 | % % |
| 4967 | % % |
| 4968 | % % |
| 4969 | % M a g i c k G e t I m a g e F o r m a t % |
| 4970 | % % |
| 4971 | % % |
| 4972 | % % |
| 4973 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4974 | % |
| 4975 | % MagickGetImageFormat() returns the format of a particular image in a |
| 4976 | % sequence. |
| 4977 | % |
| 4978 | % The format of the MagickGetImageFormat method is: |
| 4979 | % |
cristy | 197d057 | 2010-07-29 23:26:05 +0000 | [diff] [blame] | 4980 | % const char *MagickGetImageFormat(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 4981 | % |
| 4982 | % A description of each parameter follows: |
| 4983 | % |
| 4984 | % o wand: the magick wand. |
| 4985 | % |
| 4986 | */ |
| 4987 | WandExport char *MagickGetImageFormat(MagickWand *wand) |
| 4988 | { |
| 4989 | assert(wand != (MagickWand *) NULL); |
| 4990 | assert(wand->signature == WandSignature); |
| 4991 | if (wand->debug != MagickFalse) |
| 4992 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 4993 | if (wand->images == (Image *) NULL) |
| 4994 | { |
| 4995 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 4996 | "ContainsNoImages","`%s'",wand->name); |
| 4997 | return((char *) NULL); |
| 4998 | } |
| 4999 | return(AcquireString(wand->images->magick)); |
| 5000 | } |
| 5001 | |
| 5002 | /* |
| 5003 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5004 | % % |
| 5005 | % % |
| 5006 | % % |
| 5007 | % M a g i c k G e t I m a g e F u z z % |
| 5008 | % % |
| 5009 | % % |
| 5010 | % % |
| 5011 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5012 | % |
| 5013 | % MagickGetImageFuzz() gets the image fuzz. |
| 5014 | % |
| 5015 | % The format of the MagickGetImageFuzz method is: |
| 5016 | % |
| 5017 | % double MagickGetImageFuzz(MagickWand *wand) |
| 5018 | % |
| 5019 | % A description of each parameter follows: |
| 5020 | % |
| 5021 | % o wand: the magick wand. |
| 5022 | % |
| 5023 | */ |
| 5024 | WandExport double MagickGetImageFuzz(MagickWand *wand) |
| 5025 | { |
| 5026 | assert(wand != (MagickWand *) NULL); |
| 5027 | assert(wand->signature == WandSignature); |
| 5028 | if (wand->debug != MagickFalse) |
| 5029 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5030 | if (wand->images == (Image *) NULL) |
| 5031 | { |
| 5032 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5033 | "ContainsNoImages","`%s'",wand->name); |
| 5034 | return(0.0); |
| 5035 | } |
| 5036 | return(wand->images->fuzz); |
| 5037 | } |
| 5038 | |
| 5039 | /* |
| 5040 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5041 | % % |
| 5042 | % % |
| 5043 | % % |
| 5044 | % M a g i c k G e t I m a g e G a m m a % |
| 5045 | % % |
| 5046 | % % |
| 5047 | % % |
| 5048 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5049 | % |
| 5050 | % MagickGetImageGamma() gets the image gamma. |
| 5051 | % |
| 5052 | % The format of the MagickGetImageGamma method is: |
| 5053 | % |
| 5054 | % double MagickGetImageGamma(MagickWand *wand) |
| 5055 | % |
| 5056 | % A description of each parameter follows: |
| 5057 | % |
| 5058 | % o wand: the magick wand. |
| 5059 | % |
| 5060 | */ |
| 5061 | WandExport double MagickGetImageGamma(MagickWand *wand) |
| 5062 | { |
| 5063 | assert(wand != (MagickWand *) NULL); |
| 5064 | assert(wand->signature == WandSignature); |
| 5065 | if (wand->debug != MagickFalse) |
| 5066 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5067 | if (wand->images == (Image *) NULL) |
| 5068 | { |
| 5069 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5070 | "ContainsNoImages","`%s'",wand->name); |
| 5071 | return(0.0); |
| 5072 | } |
| 5073 | return(wand->images->gamma); |
| 5074 | } |
| 5075 | |
| 5076 | /* |
| 5077 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5078 | % % |
| 5079 | % % |
| 5080 | % % |
| 5081 | % M a g i c k G e t I m a g e I n t e r l a c e S c h e m e % |
| 5082 | % % |
| 5083 | % % |
| 5084 | % % |
| 5085 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5086 | % |
| 5087 | % MagickGetImageGravity() gets the image gravity. |
| 5088 | % |
| 5089 | % The format of the MagickGetImageGravity method is: |
| 5090 | % |
| 5091 | % GravityType MagickGetImageGravity(MagickWand *wand) |
| 5092 | % |
| 5093 | % A description of each parameter follows: |
| 5094 | % |
| 5095 | % o wand: the magick wand. |
| 5096 | % |
| 5097 | */ |
| 5098 | WandExport GravityType MagickGetImageGravity(MagickWand *wand) |
| 5099 | { |
| 5100 | assert(wand != (MagickWand *) NULL); |
| 5101 | assert(wand->signature == WandSignature); |
| 5102 | if (wand->debug != MagickFalse) |
| 5103 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5104 | if (wand->images == (Image *) NULL) |
| 5105 | { |
| 5106 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5107 | "ContainsNoImages","`%s'",wand->name); |
| 5108 | return(UndefinedGravity); |
| 5109 | } |
| 5110 | return(wand->images->gravity); |
| 5111 | } |
| 5112 | |
| 5113 | /* |
| 5114 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5115 | % % |
| 5116 | % % |
| 5117 | % % |
| 5118 | % M a g i c k G e t I m a g e G r e e n P r i m a r y % |
| 5119 | % % |
| 5120 | % % |
| 5121 | % % |
| 5122 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5123 | % |
| 5124 | % MagickGetImageGreenPrimary() returns the chromaticy green primary point. |
| 5125 | % |
| 5126 | % The format of the MagickGetImageGreenPrimary method is: |
| 5127 | % |
| 5128 | % MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,double *x, |
| 5129 | % double *y) |
| 5130 | % |
| 5131 | % A description of each parameter follows: |
| 5132 | % |
| 5133 | % o wand: the magick wand. |
| 5134 | % |
| 5135 | % o x: the chromaticity green primary x-point. |
| 5136 | % |
| 5137 | % o y: the chromaticity green primary y-point. |
| 5138 | % |
| 5139 | */ |
| 5140 | WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand, |
| 5141 | double *x,double *y) |
| 5142 | { |
| 5143 | assert(wand != (MagickWand *) NULL); |
| 5144 | assert(wand->signature == WandSignature); |
| 5145 | if (wand->debug != MagickFalse) |
| 5146 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5147 | if (wand->images == (Image *) NULL) |
| 5148 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5149 | *x=wand->images->chromaticity.green_primary.x; |
| 5150 | *y=wand->images->chromaticity.green_primary.y; |
| 5151 | return(MagickTrue); |
| 5152 | } |
| 5153 | |
| 5154 | /* |
| 5155 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5156 | % % |
| 5157 | % % |
| 5158 | % % |
| 5159 | % M a g i c k G e t I m a g e H e i g h t % |
| 5160 | % % |
| 5161 | % % |
| 5162 | % % |
| 5163 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5164 | % |
| 5165 | % MagickGetImageHeight() returns the image height. |
| 5166 | % |
| 5167 | % The format of the MagickGetImageHeight method is: |
| 5168 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5169 | % size_t MagickGetImageHeight(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5170 | % |
| 5171 | % A description of each parameter follows: |
| 5172 | % |
| 5173 | % o wand: the magick wand. |
| 5174 | % |
| 5175 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5176 | WandExport size_t MagickGetImageHeight(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5177 | { |
| 5178 | assert(wand != (MagickWand *) NULL); |
| 5179 | assert(wand->signature == WandSignature); |
| 5180 | if (wand->debug != MagickFalse) |
| 5181 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5182 | if (wand->images == (Image *) NULL) |
| 5183 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5184 | return(wand->images->rows); |
| 5185 | } |
| 5186 | |
| 5187 | /* |
| 5188 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5189 | % % |
| 5190 | % % |
| 5191 | % % |
| 5192 | % M a g i c k G e t I m a g e H i s t o g r a m % |
| 5193 | % % |
| 5194 | % % |
| 5195 | % % |
| 5196 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5197 | % |
| 5198 | % MagickGetImageHistogram() returns the image histogram as an array of |
| 5199 | % PixelWand wands. |
| 5200 | % |
| 5201 | % The format of the MagickGetImageHistogram method is: |
| 5202 | % |
| 5203 | % PixelWand **MagickGetImageHistogram(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5204 | % size_t *number_colors) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5205 | % |
| 5206 | % A description of each parameter follows: |
| 5207 | % |
| 5208 | % o wand: the magick wand. |
| 5209 | % |
| 5210 | % o number_colors: the number of unique colors in the image and the number |
| 5211 | % of pixel wands returned. |
| 5212 | % |
| 5213 | */ |
| 5214 | WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5215 | size_t *number_colors) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5216 | { |
| 5217 | ColorPacket |
| 5218 | *histogram; |
| 5219 | |
| 5220 | PixelWand |
| 5221 | **pixel_wands; |
| 5222 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5223 | register ssize_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5224 | i; |
| 5225 | |
| 5226 | assert(wand != (MagickWand *) NULL); |
| 5227 | assert(wand->signature == WandSignature); |
| 5228 | if (wand->debug != MagickFalse) |
| 5229 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5230 | if (wand->images == (Image *) NULL) |
| 5231 | { |
| 5232 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5233 | "ContainsNoImages","`%s'",wand->name); |
| 5234 | return((PixelWand **) NULL); |
| 5235 | } |
| 5236 | histogram=GetImageHistogram(wand->images,number_colors,wand->exception); |
| 5237 | if (histogram == (ColorPacket *) NULL) |
| 5238 | return((PixelWand **) NULL); |
| 5239 | pixel_wands=NewPixelWands(*number_colors); |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5240 | for (i=0; i < (ssize_t) *number_colors; i++) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5241 | { |
| 5242 | PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel); |
| 5243 | PixelSetIndex(pixel_wands[i],histogram[i].index); |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5244 | PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5245 | } |
| 5246 | histogram=(ColorPacket *) RelinquishMagickMemory(histogram); |
| 5247 | return(pixel_wands); |
| 5248 | } |
| 5249 | |
| 5250 | /* |
| 5251 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5252 | % % |
| 5253 | % % |
| 5254 | % % |
| 5255 | % M a g i c k G e t I m a g e I n t e r l a c e S c h e m e % |
| 5256 | % % |
| 5257 | % % |
| 5258 | % % |
| 5259 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5260 | % |
| 5261 | % MagickGetImageInterlaceScheme() gets the image interlace scheme. |
| 5262 | % |
| 5263 | % The format of the MagickGetImageInterlaceScheme method is: |
| 5264 | % |
| 5265 | % InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand) |
| 5266 | % |
| 5267 | % A description of each parameter follows: |
| 5268 | % |
| 5269 | % o wand: the magick wand. |
| 5270 | % |
| 5271 | */ |
| 5272 | WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand) |
| 5273 | { |
| 5274 | assert(wand != (MagickWand *) NULL); |
| 5275 | assert(wand->signature == WandSignature); |
| 5276 | if (wand->debug != MagickFalse) |
| 5277 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5278 | if (wand->images == (Image *) NULL) |
| 5279 | { |
| 5280 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5281 | "ContainsNoImages","`%s'",wand->name); |
| 5282 | return(UndefinedInterlace); |
| 5283 | } |
| 5284 | return(wand->images->interlace); |
| 5285 | } |
| 5286 | |
| 5287 | /* |
| 5288 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5289 | % % |
| 5290 | % % |
| 5291 | % % |
| 5292 | % M a g i c k G e t I m a g e I n t e r p o l a t e M e t h o d % |
| 5293 | % % |
| 5294 | % % |
| 5295 | % % |
| 5296 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5297 | % |
| 5298 | % MagickGetImageInterpolateMethod() returns the interpolation method for the |
| 5299 | % sepcified image. |
| 5300 | % |
| 5301 | % The format of the MagickGetImageInterpolateMethod method is: |
| 5302 | % |
| 5303 | % InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *wand) |
| 5304 | % |
| 5305 | % A description of each parameter follows: |
| 5306 | % |
| 5307 | % o wand: the magick wand. |
| 5308 | % |
| 5309 | */ |
| 5310 | WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod( |
| 5311 | MagickWand *wand) |
| 5312 | { |
| 5313 | assert(wand != (MagickWand *) NULL); |
| 5314 | assert(wand->signature == WandSignature); |
| 5315 | if (wand->debug != MagickFalse) |
| 5316 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5317 | if (wand->images == (Image *) NULL) |
| 5318 | { |
| 5319 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5320 | "ContainsNoImages","`%s'",wand->name); |
| 5321 | return(UndefinedInterpolatePixel); |
| 5322 | } |
| 5323 | return(wand->images->interpolate); |
| 5324 | } |
| 5325 | |
| 5326 | /* |
| 5327 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5328 | % % |
| 5329 | % % |
| 5330 | % % |
| 5331 | % M a g i c k G e t I m a g e I t e r a t i o n s % |
| 5332 | % % |
| 5333 | % % |
| 5334 | % % |
| 5335 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5336 | % |
| 5337 | % MagickGetImageIterations() gets the image iterations. |
| 5338 | % |
| 5339 | % The format of the MagickGetImageIterations method is: |
| 5340 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5341 | % size_t MagickGetImageIterations(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5342 | % |
| 5343 | % A description of each parameter follows: |
| 5344 | % |
| 5345 | % o wand: the magick wand. |
| 5346 | % |
| 5347 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5348 | WandExport size_t MagickGetImageIterations(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5349 | { |
| 5350 | assert(wand != (MagickWand *) NULL); |
| 5351 | assert(wand->signature == WandSignature); |
| 5352 | if (wand->debug != MagickFalse) |
| 5353 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5354 | if (wand->images == (Image *) NULL) |
| 5355 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5356 | return(wand->images->iterations); |
| 5357 | } |
| 5358 | |
| 5359 | /* |
| 5360 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5361 | % % |
| 5362 | % % |
| 5363 | % % |
| 5364 | % M a g i c k G e t I m a g e L e n g t h % |
| 5365 | % % |
| 5366 | % % |
| 5367 | % % |
| 5368 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5369 | % |
| 5370 | % MagickGetImageLength() returns the image length in bytes. |
| 5371 | % |
| 5372 | % The format of the MagickGetImageLength method is: |
| 5373 | % |
| 5374 | % MagickBooleanType MagickGetImageLength(MagickWand *wand, |
| 5375 | % MagickSizeType *length) |
| 5376 | % |
| 5377 | % A description of each parameter follows: |
| 5378 | % |
| 5379 | % o wand: the magick wand. |
| 5380 | % |
| 5381 | % o length: the image length in bytes. |
| 5382 | % |
| 5383 | */ |
| 5384 | WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand, |
| 5385 | MagickSizeType *length) |
| 5386 | { |
| 5387 | assert(wand != (MagickWand *) NULL); |
| 5388 | assert(wand->signature == WandSignature); |
| 5389 | if (wand->debug != MagickFalse) |
| 5390 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5391 | if (wand->images == (Image *) NULL) |
| 5392 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5393 | *length=GetBlobSize(wand->images); |
| 5394 | return(MagickTrue); |
| 5395 | } |
| 5396 | |
| 5397 | /* |
| 5398 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5399 | % % |
| 5400 | % % |
| 5401 | % % |
| 5402 | % M a g i c k G e t I m a g e M a t t e C o l o r % |
| 5403 | % % |
| 5404 | % % |
| 5405 | % % |
| 5406 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5407 | % |
| 5408 | % MagickGetImageMatteColor() returns the image matte color. |
| 5409 | % |
| 5410 | % The format of the MagickGetImageMatteColor method is: |
| 5411 | % |
| 5412 | % MagickBooleanType MagickGetImagematteColor(MagickWand *wand, |
| 5413 | % PixelWand *matte_color) |
| 5414 | % |
| 5415 | % A description of each parameter follows: |
| 5416 | % |
| 5417 | % o wand: the magick wand. |
| 5418 | % |
| 5419 | % o matte_color: Return the matte color. |
| 5420 | % |
| 5421 | */ |
| 5422 | WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand, |
| 5423 | PixelWand *matte_color) |
| 5424 | { |
| 5425 | assert(wand != (MagickWand *) NULL); |
| 5426 | assert(wand->signature == WandSignature); |
| 5427 | if (wand->debug != MagickFalse) |
| 5428 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5429 | if (wand->images == (Image *) NULL) |
| 5430 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5431 | PixelSetQuantumColor(matte_color,&wand->images->matte_color); |
| 5432 | return(MagickTrue); |
| 5433 | } |
| 5434 | |
| 5435 | /* |
| 5436 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5437 | % % |
| 5438 | % % |
| 5439 | % % |
| 5440 | % M a g i c k G e t I m a g e O r i e n t a t i o n % |
| 5441 | % % |
| 5442 | % % |
| 5443 | % % |
| 5444 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5445 | % |
| 5446 | % MagickGetImageOrientation() returns the image orientation. |
| 5447 | % |
| 5448 | % The format of the MagickGetImageOrientation method is: |
| 5449 | % |
| 5450 | % OrientationType MagickGetImageOrientation(MagickWand *wand) |
| 5451 | % |
| 5452 | % A description of each parameter follows: |
| 5453 | % |
| 5454 | % o wand: the magick wand. |
| 5455 | % |
| 5456 | */ |
| 5457 | WandExport OrientationType MagickGetImageOrientation(MagickWand *wand) |
| 5458 | { |
| 5459 | assert(wand != (MagickWand *) NULL); |
| 5460 | assert(wand->signature == WandSignature); |
| 5461 | if (wand->debug != MagickFalse) |
| 5462 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5463 | if (wand->images == (Image *) NULL) |
| 5464 | { |
| 5465 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5466 | "ContainsNoImages","`%s'",wand->name); |
| 5467 | return(UndefinedOrientation); |
| 5468 | } |
| 5469 | return(wand->images->orientation); |
| 5470 | } |
| 5471 | |
| 5472 | /* |
| 5473 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5474 | % % |
| 5475 | % % |
| 5476 | % % |
| 5477 | % M a g i c k G e t I m a g e P a g e % |
| 5478 | % % |
| 5479 | % % |
| 5480 | % % |
| 5481 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5482 | % |
| 5483 | % MagickGetImagePage() returns the page geometry associated with the image. |
| 5484 | % |
| 5485 | % The format of the MagickGetImagePage method is: |
| 5486 | % |
| 5487 | % MagickBooleanType MagickGetImagePage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5488 | % size_t *width,size_t *height,ssize_t *x,ssize_t *y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5489 | % |
| 5490 | % A description of each parameter follows: |
| 5491 | % |
| 5492 | % o wand: the magick wand. |
| 5493 | % |
| 5494 | % o width: the page width. |
| 5495 | % |
| 5496 | % o height: the page height. |
| 5497 | % |
| 5498 | % o x: the page x-offset. |
| 5499 | % |
| 5500 | % o y: the page y-offset. |
| 5501 | % |
| 5502 | */ |
| 5503 | WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5504 | size_t *width,size_t *height,ssize_t *x,ssize_t *y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5505 | { |
| 5506 | assert(wand != (const MagickWand *) NULL); |
| 5507 | assert(wand->signature == WandSignature); |
| 5508 | if (wand->debug != MagickFalse) |
| 5509 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5510 | if (wand->images == (Image *) NULL) |
| 5511 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5512 | *width=wand->images->page.width; |
| 5513 | *height=wand->images->page.height; |
| 5514 | *x=wand->images->page.x; |
| 5515 | *y=wand->images->page.y; |
| 5516 | return(MagickTrue); |
| 5517 | } |
| 5518 | |
| 5519 | /* |
| 5520 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5521 | % % |
| 5522 | % % |
| 5523 | % % |
| 5524 | % M a g i c k G e t I m a g e P i x e l C o l o r % |
| 5525 | % % |
| 5526 | % % |
| 5527 | % % |
| 5528 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5529 | % |
| 5530 | % MagickGetImagePixelColor() returns the color of the specified pixel. |
| 5531 | % |
| 5532 | % The format of the MagickGetImagePixelColor method is: |
| 5533 | % |
| 5534 | % MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5535 | % const ssize_t x,const ssize_t y,PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5536 | % |
| 5537 | % A description of each parameter follows: |
| 5538 | % |
| 5539 | % o wand: the magick wand. |
| 5540 | % |
| 5541 | % o x,y: the pixel offset into the image. |
| 5542 | % |
| 5543 | % o color: Return the colormap color in this wand. |
| 5544 | % |
| 5545 | */ |
| 5546 | WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5547 | const ssize_t x,const ssize_t y,PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5548 | { |
| 5549 | IndexPacket |
| 5550 | *indexes; |
| 5551 | |
| 5552 | register const PixelPacket |
| 5553 | *p; |
| 5554 | |
| 5555 | CacheView |
| 5556 | *image_view; |
| 5557 | |
| 5558 | assert(wand != (MagickWand *) NULL); |
| 5559 | assert(wand->signature == WandSignature); |
| 5560 | if (wand->debug != MagickFalse) |
| 5561 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5562 | if (wand->images == (Image *) NULL) |
| 5563 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5564 | image_view=AcquireCacheView(wand->images); |
| 5565 | p=GetCacheViewVirtualPixels(image_view,x,y,1,1,wand->exception); |
| 5566 | if (p == (const PixelPacket *) NULL) |
| 5567 | { |
| 5568 | image_view=DestroyCacheView(image_view); |
| 5569 | return(MagickFalse); |
| 5570 | } |
| 5571 | indexes=GetCacheViewAuthenticIndexQueue(image_view); |
| 5572 | PixelSetQuantumColor(color,p); |
| 5573 | if (GetCacheViewColorspace(image_view) == CMYKColorspace) |
| 5574 | PixelSetBlackQuantum(color,*indexes); |
| 5575 | else |
| 5576 | if (GetCacheViewStorageClass(image_view) == PseudoClass) |
| 5577 | PixelSetIndex(color,*indexes); |
| 5578 | image_view=DestroyCacheView(image_view); |
| 5579 | return(MagickTrue); |
| 5580 | } |
| 5581 | |
| 5582 | /* |
| 5583 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5584 | % % |
| 5585 | % % |
| 5586 | % % |
| 5587 | + M a g i c k G e t I m a g e R a n g e % |
| 5588 | % % |
| 5589 | % % |
| 5590 | % % |
| 5591 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5592 | % |
| 5593 | % MagickGetImageRange() gets the pixel range for the image. |
| 5594 | % |
| 5595 | % The format of the MagickGetImageRange method is: |
| 5596 | % |
| 5597 | % MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima, |
| 5598 | % double *maxima) |
| 5599 | % |
| 5600 | % A description of each parameter follows: |
| 5601 | % |
| 5602 | % o wand: the magick wand. |
| 5603 | % |
| 5604 | % o minima: The minimum pixel value for the specified channel(s). |
| 5605 | % |
| 5606 | % o maxima: The maximum pixel value for the specified channel(s). |
| 5607 | % |
| 5608 | */ |
| 5609 | WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, |
| 5610 | double *minima,double *maxima) |
| 5611 | { |
| 5612 | MagickBooleanType |
| 5613 | status; |
| 5614 | |
| 5615 | assert(wand != (MagickWand *) NULL); |
| 5616 | assert(wand->signature == WandSignature); |
| 5617 | if (wand->debug != MagickFalse) |
| 5618 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5619 | if (wand->images == (Image *) NULL) |
| 5620 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5621 | status=GetImageRange(wand->images,minima,maxima,wand->exception); |
| 5622 | return(status); |
| 5623 | } |
| 5624 | |
| 5625 | /* |
| 5626 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5627 | % % |
| 5628 | % % |
| 5629 | % % |
| 5630 | % M a g i c k G e t I m a g e R e d P r i m a r y % |
| 5631 | % % |
| 5632 | % % |
| 5633 | % % |
| 5634 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5635 | % |
| 5636 | % MagickGetImageRedPrimary() returns the chromaticy red primary point. |
| 5637 | % |
| 5638 | % The format of the MagickGetImageRedPrimary method is: |
| 5639 | % |
| 5640 | % MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,double *x, |
| 5641 | % double *y) |
| 5642 | % |
| 5643 | % A description of each parameter follows: |
| 5644 | % |
| 5645 | % o wand: the magick wand. |
| 5646 | % |
| 5647 | % o x: the chromaticity red primary x-point. |
| 5648 | % |
| 5649 | % o y: the chromaticity red primary y-point. |
| 5650 | % |
| 5651 | */ |
| 5652 | WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand, |
| 5653 | double *x,double *y) |
| 5654 | { |
| 5655 | assert(wand != (MagickWand *) NULL); |
| 5656 | assert(wand->signature == WandSignature); |
| 5657 | if (wand->debug != MagickFalse) |
| 5658 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5659 | if (wand->images == (Image *) NULL) |
| 5660 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5661 | *x=wand->images->chromaticity.red_primary.x; |
| 5662 | *y=wand->images->chromaticity.red_primary.y; |
| 5663 | return(MagickTrue); |
| 5664 | } |
| 5665 | |
| 5666 | /* |
| 5667 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5668 | % % |
| 5669 | % % |
| 5670 | % % |
| 5671 | % M a g i c k G e t I m a g e R e g i o n % |
| 5672 | % % |
| 5673 | % % |
| 5674 | % % |
| 5675 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5676 | % |
| 5677 | % MagickGetImageRegion() extracts a region of the image and returns it as a |
| 5678 | % a new wand. |
| 5679 | % |
| 5680 | % The format of the MagickGetImageRegion method is: |
| 5681 | % |
| 5682 | % MagickWand *MagickGetImageRegion(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5683 | % const size_t width,const size_t height,const ssize_t x, |
| 5684 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5685 | % |
| 5686 | % A description of each parameter follows: |
| 5687 | % |
| 5688 | % o wand: the magick wand. |
| 5689 | % |
| 5690 | % o width: the region width. |
| 5691 | % |
| 5692 | % o height: the region height. |
| 5693 | % |
| 5694 | % o x: the region x offset. |
| 5695 | % |
| 5696 | % o y: the region y offset. |
| 5697 | % |
| 5698 | */ |
| 5699 | WandExport MagickWand *MagickGetImageRegion(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5700 | const size_t width,const size_t height,const ssize_t x, |
| 5701 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5702 | { |
| 5703 | Image |
| 5704 | *region_image; |
| 5705 | |
| 5706 | RectangleInfo |
| 5707 | region; |
| 5708 | |
| 5709 | assert(wand != (MagickWand *) NULL); |
| 5710 | assert(wand->signature == WandSignature); |
| 5711 | if (wand->debug != MagickFalse) |
| 5712 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5713 | if (wand->images == (Image *) NULL) |
| 5714 | return((MagickWand *) NULL); |
| 5715 | region.width=width; |
| 5716 | region.height=height; |
| 5717 | region.x=x; |
| 5718 | region.y=y; |
| 5719 | region_image=CropImage(wand->images,®ion,wand->exception); |
| 5720 | if (region_image == (Image *) NULL) |
| 5721 | return((MagickWand *) NULL); |
| 5722 | return(CloneMagickWandFromImages(wand,region_image)); |
| 5723 | } |
| 5724 | |
| 5725 | /* |
| 5726 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5727 | % % |
| 5728 | % % |
| 5729 | % % |
| 5730 | % M a g i c k G e t I m a g e R e n d e r i n g I n t e n t % |
| 5731 | % % |
| 5732 | % % |
| 5733 | % % |
| 5734 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5735 | % |
| 5736 | % MagickGetImageRenderingIntent() gets the image rendering intent. |
| 5737 | % |
| 5738 | % The format of the MagickGetImageRenderingIntent method is: |
| 5739 | % |
| 5740 | % RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand) |
| 5741 | % |
| 5742 | % A description of each parameter follows: |
| 5743 | % |
| 5744 | % o wand: the magick wand. |
| 5745 | % |
| 5746 | */ |
| 5747 | WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand) |
| 5748 | { |
| 5749 | assert(wand != (MagickWand *) NULL); |
| 5750 | assert(wand->signature == WandSignature); |
| 5751 | if (wand->debug != MagickFalse) |
| 5752 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5753 | if (wand->images == (Image *) NULL) |
| 5754 | { |
| 5755 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5756 | "ContainsNoImages","`%s'",wand->name); |
| 5757 | return(UndefinedIntent); |
| 5758 | } |
| 5759 | return((RenderingIntent) wand->images->rendering_intent); |
| 5760 | } |
| 5761 | |
| 5762 | /* |
| 5763 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5764 | % % |
| 5765 | % % |
| 5766 | % % |
| 5767 | % M a g i c k G e t I m a g e R e s o l u t i o n % |
| 5768 | % % |
| 5769 | % % |
| 5770 | % % |
| 5771 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5772 | % |
| 5773 | % MagickGetImageResolution() gets the image X and Y resolution. |
| 5774 | % |
| 5775 | % The format of the MagickGetImageResolution method is: |
| 5776 | % |
| 5777 | % MagickBooleanType MagickGetImageResolution(MagickWand *wand,double *x, |
| 5778 | % double *y) |
| 5779 | % |
| 5780 | % A description of each parameter follows: |
| 5781 | % |
| 5782 | % o wand: the magick wand. |
| 5783 | % |
| 5784 | % o x: the image x-resolution. |
| 5785 | % |
| 5786 | % o y: the image y-resolution. |
| 5787 | % |
| 5788 | */ |
| 5789 | WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand, |
| 5790 | double *x,double *y) |
| 5791 | { |
| 5792 | assert(wand != (MagickWand *) NULL); |
| 5793 | assert(wand->signature == WandSignature); |
| 5794 | if (wand->debug != MagickFalse) |
| 5795 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5796 | if (wand->images == (Image *) NULL) |
| 5797 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5798 | *x=wand->images->x_resolution; |
| 5799 | *y=wand->images->y_resolution; |
| 5800 | return(MagickTrue); |
| 5801 | } |
| 5802 | |
| 5803 | /* |
| 5804 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5805 | % % |
| 5806 | % % |
| 5807 | % % |
| 5808 | % M a g i c k G e t I m a g e S c e n e % |
| 5809 | % % |
| 5810 | % % |
| 5811 | % % |
| 5812 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5813 | % |
| 5814 | % MagickGetImageScene() gets the image scene. |
| 5815 | % |
| 5816 | % The format of the MagickGetImageScene method is: |
| 5817 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5818 | % size_t MagickGetImageScene(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5819 | % |
| 5820 | % A description of each parameter follows: |
| 5821 | % |
| 5822 | % o wand: the magick wand. |
| 5823 | % |
| 5824 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5825 | WandExport size_t MagickGetImageScene(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5826 | { |
| 5827 | assert(wand != (MagickWand *) NULL); |
| 5828 | assert(wand->signature == WandSignature); |
| 5829 | if (wand->debug != MagickFalse) |
| 5830 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5831 | if (wand->images == (Image *) NULL) |
| 5832 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 5833 | return(wand->images->scene); |
| 5834 | } |
| 5835 | |
| 5836 | /* |
| 5837 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5838 | % % |
| 5839 | % % |
| 5840 | % % |
| 5841 | % M a g i c k G e t I m a g e S i g n a t u r e % |
| 5842 | % % |
| 5843 | % % |
| 5844 | % % |
| 5845 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5846 | % |
| 5847 | % MagickGetImageSignature() generates an SHA-256 message digest for the image |
| 5848 | % pixel stream. |
| 5849 | % |
| 5850 | % The format of the MagickGetImageSignature method is: |
| 5851 | % |
| 5852 | % const char MagickGetImageSignature(MagickWand *wand) |
| 5853 | % |
| 5854 | % A description of each parameter follows: |
| 5855 | % |
| 5856 | % o wand: the magick wand. |
| 5857 | % |
| 5858 | */ |
| 5859 | WandExport char *MagickGetImageSignature(MagickWand *wand) |
| 5860 | { |
| 5861 | const char |
| 5862 | *value; |
| 5863 | |
| 5864 | MagickBooleanType |
| 5865 | status; |
| 5866 | |
| 5867 | assert(wand != (MagickWand *) NULL); |
| 5868 | assert(wand->signature == WandSignature); |
| 5869 | if (wand->debug != MagickFalse) |
| 5870 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5871 | if (wand->images == (Image *) NULL) |
| 5872 | { |
| 5873 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5874 | "ContainsNoImages","`%s'",wand->name); |
| 5875 | return((char *) NULL); |
| 5876 | } |
| 5877 | status=SignatureImage(wand->images); |
| 5878 | if (status == MagickFalse) |
| 5879 | InheritException(wand->exception,&wand->images->exception); |
| 5880 | value=GetImageProperty(wand->images,"signature"); |
| 5881 | if (value != (const char *) NULL) |
| 5882 | return(AcquireString(value)); |
| 5883 | InheritException(wand->exception,&wand->images->exception); |
| 5884 | return((char *) NULL); |
| 5885 | } |
| 5886 | |
| 5887 | /* |
| 5888 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5889 | % % |
| 5890 | % % |
| 5891 | % % |
| 5892 | % M a g i c k G e t I m a g e T i c k s P e r S e c o n d % |
| 5893 | % % |
| 5894 | % % |
| 5895 | % % |
| 5896 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5897 | % |
| 5898 | % MagickGetImageTicksPerSecond() gets the image ticks-per-second. |
| 5899 | % |
| 5900 | % The format of the MagickGetImageTicksPerSecond method is: |
| 5901 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5902 | % size_t MagickGetImageTicksPerSecond(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5903 | % |
| 5904 | % A description of each parameter follows: |
| 5905 | % |
| 5906 | % o wand: the magick wand. |
| 5907 | % |
| 5908 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5909 | WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5910 | { |
| 5911 | assert(wand != (MagickWand *) NULL); |
| 5912 | assert(wand->signature == WandSignature); |
| 5913 | if (wand->debug != MagickFalse) |
| 5914 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5915 | if (wand->images == (Image *) NULL) |
| 5916 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 5917 | return((size_t) wand->images->ticks_per_second); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5918 | } |
| 5919 | |
| 5920 | /* |
| 5921 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5922 | % % |
| 5923 | % % |
| 5924 | % % |
| 5925 | % M a g i c k G e t I m a g e T y p e % |
| 5926 | % % |
| 5927 | % % |
| 5928 | % % |
| 5929 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5930 | % |
| 5931 | % MagickGetImageType() gets the potential image type: |
| 5932 | % |
| 5933 | % Bilevel Grayscale GrayscaleMatte |
| 5934 | % Palette PaletteMatte TrueColor |
| 5935 | % TrueColorMatte ColorSeparation ColorSeparationMatte |
| 5936 | % |
| 5937 | % To ensure the image type matches its potential, use MagickSetImageType(): |
| 5938 | % |
| 5939 | % (void) MagickSetImageType(wand,MagickGetImageType(wand)); |
| 5940 | % |
| 5941 | % The format of the MagickGetImageType method is: |
| 5942 | % |
| 5943 | % ImageType MagickGetImageType(MagickWand *wand) |
| 5944 | % |
| 5945 | % A description of each parameter follows: |
| 5946 | % |
| 5947 | % o wand: the magick wand. |
| 5948 | % |
| 5949 | */ |
| 5950 | WandExport ImageType MagickGetImageType(MagickWand *wand) |
| 5951 | { |
| 5952 | assert(wand != (MagickWand *) NULL); |
| 5953 | assert(wand->signature == WandSignature); |
| 5954 | if (wand->debug != MagickFalse) |
| 5955 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5956 | if (wand->images == (Image *) NULL) |
| 5957 | { |
| 5958 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5959 | "ContainsNoImages","`%s'",wand->name); |
cristy | 5f1c1ff | 2010-12-23 21:38:06 +0000 | [diff] [blame] | 5960 | return(UndefinedType); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5961 | } |
| 5962 | return(GetImageType(wand->images,wand->exception)); |
| 5963 | } |
| 5964 | |
| 5965 | /* |
| 5966 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5967 | % % |
| 5968 | % % |
| 5969 | % % |
| 5970 | % M a g i c k G e t I m a g e U n i t s % |
| 5971 | % % |
| 5972 | % % |
| 5973 | % % |
| 5974 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 5975 | % |
| 5976 | % MagickGetImageUnits() gets the image units of resolution. |
| 5977 | % |
| 5978 | % The format of the MagickGetImageUnits method is: |
| 5979 | % |
| 5980 | % ResolutionType MagickGetImageUnits(MagickWand *wand) |
| 5981 | % |
| 5982 | % A description of each parameter follows: |
| 5983 | % |
| 5984 | % o wand: the magick wand. |
| 5985 | % |
| 5986 | */ |
| 5987 | WandExport ResolutionType MagickGetImageUnits(MagickWand *wand) |
| 5988 | { |
| 5989 | assert(wand != (MagickWand *) NULL); |
| 5990 | assert(wand->signature == WandSignature); |
| 5991 | if (wand->debug != MagickFalse) |
| 5992 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 5993 | if (wand->images == (Image *) NULL) |
| 5994 | { |
| 5995 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 5996 | "ContainsNoImages","`%s'",wand->name); |
| 5997 | return(UndefinedResolution); |
| 5998 | } |
| 5999 | return(wand->images->units); |
| 6000 | } |
| 6001 | |
| 6002 | /* |
| 6003 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6004 | % % |
| 6005 | % % |
| 6006 | % % |
| 6007 | % M a g i c k G e t I m a g e V i r t u a l P i x e l M e t h o d % |
| 6008 | % % |
| 6009 | % % |
| 6010 | % % |
| 6011 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6012 | % |
| 6013 | % MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the |
| 6014 | % sepcified image. |
| 6015 | % |
| 6016 | % The format of the MagickGetImageVirtualPixelMethod method is: |
| 6017 | % |
| 6018 | % VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand) |
| 6019 | % |
| 6020 | % A description of each parameter follows: |
| 6021 | % |
| 6022 | % o wand: the magick wand. |
| 6023 | % |
| 6024 | */ |
| 6025 | WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand) |
| 6026 | { |
| 6027 | assert(wand != (MagickWand *) NULL); |
| 6028 | assert(wand->signature == WandSignature); |
| 6029 | if (wand->debug != MagickFalse) |
| 6030 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6031 | if (wand->images == (Image *) NULL) |
| 6032 | { |
| 6033 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 6034 | "ContainsNoImages","`%s'",wand->name); |
| 6035 | return(UndefinedVirtualPixelMethod); |
| 6036 | } |
| 6037 | return(GetImageVirtualPixelMethod(wand->images)); |
| 6038 | } |
| 6039 | |
| 6040 | /* |
| 6041 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6042 | % % |
| 6043 | % % |
| 6044 | % % |
| 6045 | % M a g i c k G e t I m a g e W h i t e P o i n t % |
| 6046 | % % |
| 6047 | % % |
| 6048 | % % |
| 6049 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6050 | % |
| 6051 | % MagickGetImageWhitePoint() returns the chromaticy white point. |
| 6052 | % |
| 6053 | % The format of the MagickGetImageWhitePoint method is: |
| 6054 | % |
| 6055 | % MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,double *x, |
| 6056 | % double *y) |
| 6057 | % |
| 6058 | % A description of each parameter follows: |
| 6059 | % |
| 6060 | % o wand: the magick wand. |
| 6061 | % |
| 6062 | % o x: the chromaticity white x-point. |
| 6063 | % |
| 6064 | % o y: the chromaticity white y-point. |
| 6065 | % |
| 6066 | */ |
| 6067 | WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand, |
| 6068 | double *x,double *y) |
| 6069 | { |
| 6070 | assert(wand != (MagickWand *) NULL); |
| 6071 | assert(wand->signature == WandSignature); |
| 6072 | if (wand->debug != MagickFalse) |
| 6073 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6074 | if (wand->images == (Image *) NULL) |
| 6075 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6076 | *x=wand->images->chromaticity.white_point.x; |
| 6077 | *y=wand->images->chromaticity.white_point.y; |
| 6078 | return(MagickTrue); |
| 6079 | } |
| 6080 | |
| 6081 | /* |
| 6082 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6083 | % % |
| 6084 | % % |
| 6085 | % % |
| 6086 | % M a g i c k G e t I m a g e W i d t h % |
| 6087 | % % |
| 6088 | % % |
| 6089 | % % |
| 6090 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6091 | % |
| 6092 | % MagickGetImageWidth() returns the image width. |
| 6093 | % |
| 6094 | % The format of the MagickGetImageWidth method is: |
| 6095 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6096 | % size_t MagickGetImageWidth(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6097 | % |
| 6098 | % A description of each parameter follows: |
| 6099 | % |
| 6100 | % o wand: the magick wand. |
| 6101 | % |
| 6102 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6103 | WandExport size_t MagickGetImageWidth(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6104 | { |
| 6105 | assert(wand != (MagickWand *) NULL); |
| 6106 | assert(wand->signature == WandSignature); |
| 6107 | if (wand->debug != MagickFalse) |
| 6108 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6109 | if (wand->images == (Image *) NULL) |
| 6110 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6111 | return(wand->images->columns); |
| 6112 | } |
| 6113 | |
| 6114 | /* |
| 6115 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6116 | % % |
| 6117 | % % |
| 6118 | % % |
| 6119 | % M a g i c k G e t N u m b e r I m a g e s % |
| 6120 | % % |
| 6121 | % % |
| 6122 | % % |
| 6123 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6124 | % |
| 6125 | % MagickGetNumberImages() returns the number of images associated with a |
| 6126 | % magick wand. |
| 6127 | % |
| 6128 | % The format of the MagickGetNumberImages method is: |
| 6129 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6130 | % size_t MagickGetNumberImages(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6131 | % |
| 6132 | % A description of each parameter follows: |
| 6133 | % |
| 6134 | % o wand: the magick wand. |
| 6135 | % |
| 6136 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6137 | WandExport size_t MagickGetNumberImages(MagickWand *wand) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6138 | { |
| 6139 | assert(wand != (MagickWand *) NULL); |
| 6140 | assert(wand->signature == WandSignature); |
| 6141 | if (wand->debug != MagickFalse) |
| 6142 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6143 | return(GetImageListLength(wand->images)); |
| 6144 | } |
| 6145 | |
| 6146 | /* |
| 6147 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6148 | % % |
| 6149 | % % |
| 6150 | % % |
| 6151 | % M a g i c k I m a g e G e t T o t a l I n k D e n s i t y % |
| 6152 | % % |
| 6153 | % % |
| 6154 | % % |
| 6155 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6156 | % |
| 6157 | % MagickGetImageTotalInkDensity() gets the image total ink density. |
| 6158 | % |
| 6159 | % The format of the MagickGetImageTotalInkDensity method is: |
| 6160 | % |
| 6161 | % double MagickGetImageTotalInkDensity(MagickWand *wand) |
| 6162 | % |
| 6163 | % A description of each parameter follows: |
| 6164 | % |
| 6165 | % o wand: the magick wand. |
| 6166 | % |
| 6167 | */ |
| 6168 | WandExport double MagickGetImageTotalInkDensity(MagickWand *wand) |
| 6169 | { |
| 6170 | assert(wand != (MagickWand *) NULL); |
| 6171 | assert(wand->signature == WandSignature); |
| 6172 | if (wand->debug != MagickFalse) |
| 6173 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6174 | if (wand->images == (Image *) NULL) |
| 6175 | { |
| 6176 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 6177 | "ContainsNoImages","`%s'",wand->name); |
| 6178 | return(0.0); |
| 6179 | } |
| 6180 | return(GetImageTotalInkDensity(wand->images)); |
| 6181 | } |
| 6182 | |
| 6183 | /* |
| 6184 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6185 | % % |
| 6186 | % % |
| 6187 | % % |
| 6188 | % M a g i c k H a l d C l u t I m a g e % |
| 6189 | % % |
| 6190 | % % |
| 6191 | % % |
| 6192 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6193 | % |
| 6194 | % MagickHaldClutImage() replaces colors in the image from a Hald color lookup |
| 6195 | % table. A Hald color lookup table is a 3-dimensional color cube mapped to 2 |
| 6196 | % dimensions. Create it with the HALD coder. You can apply any color |
| 6197 | % transformation to the Hald image and then use this method to apply the |
| 6198 | % transform to the image. |
| 6199 | % |
| 6200 | % The format of the MagickHaldClutImage method is: |
| 6201 | % |
| 6202 | % MagickBooleanType MagickHaldClutImage(MagickWand *wand, |
| 6203 | % const MagickWand *hald_wand) |
| 6204 | % MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand, |
| 6205 | % const ChannelType channel,const MagickWand *hald_wand) |
| 6206 | % |
| 6207 | % A description of each parameter follows: |
| 6208 | % |
| 6209 | % o wand: the magick wand. |
| 6210 | % |
| 6211 | % o hald_image: the hald CLUT image. |
| 6212 | % |
| 6213 | */ |
| 6214 | |
| 6215 | WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand, |
| 6216 | const MagickWand *hald_wand) |
| 6217 | { |
| 6218 | MagickBooleanType |
| 6219 | status; |
| 6220 | |
| 6221 | status=MagickHaldClutImageChannel(wand,DefaultChannels,hald_wand); |
| 6222 | return(status); |
| 6223 | } |
| 6224 | |
| 6225 | WandExport MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand, |
| 6226 | const ChannelType channel,const MagickWand *hald_wand) |
| 6227 | { |
| 6228 | MagickBooleanType |
| 6229 | status; |
| 6230 | |
| 6231 | assert(wand != (MagickWand *) NULL); |
| 6232 | assert(wand->signature == WandSignature); |
| 6233 | if (wand->debug != MagickFalse) |
| 6234 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6235 | if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL)) |
| 6236 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6237 | status=HaldClutImageChannel(wand->images,channel,hald_wand->images); |
| 6238 | if (status == MagickFalse) |
| 6239 | InheritException(wand->exception,&wand->images->exception); |
| 6240 | return(status); |
| 6241 | } |
| 6242 | |
| 6243 | /* |
| 6244 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6245 | % % |
| 6246 | % % |
| 6247 | % % |
| 6248 | % M a g i c k H a s N e x t I m a g e % |
| 6249 | % % |
| 6250 | % % |
| 6251 | % % |
| 6252 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6253 | % |
| 6254 | % MagickHasNextImage() returns MagickTrue if the wand has more images when |
| 6255 | % traversing the list in the forward direction |
| 6256 | % |
| 6257 | % The format of the MagickHasNextImage method is: |
| 6258 | % |
| 6259 | % MagickBooleanType MagickHasNextImage(MagickWand *wand) |
| 6260 | % |
| 6261 | % A description of each parameter follows: |
| 6262 | % |
| 6263 | % o wand: the magick wand. |
| 6264 | % |
| 6265 | */ |
| 6266 | WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand) |
| 6267 | { |
| 6268 | assert(wand != (MagickWand *) NULL); |
| 6269 | assert(wand->signature == WandSignature); |
| 6270 | if (wand->debug != MagickFalse) |
| 6271 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6272 | if (wand->images == (Image *) NULL) |
| 6273 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6274 | if (GetNextImageInList(wand->images) == (Image *) NULL) |
| 6275 | return(MagickFalse); |
| 6276 | return(MagickTrue); |
| 6277 | } |
| 6278 | |
| 6279 | /* |
| 6280 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6281 | % % |
| 6282 | % % |
| 6283 | % % |
| 6284 | % M a g i c k H a s P r e v i o u s I m a g e % |
| 6285 | % % |
| 6286 | % % |
| 6287 | % % |
| 6288 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6289 | % |
| 6290 | % MagickHasPreviousImage() returns MagickTrue if the wand has more images when |
| 6291 | % traversing the list in the reverse direction |
| 6292 | % |
| 6293 | % The format of the MagickHasPreviousImage method is: |
| 6294 | % |
| 6295 | % MagickBooleanType MagickHasPreviousImage(MagickWand *wand) |
| 6296 | % |
| 6297 | % A description of each parameter follows: |
| 6298 | % |
| 6299 | % o wand: the magick wand. |
| 6300 | % |
| 6301 | */ |
| 6302 | WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand) |
| 6303 | { |
| 6304 | assert(wand != (MagickWand *) NULL); |
| 6305 | assert(wand->signature == WandSignature); |
| 6306 | if (wand->debug != MagickFalse) |
| 6307 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6308 | if (wand->images == (Image *) NULL) |
| 6309 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6310 | if (GetPreviousImageInList(wand->images) == (Image *) NULL) |
| 6311 | return(MagickFalse); |
| 6312 | return(MagickTrue); |
| 6313 | } |
| 6314 | |
| 6315 | /* |
| 6316 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6317 | % % |
| 6318 | % % |
| 6319 | % % |
| 6320 | % M a g i c k I d e n t i f y I m a g e % |
| 6321 | % % |
| 6322 | % % |
| 6323 | % % |
| 6324 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6325 | % |
| 6326 | % MagickIdentifyImage() identifies an image by printing its attributes to the |
| 6327 | % file. Attributes include the image width, height, size, and others. |
| 6328 | % |
| 6329 | % The format of the MagickIdentifyImage method is: |
| 6330 | % |
| 6331 | % const char *MagickIdentifyImage(MagickWand *wand) |
| 6332 | % |
| 6333 | % A description of each parameter follows: |
| 6334 | % |
| 6335 | % o wand: the magick wand. |
| 6336 | % |
| 6337 | */ |
| 6338 | WandExport char *MagickIdentifyImage(MagickWand *wand) |
| 6339 | { |
| 6340 | char |
| 6341 | *description, |
| 6342 | filename[MaxTextExtent]; |
| 6343 | |
| 6344 | FILE |
| 6345 | *file; |
| 6346 | |
| 6347 | int |
| 6348 | unique_file; |
| 6349 | |
| 6350 | assert(wand != (MagickWand *) NULL); |
| 6351 | assert(wand->signature == WandSignature); |
| 6352 | if (wand->debug != MagickFalse) |
| 6353 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6354 | if (wand->images == (Image *) NULL) |
| 6355 | { |
| 6356 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 6357 | "ContainsNoImages","`%s'",wand->name); |
| 6358 | return((char *) NULL); |
| 6359 | } |
| 6360 | description=(char *) NULL; |
| 6361 | unique_file=AcquireUniqueFileResource(filename); |
| 6362 | file=(FILE *) NULL; |
| 6363 | if (unique_file != -1) |
| 6364 | file=fdopen(unique_file,"wb"); |
| 6365 | if ((unique_file == -1) || (file == (FILE *) NULL)) |
| 6366 | { |
| 6367 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 6368 | "UnableToCreateTemporaryFile","`%s'",wand->name); |
| 6369 | return((char *) NULL); |
| 6370 | } |
| 6371 | (void) IdentifyImage(wand->images,file,MagickTrue); |
| 6372 | (void) fclose(file); |
| 6373 | description=FileToString(filename,~0,wand->exception); |
| 6374 | (void) RelinquishUniqueFileResource(filename); |
| 6375 | return(description); |
| 6376 | } |
| 6377 | |
| 6378 | /* |
| 6379 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6380 | % % |
| 6381 | % % |
| 6382 | % % |
| 6383 | % M a g i c k I m p l o d e I m a g e % |
| 6384 | % % |
| 6385 | % % |
| 6386 | % % |
| 6387 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6388 | % |
| 6389 | % MagickImplodeImage() creates a new image that is a copy of an existing |
| 6390 | % one with the image pixels "implode" by the specified percentage. It |
| 6391 | % allocates the memory necessary for the new Image structure and returns a |
| 6392 | % pointer to the new image. |
| 6393 | % |
| 6394 | % The format of the MagickImplodeImage method is: |
| 6395 | % |
| 6396 | % MagickBooleanType MagickImplodeImage(MagickWand *wand, |
| 6397 | % const double radius) |
| 6398 | % |
| 6399 | % A description of each parameter follows: |
| 6400 | % |
| 6401 | % o wand: the magick wand. |
| 6402 | % |
| 6403 | % o amount: Define the extent of the implosion. |
| 6404 | % |
| 6405 | */ |
| 6406 | WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand, |
| 6407 | const double amount) |
| 6408 | { |
| 6409 | Image |
| 6410 | *implode_image; |
| 6411 | |
| 6412 | assert(wand != (MagickWand *) NULL); |
| 6413 | assert(wand->signature == WandSignature); |
| 6414 | if (wand->debug != MagickFalse) |
| 6415 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6416 | if (wand->images == (Image *) NULL) |
| 6417 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6418 | implode_image=ImplodeImage(wand->images,amount,wand->exception); |
| 6419 | if (implode_image == (Image *) NULL) |
| 6420 | return(MagickFalse); |
| 6421 | ReplaceImageInList(&wand->images,implode_image); |
| 6422 | return(MagickTrue); |
| 6423 | } |
| 6424 | |
| 6425 | /* |
| 6426 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6427 | % % |
| 6428 | % % |
| 6429 | % % |
| 6430 | % M a g i c k I m p o r t I m a g e P i x e l s % |
| 6431 | % % |
| 6432 | % % |
| 6433 | % % |
| 6434 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6435 | % |
| 6436 | % MagickImportImagePixels() accepts pixel datand stores it in the image at the |
| 6437 | % location you specify. The method returns MagickFalse on success otherwise |
| 6438 | % MagickTrue if an error is encountered. The pixel data can be either char, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6439 | % short int, int, ssize_t, float, or double in the order specified by map. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6440 | % |
| 6441 | % Suppose your want to upload the first scanline of a 640x480 image from |
| 6442 | % character data in red-green-blue order: |
| 6443 | % |
| 6444 | % MagickImportImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels); |
| 6445 | % |
| 6446 | % The format of the MagickImportImagePixels method is: |
| 6447 | % |
| 6448 | % MagickBooleanType MagickImportImagePixels(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6449 | % const ssize_t x,const ssize_t y,const size_t columns, |
| 6450 | % const size_t rows,const char *map,const StorageType storage, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6451 | % const void *pixels) |
| 6452 | % |
| 6453 | % A description of each parameter follows: |
| 6454 | % |
| 6455 | % o wand: the magick wand. |
| 6456 | % |
| 6457 | % o x, y, columns, rows: These values define the perimeter of a region |
| 6458 | % of pixels you want to define. |
| 6459 | % |
| 6460 | % o map: This string reflects the expected ordering of the pixel array. |
| 6461 | % It can be any combination or order of R = red, G = green, B = blue, |
| 6462 | % A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, |
| 6463 | % Y = yellow, M = magenta, K = black, I = intensity (for grayscale), |
| 6464 | % P = pad. |
| 6465 | % |
| 6466 | % o storage: Define the data type of the pixels. Float and double types are |
| 6467 | % expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from |
| 6468 | % these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, |
| 6469 | % or DoublePixel. |
| 6470 | % |
| 6471 | % o pixels: This array of values contain the pixel components as defined by |
| 6472 | % map and type. You must preallocate this array where the expected |
| 6473 | % length varies depending on the values of width, height, map, and type. |
| 6474 | % |
| 6475 | */ |
| 6476 | WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6477 | const ssize_t x,const ssize_t y,const size_t columns, |
| 6478 | const size_t rows,const char *map,const StorageType storage, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6479 | const void *pixels) |
| 6480 | { |
| 6481 | MagickBooleanType |
| 6482 | status; |
| 6483 | |
| 6484 | assert(wand != (MagickWand *) NULL); |
| 6485 | assert(wand->signature == WandSignature); |
| 6486 | if (wand->debug != MagickFalse) |
| 6487 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6488 | if (wand->images == (Image *) NULL) |
| 6489 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6490 | status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels); |
| 6491 | if (status == MagickFalse) |
| 6492 | InheritException(wand->exception,&wand->images->exception); |
| 6493 | return(status); |
| 6494 | } |
| 6495 | |
| 6496 | /* |
| 6497 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6498 | % % |
| 6499 | % % |
| 6500 | % % |
| 6501 | % M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e % |
| 6502 | % % |
| 6503 | % % |
| 6504 | % % |
| 6505 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6506 | % |
| 6507 | % MagickInverseFourierTransformImage() implements the inverse discrete |
| 6508 | % Fourier transform (DFT) of the image either as a magnitude / phase or real / |
| 6509 | % imaginary image pair. |
| 6510 | % |
| 6511 | % The format of the MagickInverseFourierTransformImage method is: |
| 6512 | % |
| 6513 | % MagickBooleanType MagickInverseFourierTransformImage( |
cristy | c955079 | 2009-11-13 20:05:42 +0000 | [diff] [blame] | 6514 | % MagickWand *magnitude_wand,MagickWand *phase_wand, |
| 6515 | % const MagickBooleanType magnitude) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6516 | % |
| 6517 | % A description of each parameter follows: |
| 6518 | % |
cristy | c955079 | 2009-11-13 20:05:42 +0000 | [diff] [blame] | 6519 | % o magnitude_wand: the magnitude or real wand. |
| 6520 | % |
| 6521 | % o phase_wand: the phase or imaginary wand. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6522 | % |
| 6523 | % o magnitude: if true, return as magnitude / phase pair otherwise a real / |
| 6524 | % imaginary image pair. |
| 6525 | % |
| 6526 | */ |
| 6527 | WandExport MagickBooleanType MagickInverseFourierTransformImage( |
cristy | c955079 | 2009-11-13 20:05:42 +0000 | [diff] [blame] | 6528 | MagickWand *magnitude_wand,MagickWand *phase_wand, |
| 6529 | const MagickBooleanType magnitude) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6530 | { |
| 6531 | Image |
| 6532 | *inverse_image; |
| 6533 | |
cristy | c955079 | 2009-11-13 20:05:42 +0000 | [diff] [blame] | 6534 | MagickWand |
| 6535 | *wand; |
| 6536 | |
| 6537 | assert(magnitude_wand != (MagickWand *) NULL); |
| 6538 | assert(magnitude_wand->signature == WandSignature); |
| 6539 | if (magnitude_wand->debug != MagickFalse) |
| 6540 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s", |
| 6541 | magnitude_wand->name); |
| 6542 | wand=magnitude_wand; |
| 6543 | if (magnitude_wand->images == (Image *) NULL) |
| 6544 | ThrowWandException(WandError,"ContainsNoImages", |
| 6545 | magnitude_wand->name); |
| 6546 | assert(phase_wand != (MagickWand *) NULL); |
| 6547 | assert(phase_wand->signature == WandSignature); |
| 6548 | inverse_image=InverseFourierTransformImage(magnitude_wand->images, |
| 6549 | phase_wand->images,magnitude,wand->exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6550 | if (inverse_image == (Image *) NULL) |
| 6551 | return(MagickFalse); |
| 6552 | ReplaceImageInList(&wand->images,inverse_image); |
| 6553 | return(MagickTrue); |
| 6554 | } |
| 6555 | |
| 6556 | /* |
| 6557 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6558 | % % |
| 6559 | % % |
| 6560 | % % |
| 6561 | % M a g i c k L a b e l I m a g e % |
| 6562 | % % |
| 6563 | % % |
| 6564 | % % |
| 6565 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6566 | % |
| 6567 | % MagickLabelImage() adds a label to your image. |
| 6568 | % |
| 6569 | % The format of the MagickLabelImage method is: |
| 6570 | % |
| 6571 | % MagickBooleanType MagickLabelImage(MagickWand *wand,const char *label) |
| 6572 | % |
| 6573 | % A description of each parameter follows: |
| 6574 | % |
| 6575 | % o wand: the magick wand. |
| 6576 | % |
| 6577 | % o label: the image label. |
| 6578 | % |
| 6579 | */ |
| 6580 | WandExport MagickBooleanType MagickLabelImage(MagickWand *wand, |
| 6581 | const char *label) |
| 6582 | { |
| 6583 | MagickBooleanType |
| 6584 | status; |
| 6585 | |
| 6586 | assert(wand != (MagickWand *) NULL); |
| 6587 | assert(wand->signature == WandSignature); |
| 6588 | if (wand->debug != MagickFalse) |
| 6589 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6590 | if (wand->images == (Image *) NULL) |
| 6591 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6592 | status=SetImageProperty(wand->images,"label",label); |
| 6593 | if (status == MagickFalse) |
| 6594 | InheritException(wand->exception,&wand->images->exception); |
| 6595 | return(status); |
| 6596 | } |
| 6597 | |
| 6598 | /* |
| 6599 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6600 | % % |
| 6601 | % % |
| 6602 | % % |
| 6603 | % M a g i c k L e v e l I m a g e % |
| 6604 | % % |
| 6605 | % % |
| 6606 | % % |
| 6607 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6608 | % |
| 6609 | % MagickLevelImage() adjusts the levels of an image by scaling the colors |
| 6610 | % falling between specified white and black points to the full available |
| 6611 | % quantum range. The parameters provided represent the black, mid, and white |
| 6612 | % points. The black point specifies the darkest color in the image. Colors |
| 6613 | % darker than the black point are set to zero. Mid point specifies a gamma |
| 6614 | % correction to apply to the image. White point specifies the lightest color |
| 6615 | % in the image. Colors brighter than the white point are set to the maximum |
| 6616 | % quantum value. |
| 6617 | % |
| 6618 | % The format of the MagickLevelImage method is: |
| 6619 | % |
| 6620 | % MagickBooleanType MagickLevelImage(MagickWand *wand, |
| 6621 | % const double black_point,const double gamma,const double white_point) |
| 6622 | % MagickBooleanType MagickLevelImageChannel(MagickWand *wand, |
| 6623 | % const ChannelType channel,const double black_point,const double gamma, |
| 6624 | % const double white_point) |
| 6625 | % |
| 6626 | % A description of each parameter follows: |
| 6627 | % |
| 6628 | % o wand: the magick wand. |
| 6629 | % |
| 6630 | % o channel: Identify which channel to level: RedChannel, GreenChannel, |
| 6631 | % |
| 6632 | % o black_point: the black point. |
| 6633 | % |
| 6634 | % o gamma: the gamma. |
| 6635 | % |
| 6636 | % o white_point: the white point. |
| 6637 | % |
| 6638 | */ |
| 6639 | |
| 6640 | WandExport MagickBooleanType MagickLevelImage(MagickWand *wand, |
| 6641 | const double black_point,const double gamma,const double white_point) |
| 6642 | { |
| 6643 | MagickBooleanType |
| 6644 | status; |
| 6645 | |
| 6646 | status=MagickLevelImageChannel(wand,DefaultChannels,black_point,gamma, |
| 6647 | white_point); |
| 6648 | return(status); |
| 6649 | } |
| 6650 | |
| 6651 | WandExport MagickBooleanType MagickLevelImageChannel(MagickWand *wand, |
| 6652 | const ChannelType channel,const double black_point,const double gamma, |
| 6653 | const double white_point) |
| 6654 | { |
| 6655 | MagickBooleanType |
| 6656 | status; |
| 6657 | |
| 6658 | assert(wand != (MagickWand *) NULL); |
| 6659 | assert(wand->signature == WandSignature); |
| 6660 | if (wand->debug != MagickFalse) |
| 6661 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6662 | if (wand->images == (Image *) NULL) |
| 6663 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6664 | status=LevelImageChannel(wand->images,channel,black_point,white_point,gamma); |
| 6665 | if (status == MagickFalse) |
| 6666 | InheritException(wand->exception,&wand->images->exception); |
| 6667 | return(status); |
| 6668 | } |
| 6669 | |
| 6670 | /* |
| 6671 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6672 | % % |
| 6673 | % % |
| 6674 | % % |
| 6675 | % M a g i c k L i n e a r S t r e t c h I m a g e % |
| 6676 | % % |
| 6677 | % % |
| 6678 | % % |
| 6679 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6680 | % |
| 6681 | % MagickLinearStretchImage() stretches with saturation the image intensity. |
| 6682 | % |
| 6683 | % You can also reduce the influence of a particular channel with a gamma |
| 6684 | % value of 0. |
| 6685 | % |
| 6686 | % The format of the MagickLinearStretchImage method is: |
| 6687 | % |
| 6688 | % MagickBooleanType MagickLinearStretchImage(MagickWand *wand, |
| 6689 | % const double black_point,const double white_point) |
| 6690 | % |
| 6691 | % A description of each parameter follows: |
| 6692 | % |
| 6693 | % o wand: the magick wand. |
| 6694 | % |
| 6695 | % o black_point: the black point. |
| 6696 | % |
| 6697 | % o white_point: the white point. |
| 6698 | % |
| 6699 | */ |
| 6700 | WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand, |
| 6701 | const double black_point,const double white_point) |
| 6702 | { |
| 6703 | MagickBooleanType |
| 6704 | status; |
| 6705 | |
| 6706 | assert(wand != (MagickWand *) NULL); |
| 6707 | assert(wand->signature == WandSignature); |
| 6708 | if (wand->debug != MagickFalse) |
| 6709 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6710 | if (wand->images == (Image *) NULL) |
| 6711 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6712 | status=LinearStretchImage(wand->images,black_point,white_point); |
| 6713 | if (status == MagickFalse) |
| 6714 | InheritException(wand->exception,&wand->images->exception); |
| 6715 | return(status); |
| 6716 | } |
| 6717 | |
| 6718 | /* |
| 6719 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6720 | % % |
| 6721 | % % |
| 6722 | % % |
| 6723 | % M a g i c k L i q u i d R e s c a l e I m a g e % |
| 6724 | % % |
| 6725 | % % |
| 6726 | % % |
| 6727 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6728 | % |
| 6729 | % MagickLiquidRescaleImage() rescales image with seam carving. |
| 6730 | % |
| 6731 | % MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6732 | % const size_t columns,const size_t rows, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6733 | % const double delta_x,const double rigidity) |
| 6734 | % |
| 6735 | % A description of each parameter follows: |
| 6736 | % |
| 6737 | % o wand: the magick wand. |
| 6738 | % |
| 6739 | % o columns: the number of columns in the scaled image. |
| 6740 | % |
| 6741 | % o rows: the number of rows in the scaled image. |
| 6742 | % |
| 6743 | % o delta_x: maximum seam transversal step (0 means straight seams). |
| 6744 | % |
| 6745 | % o rigidity: introduce a bias for non-straight seams (typically 0). |
| 6746 | % |
| 6747 | */ |
| 6748 | WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 6749 | const size_t columns,const size_t rows,const double delta_x, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6750 | const double rigidity) |
| 6751 | { |
| 6752 | Image |
| 6753 | *rescale_image; |
| 6754 | |
| 6755 | assert(wand != (MagickWand *) NULL); |
| 6756 | assert(wand->signature == WandSignature); |
| 6757 | if (wand->debug != MagickFalse) |
| 6758 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6759 | if (wand->images == (Image *) NULL) |
| 6760 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6761 | rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x, |
| 6762 | rigidity,wand->exception); |
| 6763 | if (rescale_image == (Image *) NULL) |
| 6764 | return(MagickFalse); |
| 6765 | ReplaceImageInList(&wand->images,rescale_image); |
| 6766 | return(MagickTrue); |
| 6767 | } |
| 6768 | |
| 6769 | /* |
| 6770 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6771 | % % |
| 6772 | % % |
| 6773 | % % |
| 6774 | % M a g i c k M a g n i f y I m a g e % |
| 6775 | % % |
| 6776 | % % |
| 6777 | % % |
| 6778 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6779 | % |
| 6780 | % MagickMagnifyImage() is a convenience method that scales an image |
| 6781 | % proportionally to twice its original size. |
| 6782 | % |
| 6783 | % The format of the MagickMagnifyImage method is: |
| 6784 | % |
| 6785 | % MagickBooleanType MagickMagnifyImage(MagickWand *wand) |
| 6786 | % |
| 6787 | % A description of each parameter follows: |
| 6788 | % |
| 6789 | % o wand: the magick wand. |
| 6790 | % |
| 6791 | */ |
| 6792 | WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand) |
| 6793 | { |
| 6794 | Image |
| 6795 | *magnify_image; |
| 6796 | |
| 6797 | assert(wand != (MagickWand *) NULL); |
| 6798 | assert(wand->signature == WandSignature); |
| 6799 | if (wand->debug != MagickFalse) |
| 6800 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6801 | if (wand->images == (Image *) NULL) |
| 6802 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6803 | magnify_image=MagnifyImage(wand->images,wand->exception); |
| 6804 | if (magnify_image == (Image *) NULL) |
| 6805 | return(MagickFalse); |
| 6806 | ReplaceImageInList(&wand->images,magnify_image); |
| 6807 | return(MagickTrue); |
| 6808 | } |
| 6809 | |
| 6810 | /* |
| 6811 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6812 | % % |
| 6813 | % % |
| 6814 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6815 | % M a g i c k M e r g e I m a g e L a y e r s % |
| 6816 | % % |
| 6817 | % % |
| 6818 | % % |
| 6819 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6820 | % |
cristy | 733678d | 2011-03-18 21:29:28 +0000 | [diff] [blame] | 6821 | % MagickMergeImageLayers() composes all the image layers from the current |
| 6822 | % given image onward to produce a single image of the merged layers. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6823 | % |
| 6824 | % The inital canvas's size depends on the given ImageLayerMethod, and is |
| 6825 | % initialized using the first images background color. The images |
| 6826 | % are then compositied onto that image in sequence using the given |
| 6827 | % composition that has been assigned to each individual image. |
| 6828 | % |
| 6829 | % The format of the MagickMergeImageLayers method is: |
| 6830 | % |
| 6831 | % MagickWand *MagickMergeImageLayers(MagickWand *wand, |
| 6832 | % const ImageLayerMethod method) |
| 6833 | % |
| 6834 | % A description of each parameter follows: |
| 6835 | % |
| 6836 | % o wand: the magick wand. |
| 6837 | % |
| 6838 | % o method: the method of selecting the size of the initial canvas. |
| 6839 | % |
| 6840 | % MergeLayer: Merge all layers onto a canvas just large enough |
| 6841 | % to hold all the actual images. The virtual canvas of the |
| 6842 | % first image is preserved but otherwise ignored. |
| 6843 | % |
| 6844 | % FlattenLayer: Use the virtual canvas size of first image. |
| 6845 | % Images which fall outside this canvas is clipped. |
| 6846 | % This can be used to 'fill out' a given virtual canvas. |
| 6847 | % |
| 6848 | % MosaicLayer: Start with the virtual canvas of the first image, |
| 6849 | % enlarging left and right edges to contain all images. |
| 6850 | % Images with negative offsets will be clipped. |
| 6851 | % |
| 6852 | */ |
| 6853 | WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand, |
| 6854 | const ImageLayerMethod method) |
| 6855 | { |
| 6856 | Image |
| 6857 | *mosaic_image; |
| 6858 | |
| 6859 | assert(wand != (MagickWand *) NULL); |
| 6860 | assert(wand->signature == WandSignature); |
| 6861 | if (wand->debug != MagickFalse) |
| 6862 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6863 | if (wand->images == (Image *) NULL) |
| 6864 | return((MagickWand *) NULL); |
| 6865 | mosaic_image=MergeImageLayers(wand->images,method,wand->exception); |
| 6866 | if (mosaic_image == (Image *) NULL) |
| 6867 | return((MagickWand *) NULL); |
| 6868 | return(CloneMagickWandFromImages(wand,mosaic_image)); |
| 6869 | } |
| 6870 | |
| 6871 | /* |
| 6872 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6873 | % % |
| 6874 | % % |
| 6875 | % % |
| 6876 | % M a g i c k M i n i f y I m a g e % |
| 6877 | % % |
| 6878 | % % |
| 6879 | % % |
| 6880 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6881 | % |
| 6882 | % MagickMinifyImage() is a convenience method that scales an image |
| 6883 | % proportionally to one-half its original size |
| 6884 | % |
| 6885 | % The format of the MagickMinifyImage method is: |
| 6886 | % |
| 6887 | % MagickBooleanType MagickMinifyImage(MagickWand *wand) |
| 6888 | % |
| 6889 | % A description of each parameter follows: |
| 6890 | % |
| 6891 | % o wand: the magick wand. |
| 6892 | % |
| 6893 | */ |
| 6894 | WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand) |
| 6895 | { |
| 6896 | Image |
| 6897 | *minify_image; |
| 6898 | |
| 6899 | assert(wand != (MagickWand *) NULL); |
| 6900 | assert(wand->signature == WandSignature); |
| 6901 | if (wand->debug != MagickFalse) |
| 6902 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6903 | if (wand->images == (Image *) NULL) |
| 6904 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 6905 | minify_image=MinifyImage(wand->images,wand->exception); |
| 6906 | if (minify_image == (Image *) NULL) |
| 6907 | return(MagickFalse); |
| 6908 | ReplaceImageInList(&wand->images,minify_image); |
| 6909 | return(MagickTrue); |
| 6910 | } |
| 6911 | |
| 6912 | /* |
| 6913 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6914 | % % |
| 6915 | % % |
| 6916 | % % |
| 6917 | % M a g i c k M o d u l a t e I m a g e % |
| 6918 | % % |
| 6919 | % % |
| 6920 | % % |
| 6921 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6922 | % |
| 6923 | % MagickModulateImage() lets you control the brightness, saturation, and hue |
| 6924 | % of an image. Hue is the percentage of absolute rotation from the current |
| 6925 | % position. For example 50 results in a counter-clockwise rotation of 90 |
| 6926 | % degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 |
| 6927 | % both resulting in a rotation of 180 degrees. |
| 6928 | % |
| 6929 | % To increase the color brightness by 20% and decrease the color saturation by |
| 6930 | % 10% and leave the hue unchanged, use: 120,90,100. |
| 6931 | % |
| 6932 | % The format of the MagickModulateImage method is: |
| 6933 | % |
| 6934 | % MagickBooleanType MagickModulateImage(MagickWand *wand, |
| 6935 | % const double brightness,const double saturation,const double hue) |
| 6936 | % |
| 6937 | % A description of each parameter follows: |
| 6938 | % |
| 6939 | % o wand: the magick wand. |
| 6940 | % |
| 6941 | % o brightness: the percent change in brighness. |
| 6942 | % |
| 6943 | % o saturation: the percent change in saturation. |
| 6944 | % |
| 6945 | % o hue: the percent change in hue. |
| 6946 | % |
| 6947 | */ |
| 6948 | WandExport MagickBooleanType MagickModulateImage(MagickWand *wand, |
| 6949 | const double brightness,const double saturation,const double hue) |
| 6950 | { |
| 6951 | char |
| 6952 | modulate[MaxTextExtent]; |
| 6953 | |
| 6954 | MagickBooleanType |
| 6955 | status; |
| 6956 | |
| 6957 | assert(wand != (MagickWand *) NULL); |
| 6958 | assert(wand->signature == WandSignature); |
| 6959 | if (wand->debug != MagickFalse) |
| 6960 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 6961 | if (wand->images == (Image *) NULL) |
| 6962 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 6963 | (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g", |
cristy | 8cd5b31 | 2010-01-07 01:10:24 +0000 | [diff] [blame] | 6964 | brightness,saturation,hue); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 6965 | status=ModulateImage(wand->images,modulate); |
| 6966 | if (status == MagickFalse) |
| 6967 | InheritException(wand->exception,&wand->images->exception); |
| 6968 | return(status); |
| 6969 | } |
| 6970 | |
| 6971 | /* |
| 6972 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6973 | % % |
| 6974 | % % |
| 6975 | % % |
| 6976 | % M a g i c k M o n t a g e I m a g e % |
| 6977 | % % |
| 6978 | % % |
| 6979 | % % |
| 6980 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6981 | % |
| 6982 | % MagickMontageImage() creates a composite image by combining several |
| 6983 | % separate images. The images are tiled on the composite image with the name |
| 6984 | % of the image optionally appearing just below the individual tile. |
| 6985 | % |
| 6986 | % The format of the MagickMontageImage method is: |
| 6987 | % |
| 6988 | % MagickWand *MagickMontageImage(MagickWand *wand, |
| 6989 | % const DrawingWand drawing_wand,const char *tile_geometry, |
| 6990 | % const char *thumbnail_geometry,const MontageMode mode, |
| 6991 | % const char *frame) |
| 6992 | % |
| 6993 | % A description of each parameter follows: |
| 6994 | % |
| 6995 | % o wand: the magick wand. |
| 6996 | % |
| 6997 | % o drawing_wand: the drawing wand. The font name, size, and color are |
| 6998 | % obtained from this wand. |
| 6999 | % |
| 7000 | % o tile_geometry: the number of tiles per row and page (e.g. 6x4+0+0). |
| 7001 | % |
| 7002 | % o thumbnail_geometry: Preferred image size and border size of each |
| 7003 | % thumbnail (e.g. 120x120+4+3>). |
| 7004 | % |
| 7005 | % o mode: Thumbnail framing mode: Frame, Unframe, or Concatenate. |
| 7006 | % |
| 7007 | % o frame: Surround the image with an ornamental border (e.g. 15x15+3+3). |
| 7008 | % The frame color is that of the thumbnail's matte color. |
| 7009 | % |
| 7010 | */ |
| 7011 | WandExport MagickWand *MagickMontageImage(MagickWand *wand, |
| 7012 | const DrawingWand *drawing_wand,const char *tile_geometry, |
| 7013 | const char *thumbnail_geometry,const MontageMode mode,const char *frame) |
| 7014 | { |
| 7015 | char |
| 7016 | *font; |
| 7017 | |
| 7018 | Image |
| 7019 | *montage_image; |
| 7020 | |
| 7021 | MontageInfo |
| 7022 | *montage_info; |
| 7023 | |
| 7024 | PixelWand |
| 7025 | *pixel_wand; |
| 7026 | |
| 7027 | assert(wand != (MagickWand *) NULL); |
| 7028 | assert(wand->signature == WandSignature); |
| 7029 | if (wand->debug != MagickFalse) |
| 7030 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7031 | if (wand->images == (Image *) NULL) |
| 7032 | return((MagickWand *) NULL); |
| 7033 | montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL); |
| 7034 | switch (mode) |
| 7035 | { |
| 7036 | case FrameMode: |
| 7037 | { |
| 7038 | (void) CloneString(&montage_info->frame,"15x15+3+3"); |
| 7039 | montage_info->shadow=MagickTrue; |
| 7040 | break; |
| 7041 | } |
| 7042 | case UnframeMode: |
| 7043 | { |
| 7044 | montage_info->frame=(char *) NULL; |
| 7045 | montage_info->shadow=MagickFalse; |
| 7046 | montage_info->border_width=0; |
| 7047 | break; |
| 7048 | } |
| 7049 | case ConcatenateMode: |
| 7050 | { |
| 7051 | montage_info->frame=(char *) NULL; |
| 7052 | montage_info->shadow=MagickFalse; |
| 7053 | (void) CloneString(&montage_info->geometry,"+0+0"); |
| 7054 | montage_info->border_width=0; |
| 7055 | break; |
| 7056 | } |
| 7057 | default: |
| 7058 | break; |
| 7059 | } |
| 7060 | font=DrawGetFont(drawing_wand); |
| 7061 | if (font != (char *) NULL) |
| 7062 | (void) CloneString(&montage_info->font,font); |
| 7063 | if (frame != (char *) NULL) |
| 7064 | (void) CloneString(&montage_info->frame,frame); |
| 7065 | montage_info->pointsize=DrawGetFontSize(drawing_wand); |
| 7066 | pixel_wand=NewPixelWand(); |
| 7067 | DrawGetFillColor(drawing_wand,pixel_wand); |
| 7068 | PixelGetQuantumColor(pixel_wand,&montage_info->fill); |
| 7069 | DrawGetStrokeColor(drawing_wand,pixel_wand); |
| 7070 | PixelGetQuantumColor(pixel_wand,&montage_info->stroke); |
| 7071 | pixel_wand=DestroyPixelWand(pixel_wand); |
| 7072 | if (thumbnail_geometry != (char *) NULL) |
| 7073 | (void) CloneString(&montage_info->geometry,thumbnail_geometry); |
| 7074 | if (tile_geometry != (char *) NULL) |
| 7075 | (void) CloneString(&montage_info->tile,tile_geometry); |
| 7076 | montage_image=MontageImageList(wand->image_info,montage_info,wand->images, |
| 7077 | wand->exception); |
| 7078 | montage_info=DestroyMontageInfo(montage_info); |
| 7079 | if (montage_image == (Image *) NULL) |
| 7080 | return((MagickWand *) NULL); |
| 7081 | return(CloneMagickWandFromImages(wand,montage_image)); |
| 7082 | } |
| 7083 | |
| 7084 | /* |
| 7085 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7086 | % % |
| 7087 | % % |
| 7088 | % % |
| 7089 | % M a g i c k M o r p h I m a g e s % |
| 7090 | % % |
| 7091 | % % |
| 7092 | % % |
| 7093 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7094 | % |
| 7095 | % MagickMorphImages() method morphs a set of images. Both the image pixels |
| 7096 | % and size are linearly interpolated to give the appearance of a |
| 7097 | % meta-morphosis from one image to the next. |
| 7098 | % |
| 7099 | % The format of the MagickMorphImages method is: |
| 7100 | % |
| 7101 | % MagickWand *MagickMorphImages(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7102 | % const size_t number_frames) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7103 | % |
| 7104 | % A description of each parameter follows: |
| 7105 | % |
| 7106 | % o wand: the magick wand. |
| 7107 | % |
| 7108 | % o number_frames: the number of in-between images to generate. |
| 7109 | % |
| 7110 | */ |
| 7111 | WandExport MagickWand *MagickMorphImages(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7112 | const size_t number_frames) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7113 | { |
| 7114 | Image |
| 7115 | *morph_image; |
| 7116 | |
| 7117 | assert(wand != (MagickWand *) NULL); |
| 7118 | assert(wand->signature == WandSignature); |
| 7119 | if (wand->debug != MagickFalse) |
| 7120 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7121 | if (wand->images == (Image *) NULL) |
| 7122 | return((MagickWand *) NULL); |
| 7123 | morph_image=MorphImages(wand->images,number_frames,wand->exception); |
| 7124 | if (morph_image == (Image *) NULL) |
| 7125 | return((MagickWand *) NULL); |
| 7126 | return(CloneMagickWandFromImages(wand,morph_image)); |
| 7127 | } |
| 7128 | |
| 7129 | /* |
| 7130 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7131 | % % |
| 7132 | % % |
| 7133 | % % |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 7134 | % M a g i c k M o r p h o l o g y I m a g e % |
| 7135 | % % |
| 7136 | % % |
| 7137 | % % |
| 7138 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7139 | % |
| 7140 | % MagickMorphologyImage() applies a user supplied kernel to the image |
| 7141 | % according to the given mophology method. |
| 7142 | % |
| 7143 | % The format of the MagickMorphologyImage method is: |
| 7144 | % |
| 7145 | % MagickBooleanType MagickMorphologyImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7146 | % MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel) |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 7147 | % MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7148 | % ChannelType channel,MorphologyMethod method,const ssize_t iterations, |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 7149 | % KernelInfo *kernel) |
| 7150 | % |
| 7151 | % A description of each parameter follows: |
| 7152 | % |
| 7153 | % o wand: the magick wand. |
| 7154 | % |
| 7155 | % o channel: the image channel(s). |
| 7156 | % |
| 7157 | % o method: the morphology method to be applied. |
| 7158 | % |
| 7159 | % o iterations: apply the operation this many times (or no change). |
| 7160 | % A value of -1 means loop until no change found. How this is applied |
| 7161 | % may depend on the morphology method. Typically this is a value of 1. |
| 7162 | % |
| 7163 | % o kernel: An array of doubles representing the morphology kernel. |
| 7164 | % |
| 7165 | */ |
| 7166 | |
| 7167 | WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7168 | MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel) |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 7169 | { |
| 7170 | MagickBooleanType |
| 7171 | status; |
| 7172 | |
| 7173 | status=MagickMorphologyImageChannel(wand,DefaultChannels,method,iterations, |
| 7174 | kernel); |
| 7175 | return(status); |
| 7176 | } |
| 7177 | |
| 7178 | WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7179 | const ChannelType channel,MorphologyMethod method,const ssize_t iterations, |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 7180 | KernelInfo *kernel) |
| 7181 | { |
| 7182 | Image |
| 7183 | *morphology_image; |
| 7184 | |
| 7185 | assert(wand != (MagickWand *) NULL); |
| 7186 | assert(wand->signature == WandSignature); |
| 7187 | if (wand->debug != MagickFalse) |
| 7188 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7189 | if (kernel == (const KernelInfo *) NULL) |
| 7190 | return(MagickFalse); |
| 7191 | if (wand->images == (Image *) NULL) |
| 7192 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7193 | morphology_image=MorphologyImageChannel(wand->images,channel,method, |
| 7194 | iterations,kernel,wand->exception); |
| 7195 | if (morphology_image == (Image *) NULL) |
| 7196 | return(MagickFalse); |
| 7197 | ReplaceImageInList(&wand->images,morphology_image); |
| 7198 | return(MagickTrue); |
| 7199 | } |
| 7200 | |
| 7201 | /* |
| 7202 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7203 | % % |
| 7204 | % % |
| 7205 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7206 | % M a g i c k M o t i o n B l u r I m a g e % |
| 7207 | % % |
| 7208 | % % |
| 7209 | % % |
| 7210 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7211 | % |
| 7212 | % MagickMotionBlurImage() simulates motion blur. We convolve the image with a |
| 7213 | % Gaussian operator of the given radius and standard deviation (sigma). |
| 7214 | % For reasonable results, radius should be larger than sigma. Use a |
| 7215 | % radius of 0 and MotionBlurImage() selects a suitable radius for you. |
| 7216 | % Angle gives the angle of the blurring motion. |
| 7217 | % |
| 7218 | % The format of the MagickMotionBlurImage method is: |
| 7219 | % |
| 7220 | % MagickBooleanType MagickMotionBlurImage(MagickWand *wand, |
| 7221 | % const double radius,const double sigma,const double angle) |
| 7222 | % MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand, |
| 7223 | % const ChannelType channel,const double radius,const double sigma, |
| 7224 | % const double angle) |
| 7225 | % |
| 7226 | % A description of each parameter follows: |
| 7227 | % |
| 7228 | % o wand: the magick wand. |
| 7229 | % |
| 7230 | % o channel: the image channel(s). |
| 7231 | % |
| 7232 | % o radius: the radius of the Gaussian, in pixels, not counting |
| 7233 | % the center pixel. |
| 7234 | % |
| 7235 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 7236 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 7237 | % o angle: Apply the effect along this angle. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7238 | % |
| 7239 | */ |
| 7240 | |
| 7241 | WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand, |
| 7242 | const double radius,const double sigma,const double angle) |
| 7243 | { |
| 7244 | MagickBooleanType |
| 7245 | status; |
| 7246 | |
| 7247 | status=MagickMotionBlurImageChannel(wand,DefaultChannels,radius,sigma,angle); |
| 7248 | return(status); |
| 7249 | } |
| 7250 | |
| 7251 | WandExport MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand, |
| 7252 | const ChannelType channel,const double radius,const double sigma, |
| 7253 | const double angle) |
| 7254 | { |
| 7255 | Image |
| 7256 | *blur_image; |
| 7257 | |
| 7258 | assert(wand != (MagickWand *) NULL); |
| 7259 | assert(wand->signature == WandSignature); |
| 7260 | if (wand->debug != MagickFalse) |
| 7261 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7262 | if (wand->images == (Image *) NULL) |
| 7263 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7264 | blur_image=MotionBlurImageChannel(wand->images,channel,radius,sigma,angle, |
| 7265 | wand->exception); |
| 7266 | if (blur_image == (Image *) NULL) |
| 7267 | return(MagickFalse); |
| 7268 | ReplaceImageInList(&wand->images,blur_image); |
| 7269 | return(MagickTrue); |
| 7270 | } |
| 7271 | |
| 7272 | /* |
| 7273 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7274 | % % |
| 7275 | % % |
| 7276 | % % |
| 7277 | % M a g i c k N e g a t e I m a g e % |
| 7278 | % % |
| 7279 | % % |
| 7280 | % % |
| 7281 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7282 | % |
| 7283 | % MagickNegateImage() negates the colors in the reference image. The |
| 7284 | % Grayscale option means that only grayscale values within the image are |
| 7285 | % negated. |
| 7286 | % |
| 7287 | % You can also reduce the influence of a particular channel with a gamma |
| 7288 | % value of 0. |
| 7289 | % |
| 7290 | % The format of the MagickNegateImage method is: |
| 7291 | % |
| 7292 | % MagickBooleanType MagickNegateImage(MagickWand *wand, |
| 7293 | % const MagickBooleanType gray) |
| 7294 | % MagickBooleanType MagickNegateImage(MagickWand *wand, |
| 7295 | % const ChannelType channel,const MagickBooleanType gray) |
| 7296 | % |
| 7297 | % A description of each parameter follows: |
| 7298 | % |
| 7299 | % o wand: the magick wand. |
| 7300 | % |
| 7301 | % o channel: the image channel(s). |
| 7302 | % |
| 7303 | % o gray: If MagickTrue, only negate grayscale pixels within the image. |
| 7304 | % |
| 7305 | */ |
| 7306 | |
| 7307 | WandExport MagickBooleanType MagickNegateImage(MagickWand *wand, |
| 7308 | const MagickBooleanType gray) |
| 7309 | { |
| 7310 | MagickBooleanType |
| 7311 | status; |
| 7312 | |
| 7313 | status=MagickNegateImageChannel(wand,DefaultChannels,gray); |
| 7314 | return(status); |
| 7315 | } |
| 7316 | |
| 7317 | WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand, |
| 7318 | const ChannelType channel,const MagickBooleanType gray) |
| 7319 | { |
| 7320 | MagickBooleanType |
| 7321 | status; |
| 7322 | |
| 7323 | assert(wand != (MagickWand *) NULL); |
| 7324 | assert(wand->signature == WandSignature); |
| 7325 | if (wand->debug != MagickFalse) |
| 7326 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7327 | if (wand->images == (Image *) NULL) |
| 7328 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7329 | status=NegateImageChannel(wand->images,channel,gray); |
| 7330 | if (status == MagickFalse) |
| 7331 | InheritException(wand->exception,&wand->images->exception); |
| 7332 | return(status); |
| 7333 | } |
| 7334 | |
| 7335 | /* |
| 7336 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7337 | % % |
| 7338 | % % |
| 7339 | % % |
| 7340 | % M a g i c k N e w I m a g e % |
| 7341 | % % |
| 7342 | % % |
| 7343 | % % |
| 7344 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7345 | % |
| 7346 | % MagickNewImage() adds a blank image canvas of the specified size and |
| 7347 | % background color to the wand. |
| 7348 | % |
| 7349 | % The format of the MagickNewImage method is: |
| 7350 | % |
| 7351 | % MagickBooleanType MagickNewImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7352 | % const size_t columns,const size_t rows, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7353 | % const PixelWand *background) |
| 7354 | % |
| 7355 | % A description of each parameter follows: |
| 7356 | % |
| 7357 | % o wand: the magick wand. |
| 7358 | % |
| 7359 | % o width: the image width. |
| 7360 | % |
| 7361 | % o height: the image height. |
| 7362 | % |
| 7363 | % o background: the image color. |
| 7364 | % |
| 7365 | */ |
| 7366 | WandExport MagickBooleanType MagickNewImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7367 | const size_t width,const size_t height, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7368 | const PixelWand *background) |
| 7369 | { |
| 7370 | Image |
| 7371 | *images; |
| 7372 | |
| 7373 | MagickPixelPacket |
| 7374 | pixel; |
| 7375 | |
| 7376 | assert(wand != (MagickWand *) NULL); |
| 7377 | assert(wand->signature == WandSignature); |
| 7378 | if (wand->debug != MagickFalse) |
| 7379 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7380 | PixelGetMagickColor(background,&pixel); |
| 7381 | images=NewMagickImage(wand->image_info,width,height,&pixel); |
| 7382 | if (images == (Image *) NULL) |
| 7383 | return(MagickFalse); |
| 7384 | if (images->exception.severity != UndefinedException) |
| 7385 | InheritException(wand->exception,&images->exception); |
| 7386 | return(InsertImageInWand(wand,images)); |
| 7387 | } |
| 7388 | |
| 7389 | /* |
| 7390 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7391 | % % |
| 7392 | % % |
| 7393 | % % |
| 7394 | % M a g i c k N e x t I m a g e % |
| 7395 | % % |
| 7396 | % % |
| 7397 | % % |
| 7398 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7399 | % |
| 7400 | % MagickNextImage() associates the next image in the image list with a magick |
| 7401 | % wand. |
| 7402 | % |
| 7403 | % The format of the MagickNextImage method is: |
| 7404 | % |
| 7405 | % MagickBooleanType MagickNextImage(MagickWand *wand) |
| 7406 | % |
| 7407 | % A description of each parameter follows: |
| 7408 | % |
| 7409 | % o wand: the magick wand. |
| 7410 | % |
| 7411 | */ |
| 7412 | WandExport MagickBooleanType MagickNextImage(MagickWand *wand) |
| 7413 | { |
| 7414 | assert(wand != (MagickWand *) NULL); |
| 7415 | assert(wand->signature == WandSignature); |
| 7416 | if (wand->debug != MagickFalse) |
| 7417 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7418 | if (wand->images == (Image *) NULL) |
| 7419 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7420 | if (wand->pend != MagickFalse) |
| 7421 | { |
| 7422 | wand->pend=MagickFalse; |
| 7423 | return(MagickTrue); |
| 7424 | } |
| 7425 | if (GetNextImageInList(wand->images) == (Image *) NULL) |
| 7426 | { |
| 7427 | wand->pend=MagickTrue; |
| 7428 | return(MagickFalse); |
| 7429 | } |
| 7430 | wand->images=GetNextImageInList(wand->images); |
| 7431 | return(MagickTrue); |
| 7432 | } |
| 7433 | |
| 7434 | /* |
| 7435 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7436 | % % |
| 7437 | % % |
| 7438 | % % |
| 7439 | % M a g i c k N o r m a l i z e I m a g e % |
| 7440 | % % |
| 7441 | % % |
| 7442 | % % |
| 7443 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7444 | % |
| 7445 | % MagickNormalizeImage() enhances the contrast of a color image by adjusting |
| 7446 | % the pixels color to span the entire range of colors available |
| 7447 | % |
| 7448 | % You can also reduce the influence of a particular channel with a gamma |
| 7449 | % value of 0. |
| 7450 | % |
| 7451 | % The format of the MagickNormalizeImage method is: |
| 7452 | % |
| 7453 | % MagickBooleanType MagickNormalizeImage(MagickWand *wand) |
| 7454 | % MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand, |
| 7455 | % const ChannelType channel) |
| 7456 | % |
| 7457 | % A description of each parameter follows: |
| 7458 | % |
| 7459 | % o wand: the magick wand. |
| 7460 | % |
| 7461 | % o channel: the image channel(s). |
| 7462 | % |
| 7463 | */ |
| 7464 | |
| 7465 | WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand) |
| 7466 | { |
| 7467 | MagickBooleanType |
| 7468 | status; |
| 7469 | |
| 7470 | status=MagickNormalizeImageChannel(wand,DefaultChannels); |
| 7471 | return(status); |
| 7472 | } |
| 7473 | |
| 7474 | WandExport MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand, |
| 7475 | const ChannelType channel) |
| 7476 | { |
| 7477 | MagickBooleanType |
| 7478 | status; |
| 7479 | |
| 7480 | assert(wand != (MagickWand *) NULL); |
| 7481 | assert(wand->signature == WandSignature); |
| 7482 | if (wand->debug != MagickFalse) |
| 7483 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7484 | if (wand->images == (Image *) NULL) |
| 7485 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7486 | status=NormalizeImageChannel(wand->images,channel); |
| 7487 | if (status == MagickFalse) |
| 7488 | InheritException(wand->exception,&wand->images->exception); |
| 7489 | return(status); |
| 7490 | } |
| 7491 | |
| 7492 | /* |
| 7493 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7494 | % % |
| 7495 | % % |
| 7496 | % % |
| 7497 | % M a g i c k O i l P a i n t I m a g e % |
| 7498 | % % |
| 7499 | % % |
| 7500 | % % |
| 7501 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7502 | % |
| 7503 | % MagickOilPaintImage() applies a special effect filter that simulates an oil |
| 7504 | % painting. Each pixel is replaced by the most frequent color occurring |
| 7505 | % in a circular region defined by radius. |
| 7506 | % |
| 7507 | % The format of the MagickOilPaintImage method is: |
| 7508 | % |
| 7509 | % MagickBooleanType MagickOilPaintImage(MagickWand *wand, |
| 7510 | % const double radius) |
| 7511 | % |
| 7512 | % A description of each parameter follows: |
| 7513 | % |
| 7514 | % o wand: the magick wand. |
| 7515 | % |
| 7516 | % o radius: the radius of the circular neighborhood. |
| 7517 | % |
| 7518 | */ |
| 7519 | WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand, |
| 7520 | const double radius) |
| 7521 | { |
| 7522 | Image |
| 7523 | *paint_image; |
| 7524 | |
| 7525 | assert(wand != (MagickWand *) NULL); |
| 7526 | assert(wand->signature == WandSignature); |
| 7527 | if (wand->debug != MagickFalse) |
| 7528 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7529 | if (wand->images == (Image *) NULL) |
| 7530 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7531 | paint_image=OilPaintImage(wand->images,radius,wand->exception); |
| 7532 | if (paint_image == (Image *) NULL) |
| 7533 | return(MagickFalse); |
| 7534 | ReplaceImageInList(&wand->images,paint_image); |
| 7535 | return(MagickTrue); |
| 7536 | } |
| 7537 | |
| 7538 | /* |
| 7539 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7540 | % % |
| 7541 | % % |
| 7542 | % % |
| 7543 | % M a g i c k O p a q u e P a i n t I m a g e % |
| 7544 | % % |
| 7545 | % % |
| 7546 | % % |
| 7547 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7548 | % |
| 7549 | % MagickOpaquePaintImage() changes any pixel that matches color with the color |
| 7550 | % defined by fill. |
| 7551 | % |
| 7552 | % The format of the MagickOpaquePaintImage method is: |
| 7553 | % |
| 7554 | % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, |
| 7555 | % const PixelWand *target,const PixelWand *fill,const double fuzz, |
| 7556 | % const MagickBooleanType invert) |
| 7557 | % MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, |
| 7558 | % const ChannelType channel,const PixelWand *target, |
| 7559 | % const PixelWand *fill,const double fuzz,const MagickBooleanType invert) |
| 7560 | % |
| 7561 | % A description of each parameter follows: |
| 7562 | % |
| 7563 | % o wand: the magick wand. |
| 7564 | % |
| 7565 | % o channel: the channel(s). |
| 7566 | % |
| 7567 | % o target: Change this target color to the fill color within the image. |
| 7568 | % |
| 7569 | % o fill: the fill pixel wand. |
| 7570 | % |
| 7571 | % o fuzz: By default target must match a particular pixel color |
| 7572 | % exactly. However, in many cases two colors may differ by a small amount. |
| 7573 | % The fuzz member of image defines how much tolerance is acceptable to |
| 7574 | % consider two colors as the same. For example, set fuzz to 10 and the |
| 7575 | % color red at intensities of 100 and 102 respectively are now interpreted |
| 7576 | % as the same color for the purposes of the floodfill. |
| 7577 | % |
| 7578 | % o invert: paint any pixel that does not match the target color. |
| 7579 | % |
| 7580 | */ |
| 7581 | |
| 7582 | WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, |
| 7583 | const PixelWand *target,const PixelWand *fill,const double fuzz, |
| 7584 | const MagickBooleanType invert) |
| 7585 | { |
| 7586 | MagickBooleanType |
| 7587 | status; |
| 7588 | |
| 7589 | status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz, |
| 7590 | invert); |
| 7591 | return(status); |
| 7592 | } |
| 7593 | |
| 7594 | WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, |
| 7595 | const ChannelType channel,const PixelWand *target,const PixelWand *fill, |
| 7596 | const double fuzz,const MagickBooleanType invert) |
| 7597 | { |
| 7598 | MagickBooleanType |
| 7599 | status; |
| 7600 | |
| 7601 | MagickPixelPacket |
| 7602 | fill_pixel, |
| 7603 | target_pixel; |
| 7604 | |
| 7605 | assert(wand != (MagickWand *) NULL); |
| 7606 | assert(wand->signature == WandSignature); |
| 7607 | if (wand->debug != MagickFalse) |
| 7608 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7609 | if (wand->images == (Image *) NULL) |
| 7610 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7611 | PixelGetMagickColor(target,&target_pixel); |
| 7612 | PixelGetMagickColor(fill,&fill_pixel); |
| 7613 | wand->images->fuzz=fuzz; |
| 7614 | status=OpaquePaintImageChannel(wand->images,channel,&target_pixel, |
| 7615 | &fill_pixel,invert); |
| 7616 | if (status == MagickFalse) |
| 7617 | InheritException(wand->exception,&wand->images->exception); |
| 7618 | return(status); |
| 7619 | } |
| 7620 | |
| 7621 | /* |
| 7622 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7623 | % % |
| 7624 | % % |
| 7625 | % % |
| 7626 | % M a g i c k O p t i m i z e I m a g e L a y e r s % |
| 7627 | % % |
| 7628 | % % |
| 7629 | % % |
| 7630 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7631 | % |
| 7632 | % MagickOptimizeImageLayers() compares each image the GIF disposed forms of the |
| 7633 | % previous image in the sequence. From this it attempts to select the |
| 7634 | % smallest cropped image to replace each frame, while preserving the results |
| 7635 | % of the animation. |
| 7636 | % |
| 7637 | % The format of the MagickOptimizeImageLayers method is: |
| 7638 | % |
| 7639 | % MagickWand *MagickOptimizeImageLayers(MagickWand *wand) |
| 7640 | % |
| 7641 | % A description of each parameter follows: |
| 7642 | % |
| 7643 | % o wand: the magick wand. |
| 7644 | % |
| 7645 | */ |
| 7646 | WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand) |
| 7647 | { |
| 7648 | Image |
| 7649 | *optimize_image; |
| 7650 | |
| 7651 | assert(wand != (MagickWand *) NULL); |
| 7652 | assert(wand->signature == WandSignature); |
| 7653 | if (wand->debug != MagickFalse) |
| 7654 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7655 | if (wand->images == (Image *) NULL) |
| 7656 | return((MagickWand *) NULL); |
| 7657 | optimize_image=OptimizeImageLayers(wand->images,wand->exception); |
| 7658 | if (optimize_image == (Image *) NULL) |
| 7659 | return((MagickWand *) NULL); |
| 7660 | return(CloneMagickWandFromImages(wand,optimize_image)); |
| 7661 | } |
| 7662 | |
| 7663 | /* |
| 7664 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7665 | % % |
| 7666 | % % |
| 7667 | % % |
| 7668 | % M a g i c k O r d e r e d P o s t e r i z e I m a g e % |
| 7669 | % % |
| 7670 | % % |
| 7671 | % % |
| 7672 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7673 | % |
| 7674 | % MagickOrderedPosterizeImage() performs an ordered dither based on a number |
| 7675 | % of pre-defined dithering threshold maps, but over multiple intensity levels, |
| 7676 | % which can be different for different channels, according to the input |
| 7677 | % arguments. |
| 7678 | % |
| 7679 | % The format of the MagickOrderedPosterizeImage method is: |
| 7680 | % |
| 7681 | % MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand, |
| 7682 | % const char *threshold_map) |
| 7683 | % MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand, |
| 7684 | % const ChannelType channel,const char *threshold_map) |
| 7685 | % |
| 7686 | % A description of each parameter follows: |
| 7687 | % |
| 7688 | % o image: the image. |
| 7689 | % |
| 7690 | % o channel: the channel or channels to be thresholded. |
| 7691 | % |
| 7692 | % o threshold_map: A string containing the name of the threshold dither |
| 7693 | % map to use, followed by zero or more numbers representing the number of |
| 7694 | % color levels tho dither between. |
| 7695 | % |
glennrp | f0a92fd | 2011-04-27 13:17:21 +0000 | [diff] [blame] | 7696 | % Any level number less than 2 is equivalent to 2, and means only binary |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7697 | % dithering will be applied to each color channel. |
| 7698 | % |
| 7699 | % No numbers also means a 2 level (bitmap) dither will be applied to all |
| 7700 | % channels, while a single number is the number of levels applied to each |
| 7701 | % channel in sequence. More numbers will be applied in turn to each of |
| 7702 | % the color channels. |
| 7703 | % |
| 7704 | % For example: "o3x3,6" generates a 6 level posterization of the image |
| 7705 | % with a ordered 3x3 diffused pixel dither being applied between each |
| 7706 | % level. While checker,8,8,4 will produce a 332 colormaped image with |
| 7707 | % only a single checkerboard hash pattern (50% grey) between each color |
| 7708 | % level, to basically double the number of color levels with a bare |
| 7709 | % minimim of dithering. |
| 7710 | % |
| 7711 | */ |
| 7712 | |
| 7713 | WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand, |
| 7714 | const char *threshold_map) |
| 7715 | { |
| 7716 | MagickBooleanType |
| 7717 | status; |
| 7718 | |
| 7719 | status=MagickOrderedPosterizeImageChannel(wand,DefaultChannels,threshold_map); |
| 7720 | return(status); |
| 7721 | } |
| 7722 | |
| 7723 | WandExport MagickBooleanType MagickOrderedPosterizeImageChannel( |
| 7724 | MagickWand *wand,const ChannelType channel,const char *threshold_map) |
| 7725 | { |
| 7726 | MagickBooleanType |
| 7727 | status; |
| 7728 | |
| 7729 | assert(wand != (MagickWand *) NULL); |
| 7730 | assert(wand->signature == WandSignature); |
| 7731 | if (wand->debug != MagickFalse) |
| 7732 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7733 | if (wand->images == (Image *) NULL) |
| 7734 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7735 | status=OrderedPosterizeImageChannel(wand->images,channel,threshold_map, |
| 7736 | wand->exception); |
| 7737 | return(status); |
| 7738 | } |
| 7739 | |
| 7740 | /* |
| 7741 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7742 | % % |
| 7743 | % % |
| 7744 | % % |
| 7745 | % M a g i c k P i n g I m a g e % |
| 7746 | % % |
| 7747 | % % |
| 7748 | % % |
| 7749 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7750 | % |
| 7751 | % MagickPingImage() is like MagickReadImage() except the only valid |
| 7752 | % information returned is the image width, height, size, and format. It |
| 7753 | % is designed to efficiently obtain this information from a file without |
| 7754 | % reading the entire image sequence into memory. |
| 7755 | % |
| 7756 | % The format of the MagickPingImage method is: |
| 7757 | % |
| 7758 | % MagickBooleanType MagickPingImage(MagickWand *wand,const char *filename) |
| 7759 | % |
| 7760 | % A description of each parameter follows: |
| 7761 | % |
| 7762 | % o wand: the magick wand. |
| 7763 | % |
| 7764 | % o filename: the image filename. |
| 7765 | % |
| 7766 | */ |
| 7767 | WandExport MagickBooleanType MagickPingImage(MagickWand *wand, |
| 7768 | const char *filename) |
| 7769 | { |
| 7770 | Image |
| 7771 | *images; |
| 7772 | |
| 7773 | ImageInfo |
| 7774 | *ping_info; |
| 7775 | |
| 7776 | assert(wand != (MagickWand *) NULL); |
| 7777 | assert(wand->signature == WandSignature); |
| 7778 | if (wand->debug != MagickFalse) |
| 7779 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7780 | ping_info=CloneImageInfo(wand->image_info); |
| 7781 | if (filename != (const char *) NULL) |
| 7782 | (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent); |
| 7783 | images=PingImage(ping_info,wand->exception); |
| 7784 | ping_info=DestroyImageInfo(ping_info); |
| 7785 | if (images == (Image *) NULL) |
| 7786 | return(MagickFalse); |
| 7787 | return(InsertImageInWand(wand,images)); |
| 7788 | } |
| 7789 | |
| 7790 | /* |
| 7791 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7792 | % % |
| 7793 | % % |
| 7794 | % % |
| 7795 | % M a g i c k P i n g I m a g e B l o b % |
| 7796 | % % |
| 7797 | % % |
| 7798 | % % |
| 7799 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7800 | % |
| 7801 | % MagickPingImageBlob() pings an image or image sequence from a blob. |
| 7802 | % |
| 7803 | % The format of the MagickPingImageBlob method is: |
| 7804 | % |
| 7805 | % MagickBooleanType MagickPingImageBlob(MagickWand *wand, |
| 7806 | % const void *blob,const size_t length) |
| 7807 | % |
| 7808 | % A description of each parameter follows: |
| 7809 | % |
| 7810 | % o wand: the magick wand. |
| 7811 | % |
| 7812 | % o blob: the blob. |
| 7813 | % |
| 7814 | % o length: the blob length. |
| 7815 | % |
| 7816 | */ |
| 7817 | WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand, |
| 7818 | const void *blob,const size_t length) |
| 7819 | { |
| 7820 | Image |
| 7821 | *images; |
| 7822 | |
| 7823 | ImageInfo |
| 7824 | *read_info; |
| 7825 | |
| 7826 | assert(wand != (MagickWand *) NULL); |
| 7827 | assert(wand->signature == WandSignature); |
| 7828 | if (wand->debug != MagickFalse) |
| 7829 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7830 | read_info=CloneImageInfo(wand->image_info); |
| 7831 | SetImageInfoBlob(read_info,blob,length); |
| 7832 | images=PingImage(read_info,wand->exception); |
| 7833 | read_info=DestroyImageInfo(read_info); |
| 7834 | if (images == (Image *) NULL) |
| 7835 | return(MagickFalse); |
| 7836 | return(InsertImageInWand(wand,images)); |
| 7837 | } |
| 7838 | |
| 7839 | /* |
| 7840 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7841 | % % |
| 7842 | % % |
| 7843 | % % |
| 7844 | % M a g i c k P i n g I m a g e F i l e % |
| 7845 | % % |
| 7846 | % % |
| 7847 | % % |
| 7848 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7849 | % |
| 7850 | % MagickPingImageFile() pings an image or image sequence from an open file |
| 7851 | % descriptor. |
| 7852 | % |
| 7853 | % The format of the MagickPingImageFile method is: |
| 7854 | % |
| 7855 | % MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) |
| 7856 | % |
| 7857 | % A description of each parameter follows: |
| 7858 | % |
| 7859 | % o wand: the magick wand. |
| 7860 | % |
| 7861 | % o file: the file descriptor. |
| 7862 | % |
| 7863 | */ |
| 7864 | WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) |
| 7865 | { |
| 7866 | Image |
| 7867 | *images; |
| 7868 | |
| 7869 | ImageInfo |
| 7870 | *read_info; |
| 7871 | |
| 7872 | assert(wand != (MagickWand *) NULL); |
| 7873 | assert(wand->signature == WandSignature); |
| 7874 | assert(file != (FILE *) NULL); |
| 7875 | if (wand->debug != MagickFalse) |
| 7876 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7877 | read_info=CloneImageInfo(wand->image_info); |
| 7878 | SetImageInfoFile(read_info,file); |
| 7879 | images=PingImage(read_info,wand->exception); |
| 7880 | read_info=DestroyImageInfo(read_info); |
| 7881 | if (images == (Image *) NULL) |
| 7882 | return(MagickFalse); |
| 7883 | return(InsertImageInWand(wand,images)); |
| 7884 | } |
| 7885 | |
| 7886 | /* |
| 7887 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7888 | % % |
| 7889 | % % |
| 7890 | % % |
| 7891 | % M a g i c k P o l a r o i d I m a g e % |
| 7892 | % % |
| 7893 | % % |
| 7894 | % % |
| 7895 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7896 | % |
| 7897 | % MagickPolaroidImage() simulates a Polaroid picture. |
| 7898 | % |
| 7899 | % The format of the MagickPolaroidImage method is: |
| 7900 | % |
| 7901 | % MagickBooleanType MagickPolaroidImage(MagickWand *wand, |
| 7902 | % const DrawingWand *drawing_wand,const double angle) |
| 7903 | % |
| 7904 | % A description of each parameter follows: |
| 7905 | % |
| 7906 | % o wand: the magick wand. |
| 7907 | % |
| 7908 | % o drawing_wand: the draw wand. |
| 7909 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 7910 | % o angle: Apply the effect along this angle. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7911 | % |
| 7912 | */ |
| 7913 | WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand, |
| 7914 | const DrawingWand *drawing_wand,const double angle) |
| 7915 | { |
| 7916 | DrawInfo |
| 7917 | *draw_info; |
| 7918 | |
| 7919 | Image |
| 7920 | *polaroid_image; |
| 7921 | |
| 7922 | assert(wand != (MagickWand *) NULL); |
| 7923 | assert(wand->signature == WandSignature); |
| 7924 | if (wand->debug != MagickFalse) |
| 7925 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7926 | if (wand->images == (Image *) NULL) |
| 7927 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7928 | draw_info=PeekDrawingWand(drawing_wand); |
| 7929 | if (draw_info == (DrawInfo *) NULL) |
| 7930 | return(MagickFalse); |
| 7931 | polaroid_image=PolaroidImage(wand->images,draw_info,angle,wand->exception); |
| 7932 | if (polaroid_image == (Image *) NULL) |
| 7933 | return(MagickFalse); |
| 7934 | ReplaceImageInList(&wand->images,polaroid_image); |
| 7935 | return(MagickTrue); |
| 7936 | } |
| 7937 | |
| 7938 | /* |
| 7939 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7940 | % % |
| 7941 | % % |
| 7942 | % % |
| 7943 | % M a g i c k P o s t e r i z e I m a g e % |
| 7944 | % % |
| 7945 | % % |
| 7946 | % % |
| 7947 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7948 | % |
| 7949 | % MagickPosterizeImage() reduces the image to a limited number of color level. |
| 7950 | % |
| 7951 | % The format of the MagickPosterizeImage method is: |
| 7952 | % |
| 7953 | % MagickBooleanType MagickPosterizeImage(MagickWand *wand, |
| 7954 | % const unsigned levels,const MagickBooleanType dither) |
| 7955 | % |
| 7956 | % A description of each parameter follows: |
| 7957 | % |
| 7958 | % o wand: the magick wand. |
| 7959 | % |
| 7960 | % o levels: Number of color levels allowed in each channel. Very low values |
| 7961 | % (2, 3, or 4) have the most visible effect. |
| 7962 | % |
| 7963 | % o dither: Set this integer value to something other than zero to dither |
| 7964 | % the mapped image. |
| 7965 | % |
| 7966 | */ |
| 7967 | WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 7968 | const size_t levels,const MagickBooleanType dither) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 7969 | { |
| 7970 | MagickBooleanType |
| 7971 | status; |
| 7972 | |
| 7973 | assert(wand != (MagickWand *) NULL); |
| 7974 | assert(wand->signature == WandSignature); |
| 7975 | if (wand->debug != MagickFalse) |
| 7976 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 7977 | if (wand->images == (Image *) NULL) |
| 7978 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 7979 | status=PosterizeImage(wand->images,levels,dither); |
| 7980 | if (status == MagickFalse) |
| 7981 | InheritException(wand->exception,&wand->images->exception); |
| 7982 | return(status); |
| 7983 | } |
| 7984 | |
| 7985 | /* |
| 7986 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7987 | % % |
| 7988 | % % |
| 7989 | % % |
| 7990 | % M a g i c k P r e v i e w I m a g e s % |
| 7991 | % % |
| 7992 | % % |
| 7993 | % % |
| 7994 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7995 | % |
| 7996 | % MagickPreviewImages() tiles 9 thumbnails of the specified image with an |
| 7997 | % image processing operation applied at varying strengths. This helpful |
| 7998 | % to quickly pin-point an appropriate parameter for an image processing |
| 7999 | % operation. |
| 8000 | % |
| 8001 | % The format of the MagickPreviewImages method is: |
| 8002 | % |
| 8003 | % MagickWand *MagickPreviewImages(MagickWand *wand, |
| 8004 | % const PreviewType preview) |
| 8005 | % |
| 8006 | % A description of each parameter follows: |
| 8007 | % |
| 8008 | % o wand: the magick wand. |
| 8009 | % |
| 8010 | % o preview: the preview type. |
| 8011 | % |
| 8012 | */ |
| 8013 | WandExport MagickWand *MagickPreviewImages(MagickWand *wand, |
| 8014 | const PreviewType preview) |
| 8015 | { |
| 8016 | Image |
| 8017 | *preview_image; |
| 8018 | |
| 8019 | assert(wand != (MagickWand *) NULL); |
| 8020 | assert(wand->signature == WandSignature); |
| 8021 | if (wand->debug != MagickFalse) |
| 8022 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8023 | if (wand->images == (Image *) NULL) |
| 8024 | return((MagickWand *) NULL); |
| 8025 | preview_image=PreviewImage(wand->images,preview,wand->exception); |
| 8026 | if (preview_image == (Image *) NULL) |
| 8027 | return((MagickWand *) NULL); |
| 8028 | return(CloneMagickWandFromImages(wand,preview_image)); |
| 8029 | } |
| 8030 | |
| 8031 | /* |
| 8032 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8033 | % % |
| 8034 | % % |
| 8035 | % % |
| 8036 | % M a g i c k P r e v i o u s I m a g e % |
| 8037 | % % |
| 8038 | % % |
| 8039 | % % |
| 8040 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8041 | % |
| 8042 | % MagickPreviousImage() assocates the previous image in an image list with |
| 8043 | % the magick wand. |
| 8044 | % |
| 8045 | % The format of the MagickPreviousImage method is: |
| 8046 | % |
| 8047 | % MagickBooleanType MagickPreviousImage(MagickWand *wand) |
| 8048 | % |
| 8049 | % A description of each parameter follows: |
| 8050 | % |
| 8051 | % o wand: the magick wand. |
| 8052 | % |
| 8053 | */ |
| 8054 | WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand) |
| 8055 | { |
| 8056 | assert(wand != (MagickWand *) NULL); |
| 8057 | assert(wand->signature == WandSignature); |
| 8058 | if (wand->debug != MagickFalse) |
| 8059 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8060 | if (wand->images == (Image *) NULL) |
| 8061 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8062 | if (wand->pend != MagickFalse) |
| 8063 | { |
| 8064 | wand->pend=MagickFalse; |
| 8065 | return(MagickTrue); |
| 8066 | } |
| 8067 | if (GetPreviousImageInList(wand->images) == (Image *) NULL) |
| 8068 | { |
| 8069 | wand->pend=MagickTrue; |
| 8070 | return(MagickFalse); |
| 8071 | } |
| 8072 | wand->images=GetPreviousImageInList(wand->images); |
| 8073 | return(MagickTrue); |
| 8074 | } |
| 8075 | |
| 8076 | /* |
| 8077 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8078 | % % |
| 8079 | % % |
| 8080 | % % |
| 8081 | % M a g i c k Q u a n t i z e I m a g e % |
| 8082 | % % |
| 8083 | % % |
| 8084 | % % |
| 8085 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8086 | % |
| 8087 | % MagickQuantizeImage() analyzes the colors within a reference image and |
| 8088 | % chooses a fixed number of colors to represent the image. The goal of the |
| 8089 | % algorithm is to minimize the color difference between the input and output |
| 8090 | % image while minimizing the processing time. |
| 8091 | % |
| 8092 | % The format of the MagickQuantizeImage method is: |
| 8093 | % |
| 8094 | % MagickBooleanType MagickQuantizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8095 | % const size_t number_colors,const ColorspaceType colorspace, |
| 8096 | % const size_t treedepth,const MagickBooleanType dither, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8097 | % const MagickBooleanType measure_error) |
| 8098 | % |
| 8099 | % A description of each parameter follows: |
| 8100 | % |
| 8101 | % o wand: the magick wand. |
| 8102 | % |
| 8103 | % o number_colors: the number of colors. |
| 8104 | % |
| 8105 | % o colorspace: Perform color reduction in this colorspace, typically |
| 8106 | % RGBColorspace. |
| 8107 | % |
| 8108 | % o treedepth: Normally, this integer value is zero or one. A zero or |
| 8109 | % one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the |
| 8110 | % reference image with the least amount of memory and the fastest |
| 8111 | % computational speed. In some cases, such as an image with low color |
| 8112 | % dispersion (a few number of colors), a value other than |
| 8113 | % Log4(number_colors) is required. To expand the color tree completely, |
| 8114 | % use a value of 8. |
| 8115 | % |
| 8116 | % o dither: A value other than zero distributes the difference between an |
| 8117 | % original image and the corresponding color reduced image to |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 8118 | % neighboring pixels along a Hilbert curve. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8119 | % |
| 8120 | % o measure_error: A value other than zero measures the difference between |
| 8121 | % the original and quantized images. This difference is the total |
| 8122 | % quantization error. The error is computed by summing over all pixels |
| 8123 | % in an image the distance squared in RGB space between each reference |
| 8124 | % pixel value and its quantized value. |
| 8125 | % |
| 8126 | */ |
| 8127 | WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8128 | const size_t number_colors,const ColorspaceType colorspace, |
| 8129 | const size_t treedepth,const MagickBooleanType dither, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8130 | const MagickBooleanType measure_error) |
| 8131 | { |
| 8132 | MagickBooleanType |
| 8133 | status; |
| 8134 | |
| 8135 | QuantizeInfo |
| 8136 | *quantize_info; |
| 8137 | |
| 8138 | assert(wand != (MagickWand *) NULL); |
| 8139 | assert(wand->signature == WandSignature); |
| 8140 | if (wand->debug != MagickFalse) |
| 8141 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8142 | if (wand->images == (Image *) NULL) |
| 8143 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8144 | quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); |
| 8145 | quantize_info->number_colors=number_colors; |
| 8146 | quantize_info->dither=dither; |
| 8147 | quantize_info->tree_depth=treedepth; |
| 8148 | quantize_info->colorspace=colorspace; |
| 8149 | quantize_info->measure_error=measure_error; |
| 8150 | status=QuantizeImage(quantize_info,wand->images); |
| 8151 | if (status == MagickFalse) |
| 8152 | InheritException(wand->exception,&wand->images->exception); |
| 8153 | quantize_info=DestroyQuantizeInfo(quantize_info); |
| 8154 | return(status); |
| 8155 | } |
| 8156 | |
| 8157 | /* |
| 8158 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8159 | % % |
| 8160 | % % |
| 8161 | % % |
| 8162 | % M a g i c k Q u a n t i z e I m a g e s % |
| 8163 | % % |
| 8164 | % % |
| 8165 | % % |
| 8166 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8167 | % |
| 8168 | % MagickQuantizeImages() analyzes the colors within a sequence of images and |
| 8169 | % chooses a fixed number of colors to represent the image. The goal of the |
| 8170 | % algorithm is to minimize the color difference between the input and output |
| 8171 | % image while minimizing the processing time. |
| 8172 | % |
| 8173 | % The format of the MagickQuantizeImages method is: |
| 8174 | % |
| 8175 | % MagickBooleanType MagickQuantizeImages(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8176 | % const size_t number_colors,const ColorspaceType colorspace, |
| 8177 | % const size_t treedepth,const MagickBooleanType dither, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8178 | % const MagickBooleanType measure_error) |
| 8179 | % |
| 8180 | % A description of each parameter follows: |
| 8181 | % |
| 8182 | % o wand: the magick wand. |
| 8183 | % |
| 8184 | % o number_colors: the number of colors. |
| 8185 | % |
| 8186 | % o colorspace: Perform color reduction in this colorspace, typically |
| 8187 | % RGBColorspace. |
| 8188 | % |
| 8189 | % o treedepth: Normally, this integer value is zero or one. A zero or |
| 8190 | % one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the |
| 8191 | % reference image with the least amount of memory and the fastest |
| 8192 | % computational speed. In some cases, such as an image with low color |
| 8193 | % dispersion (a few number of colors), a value other than |
| 8194 | % Log4(number_colors) is required. To expand the color tree completely, |
| 8195 | % use a value of 8. |
| 8196 | % |
| 8197 | % o dither: A value other than zero distributes the difference between an |
| 8198 | % original image and the corresponding color reduced algorithm to |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 8199 | % neighboring pixels along a Hilbert curve. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8200 | % |
| 8201 | % o measure_error: A value other than zero measures the difference between |
| 8202 | % the original and quantized images. This difference is the total |
| 8203 | % quantization error. The error is computed by summing over all pixels |
| 8204 | % in an image the distance squared in RGB space between each reference |
| 8205 | % pixel value and its quantized value. |
| 8206 | % |
| 8207 | */ |
| 8208 | WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8209 | const size_t number_colors,const ColorspaceType colorspace, |
| 8210 | const size_t treedepth,const MagickBooleanType dither, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8211 | const MagickBooleanType measure_error) |
| 8212 | { |
| 8213 | MagickBooleanType |
| 8214 | status; |
| 8215 | |
| 8216 | QuantizeInfo |
| 8217 | *quantize_info; |
| 8218 | |
| 8219 | assert(wand != (MagickWand *) NULL); |
| 8220 | assert(wand->signature == WandSignature); |
| 8221 | if (wand->debug != MagickFalse) |
| 8222 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8223 | if (wand->images == (Image *) NULL) |
| 8224 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8225 | quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); |
| 8226 | quantize_info->number_colors=number_colors; |
| 8227 | quantize_info->dither=dither; |
| 8228 | quantize_info->tree_depth=treedepth; |
| 8229 | quantize_info->colorspace=colorspace; |
| 8230 | quantize_info->measure_error=measure_error; |
| 8231 | status=QuantizeImages(quantize_info,wand->images); |
| 8232 | if (status == MagickFalse) |
| 8233 | InheritException(wand->exception,&wand->images->exception); |
| 8234 | quantize_info=DestroyQuantizeInfo(quantize_info); |
| 8235 | return(status); |
| 8236 | } |
| 8237 | |
| 8238 | /* |
| 8239 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8240 | % % |
| 8241 | % % |
| 8242 | % % |
| 8243 | % M a g i c k R a d i a l B l u r I m a g e % |
| 8244 | % % |
| 8245 | % % |
| 8246 | % % |
| 8247 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8248 | % |
| 8249 | % MagickRadialBlurImage() radial blurs an image. |
| 8250 | % |
| 8251 | % The format of the MagickRadialBlurImage method is: |
| 8252 | % |
| 8253 | % MagickBooleanType MagickRadialBlurImage(MagickWand *wand, |
| 8254 | % const double angle) |
| 8255 | % MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand, |
| 8256 | % const ChannelType channel,const double angle) |
| 8257 | % |
| 8258 | % A description of each parameter follows: |
| 8259 | % |
| 8260 | % o wand: the magick wand. |
| 8261 | % |
| 8262 | % o channel: the image channel(s). |
| 8263 | % |
| 8264 | % o angle: the angle of the blur in degrees. |
| 8265 | % |
| 8266 | */ |
| 8267 | WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand, |
| 8268 | const double angle) |
| 8269 | { |
| 8270 | MagickBooleanType |
| 8271 | status; |
| 8272 | |
| 8273 | status=MagickRadialBlurImageChannel(wand,DefaultChannels,angle); |
| 8274 | return(status); |
| 8275 | } |
| 8276 | |
| 8277 | WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand, |
| 8278 | const ChannelType channel,const double angle) |
| 8279 | { |
| 8280 | Image |
| 8281 | *blur_image; |
| 8282 | |
| 8283 | assert(wand != (MagickWand *) NULL); |
| 8284 | assert(wand->signature == WandSignature); |
| 8285 | if (wand->debug != MagickFalse) |
| 8286 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8287 | if (wand->images == (Image *) NULL) |
| 8288 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8289 | blur_image=RadialBlurImageChannel(wand->images,channel,angle, |
| 8290 | wand->exception); |
| 8291 | if (blur_image == (Image *) NULL) |
| 8292 | return(MagickFalse); |
| 8293 | ReplaceImageInList(&wand->images,blur_image); |
| 8294 | return(MagickTrue); |
| 8295 | } |
| 8296 | |
| 8297 | /* |
| 8298 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8299 | % % |
| 8300 | % % |
| 8301 | % % |
| 8302 | % M a g i c k R a i s e I m a g e % |
| 8303 | % % |
| 8304 | % % |
| 8305 | % % |
| 8306 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8307 | % |
| 8308 | % MagickRaiseImage() creates a simulated three-dimensional button-like effect |
| 8309 | % by lightening and darkening the edges of the image. Members width and |
| 8310 | % height of raise_info define the width of the vertical and horizontal |
| 8311 | % edge of the effect. |
| 8312 | % |
| 8313 | % The format of the MagickRaiseImage method is: |
| 8314 | % |
| 8315 | % MagickBooleanType MagickRaiseImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8316 | % const size_t width,const size_t height,const ssize_t x, |
| 8317 | % const ssize_t y,const MagickBooleanType raise) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8318 | % |
| 8319 | % A description of each parameter follows: |
| 8320 | % |
| 8321 | % o wand: the magick wand. |
| 8322 | % |
| 8323 | % o width,height,x,y: Define the dimensions of the area to raise. |
| 8324 | % |
| 8325 | % o raise: A value other than zero creates a 3-D raise effect, |
| 8326 | % otherwise it has a lowered effect. |
| 8327 | % |
| 8328 | */ |
| 8329 | WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8330 | const size_t width,const size_t height,const ssize_t x, |
| 8331 | const ssize_t y,const MagickBooleanType raise) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8332 | { |
| 8333 | MagickBooleanType |
| 8334 | status; |
| 8335 | |
| 8336 | RectangleInfo |
| 8337 | raise_info; |
| 8338 | |
| 8339 | assert(wand != (MagickWand *) NULL); |
| 8340 | assert(wand->signature == WandSignature); |
| 8341 | if (wand->debug != MagickFalse) |
| 8342 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8343 | if (wand->images == (Image *) NULL) |
| 8344 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8345 | raise_info.width=width; |
| 8346 | raise_info.height=height; |
| 8347 | raise_info.x=x; |
| 8348 | raise_info.y=y; |
| 8349 | status=RaiseImage(wand->images,&raise_info,raise); |
| 8350 | if (status == MagickFalse) |
| 8351 | InheritException(wand->exception,&wand->images->exception); |
| 8352 | return(status); |
| 8353 | } |
| 8354 | |
| 8355 | /* |
| 8356 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8357 | % % |
| 8358 | % % |
| 8359 | % % |
| 8360 | % M a g i c k R a n d o m T h r e s h o l d I m a g e % |
| 8361 | % % |
| 8362 | % % |
| 8363 | % % |
| 8364 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8365 | % |
| 8366 | % MagickRandomThresholdImage() changes the value of individual pixels based on |
| 8367 | % the intensity of each pixel compared to threshold. The result is a |
| 8368 | % high-contrast, two color image. |
| 8369 | % |
| 8370 | % The format of the MagickRandomThresholdImage method is: |
| 8371 | % |
| 8372 | % MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, |
| 8373 | % const double low,const double high) |
| 8374 | % MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand, |
| 8375 | % const ChannelType channel,const double low,const double high) |
| 8376 | % |
| 8377 | % A description of each parameter follows: |
| 8378 | % |
| 8379 | % o wand: the magick wand. |
| 8380 | % |
| 8381 | % o channel: the image channel(s). |
| 8382 | % |
| 8383 | % o low,high: Specify the high and low thresholds. These values range from |
| 8384 | % 0 to QuantumRange. |
| 8385 | % |
| 8386 | */ |
| 8387 | |
| 8388 | WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, |
| 8389 | const double low,const double high) |
| 8390 | { |
| 8391 | MagickBooleanType |
| 8392 | status; |
| 8393 | |
| 8394 | status=MagickRandomThresholdImageChannel(wand,DefaultChannels,low,high); |
| 8395 | return(status); |
| 8396 | } |
| 8397 | |
| 8398 | WandExport MagickBooleanType MagickRandomThresholdImageChannel( |
| 8399 | MagickWand *wand,const ChannelType channel,const double low, |
| 8400 | const double high) |
| 8401 | { |
| 8402 | char |
| 8403 | threshold[MaxTextExtent]; |
| 8404 | |
| 8405 | MagickBooleanType |
| 8406 | status; |
| 8407 | |
| 8408 | assert(wand != (MagickWand *) NULL); |
| 8409 | assert(wand->signature == WandSignature); |
| 8410 | if (wand->debug != MagickFalse) |
| 8411 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8412 | if (wand->images == (Image *) NULL) |
| 8413 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 8414 | (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8415 | status=RandomThresholdImageChannel(wand->images,channel,threshold, |
| 8416 | wand->exception); |
| 8417 | if (status == MagickFalse) |
| 8418 | InheritException(wand->exception,&wand->images->exception); |
| 8419 | return(status); |
| 8420 | } |
| 8421 | |
| 8422 | /* |
| 8423 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8424 | % % |
| 8425 | % % |
| 8426 | % % |
| 8427 | % M a g i c k R e a d I m a g e % |
| 8428 | % % |
| 8429 | % % |
| 8430 | % % |
| 8431 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8432 | % |
| 8433 | % MagickReadImage() reads an image or image sequence. The images are inserted |
| 8434 | % at the current image pointer position. Use MagickSetFirstIterator(), |
| 8435 | % MagickSetLastIterator, or MagickSetImageIndex() to specify the current |
| 8436 | % image pointer position at the beginning of the image list, the end, or |
| 8437 | % anywhere in-between respectively. |
| 8438 | % |
| 8439 | % The format of the MagickReadImage method is: |
| 8440 | % |
| 8441 | % MagickBooleanType MagickReadImage(MagickWand *wand,const char *filename) |
| 8442 | % |
| 8443 | % A description of each parameter follows: |
| 8444 | % |
| 8445 | % o wand: the magick wand. |
| 8446 | % |
| 8447 | % o filename: the image filename. |
| 8448 | % |
| 8449 | */ |
| 8450 | WandExport MagickBooleanType MagickReadImage(MagickWand *wand, |
| 8451 | const char *filename) |
| 8452 | { |
| 8453 | Image |
| 8454 | *images; |
| 8455 | |
| 8456 | ImageInfo |
| 8457 | *read_info; |
| 8458 | |
| 8459 | assert(wand != (MagickWand *) NULL); |
| 8460 | assert(wand->signature == WandSignature); |
| 8461 | if (wand->debug != MagickFalse) |
| 8462 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8463 | read_info=CloneImageInfo(wand->image_info); |
| 8464 | if (filename != (const char *) NULL) |
| 8465 | (void) CopyMagickString(read_info->filename,filename,MaxTextExtent); |
| 8466 | images=ReadImage(read_info,wand->exception); |
| 8467 | read_info=DestroyImageInfo(read_info); |
| 8468 | if (images == (Image *) NULL) |
| 8469 | return(MagickFalse); |
| 8470 | return(InsertImageInWand(wand,images)); |
| 8471 | } |
| 8472 | |
| 8473 | /* |
| 8474 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8475 | % % |
| 8476 | % % |
| 8477 | % % |
| 8478 | % M a g i c k R e a d I m a g e B l o b % |
| 8479 | % % |
| 8480 | % % |
| 8481 | % % |
| 8482 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8483 | % |
| 8484 | % MagickReadImageBlob() reads an image or image sequence from a blob. |
| 8485 | % |
| 8486 | % The format of the MagickReadImageBlob method is: |
| 8487 | % |
| 8488 | % MagickBooleanType MagickReadImageBlob(MagickWand *wand, |
| 8489 | % const void *blob,const size_t length) |
| 8490 | % |
| 8491 | % A description of each parameter follows: |
| 8492 | % |
| 8493 | % o wand: the magick wand. |
| 8494 | % |
| 8495 | % o blob: the blob. |
| 8496 | % |
| 8497 | % o length: the blob length. |
| 8498 | % |
| 8499 | */ |
| 8500 | WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand, |
| 8501 | const void *blob,const size_t length) |
| 8502 | { |
| 8503 | Image |
| 8504 | *images; |
| 8505 | |
| 8506 | assert(wand != (MagickWand *) NULL); |
| 8507 | assert(wand->signature == WandSignature); |
| 8508 | if (wand->debug != MagickFalse) |
| 8509 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8510 | images=BlobToImage(wand->image_info,blob,length,wand->exception); |
| 8511 | if (images == (Image *) NULL) |
| 8512 | return(MagickFalse); |
| 8513 | return(InsertImageInWand(wand,images)); |
| 8514 | } |
| 8515 | |
| 8516 | /* |
| 8517 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8518 | % % |
| 8519 | % % |
| 8520 | % % |
| 8521 | % M a g i c k R e a d I m a g e F i l e % |
| 8522 | % % |
| 8523 | % % |
| 8524 | % % |
| 8525 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8526 | % |
| 8527 | % MagickReadImageFile() reads an image or image sequence from an open file |
| 8528 | % descriptor. |
| 8529 | % |
| 8530 | % The format of the MagickReadImageFile method is: |
| 8531 | % |
| 8532 | % MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file) |
| 8533 | % |
| 8534 | % A description of each parameter follows: |
| 8535 | % |
| 8536 | % o wand: the magick wand. |
| 8537 | % |
| 8538 | % o file: the file descriptor. |
| 8539 | % |
| 8540 | */ |
| 8541 | WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file) |
| 8542 | { |
| 8543 | Image |
| 8544 | *images; |
| 8545 | |
| 8546 | ImageInfo |
| 8547 | *read_info; |
| 8548 | |
| 8549 | assert(wand != (MagickWand *) NULL); |
| 8550 | assert(wand->signature == WandSignature); |
| 8551 | assert(file != (FILE *) NULL); |
| 8552 | if (wand->debug != MagickFalse) |
| 8553 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8554 | read_info=CloneImageInfo(wand->image_info); |
| 8555 | SetImageInfoFile(read_info,file); |
| 8556 | images=ReadImage(read_info,wand->exception); |
| 8557 | read_info=DestroyImageInfo(read_info); |
| 8558 | if (images == (Image *) NULL) |
| 8559 | return(MagickFalse); |
| 8560 | return(InsertImageInWand(wand,images)); |
| 8561 | } |
| 8562 | |
| 8563 | /* |
| 8564 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8565 | % % |
| 8566 | % % |
| 8567 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8568 | % M a g i c k R e m a p I m a g e % |
| 8569 | % % |
| 8570 | % % |
| 8571 | % % |
| 8572 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8573 | % |
| 8574 | % MagickRemapImage() replaces the colors of an image with the closest color |
| 8575 | % from a reference image. |
| 8576 | % |
| 8577 | % The format of the MagickRemapImage method is: |
| 8578 | % |
| 8579 | % MagickBooleanType MagickRemapImage(MagickWand *wand, |
| 8580 | % const MagickWand *remap_wand,const DitherMethod method) |
| 8581 | % |
| 8582 | % A description of each parameter follows: |
| 8583 | % |
| 8584 | % o wand: the magick wand. |
| 8585 | % |
| 8586 | % o affinity: the affinity wand. |
| 8587 | % |
| 8588 | % o method: choose from these dither methods: NoDitherMethod, |
| 8589 | % RiemersmaDitherMethod, or FloydSteinbergDitherMethod. |
| 8590 | % |
| 8591 | */ |
| 8592 | WandExport MagickBooleanType MagickRemapImage(MagickWand *wand, |
| 8593 | const MagickWand *remap_wand,const DitherMethod method) |
| 8594 | { |
| 8595 | MagickBooleanType |
| 8596 | status; |
| 8597 | |
| 8598 | QuantizeInfo |
| 8599 | *quantize_info; |
| 8600 | |
| 8601 | assert(wand != (MagickWand *) NULL); |
| 8602 | assert(wand->signature == WandSignature); |
| 8603 | if (wand->debug != MagickFalse) |
| 8604 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8605 | if ((wand->images == (Image *) NULL) || |
| 8606 | (remap_wand->images == (Image *) NULL)) |
| 8607 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8608 | quantize_info=AcquireQuantizeInfo(wand->image_info); |
| 8609 | quantize_info->dither_method=method; |
| 8610 | if (method == NoDitherMethod) |
| 8611 | quantize_info->dither=MagickFalse; |
| 8612 | status=RemapImage(quantize_info,wand->images,remap_wand->images); |
| 8613 | quantize_info=DestroyQuantizeInfo(quantize_info); |
| 8614 | if (status == MagickFalse) |
| 8615 | InheritException(wand->exception,&wand->images->exception); |
| 8616 | return(status); |
| 8617 | } |
| 8618 | |
| 8619 | /* |
| 8620 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8621 | % % |
| 8622 | % % |
| 8623 | % % |
| 8624 | % M a g i c k R e m o v e I m a g e % |
| 8625 | % % |
| 8626 | % % |
| 8627 | % % |
| 8628 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8629 | % |
| 8630 | % MagickRemoveImage() removes an image from the image list. |
| 8631 | % |
| 8632 | % The format of the MagickRemoveImage method is: |
| 8633 | % |
| 8634 | % MagickBooleanType MagickRemoveImage(MagickWand *wand) |
| 8635 | % |
| 8636 | % A description of each parameter follows: |
| 8637 | % |
| 8638 | % o wand: the magick wand. |
| 8639 | % |
| 8640 | % o insert: the splice wand. |
| 8641 | % |
| 8642 | */ |
| 8643 | WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand) |
| 8644 | { |
| 8645 | assert(wand != (MagickWand *) NULL); |
| 8646 | assert(wand->signature == WandSignature); |
| 8647 | if (wand->debug != MagickFalse) |
| 8648 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8649 | if (wand->images == (Image *) NULL) |
| 8650 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8651 | DeleteImageFromList(&wand->images); |
| 8652 | return(MagickTrue); |
| 8653 | } |
| 8654 | |
| 8655 | /* |
| 8656 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8657 | % % |
| 8658 | % % |
| 8659 | % % |
| 8660 | % M a g i c k R e s a m p l e I m a g e % |
| 8661 | % % |
| 8662 | % % |
| 8663 | % % |
| 8664 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8665 | % |
| 8666 | % MagickResampleImage() resample image to desired resolution. |
| 8667 | % |
| 8668 | % Bessel Blackman Box |
| 8669 | % Catrom Cubic Gaussian |
| 8670 | % Hanning Hermite Lanczos |
| 8671 | % Mitchell Point Quandratic |
| 8672 | % Sinc Triangle |
| 8673 | % |
| 8674 | % Most of the filters are FIR (finite impulse response), however, Bessel, |
| 8675 | % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc |
| 8676 | % are windowed (brought down to zero) with the Blackman filter. |
| 8677 | % |
| 8678 | % The format of the MagickResampleImage method is: |
| 8679 | % |
| 8680 | % MagickBooleanType MagickResampleImage(MagickWand *wand, |
| 8681 | % const double x_resolution,const double y_resolution, |
| 8682 | % const FilterTypes filter,const double blur) |
| 8683 | % |
| 8684 | % A description of each parameter follows: |
| 8685 | % |
| 8686 | % o wand: the magick wand. |
| 8687 | % |
| 8688 | % o x_resolution: the new image x resolution. |
| 8689 | % |
| 8690 | % o y_resolution: the new image y resolution. |
| 8691 | % |
| 8692 | % o filter: Image filter to use. |
| 8693 | % |
| 8694 | % o blur: the blur factor where > 1 is blurry, < 1 is sharp. |
| 8695 | % |
| 8696 | */ |
| 8697 | WandExport MagickBooleanType MagickResampleImage(MagickWand *wand, |
| 8698 | const double x_resolution,const double y_resolution,const FilterTypes filter, |
| 8699 | const double blur) |
| 8700 | { |
| 8701 | Image |
| 8702 | *resample_image; |
| 8703 | |
| 8704 | assert(wand != (MagickWand *) NULL); |
| 8705 | assert(wand->signature == WandSignature); |
| 8706 | if (wand->debug != MagickFalse) |
| 8707 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8708 | if (wand->images == (Image *) NULL) |
| 8709 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8710 | resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter, |
| 8711 | blur,wand->exception); |
| 8712 | if (resample_image == (Image *) NULL) |
| 8713 | return(MagickFalse); |
| 8714 | ReplaceImageInList(&wand->images,resample_image); |
| 8715 | return(MagickTrue); |
| 8716 | } |
| 8717 | |
| 8718 | /* |
| 8719 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8720 | % % |
| 8721 | % % |
| 8722 | % % |
| 8723 | % M a g i c k R e s e t I m a g e P a g e % |
| 8724 | % % |
| 8725 | % % |
| 8726 | % % |
| 8727 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8728 | % |
| 8729 | % MagickResetImagePage() resets the Wand page canvas and position. |
| 8730 | % |
| 8731 | % The format of the MagickResetImagePage method is: |
| 8732 | % |
| 8733 | % MagickBooleanType MagickResetImagePage(MagickWand *wand, |
| 8734 | % const char *page) |
| 8735 | % |
| 8736 | % A description of each parameter follows: |
| 8737 | % |
| 8738 | % o wand: the magick wand. |
| 8739 | % |
| 8740 | % o page: the relative page specification. |
| 8741 | % |
| 8742 | */ |
| 8743 | WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand, |
| 8744 | const char *page) |
| 8745 | { |
| 8746 | assert(wand != (MagickWand *) NULL); |
| 8747 | assert(wand->signature == WandSignature); |
| 8748 | if (wand->debug != MagickFalse) |
| 8749 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8750 | if (wand->images == (Image *) NULL) |
| 8751 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8752 | if ((page == (char *) NULL) || (*page == '\0')) |
| 8753 | { |
| 8754 | (void) ParseAbsoluteGeometry("0x0+0+0",&wand->images->page); |
| 8755 | return(MagickTrue); |
| 8756 | } |
| 8757 | return(ResetImagePage(wand->images,page)); |
| 8758 | } |
| 8759 | |
| 8760 | /* |
| 8761 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8762 | % % |
| 8763 | % % |
| 8764 | % % |
| 8765 | % M a g i c k R e s i z e I m a g e % |
| 8766 | % % |
| 8767 | % % |
| 8768 | % % |
| 8769 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8770 | % |
| 8771 | % MagickResizeImage() scales an image to the desired dimensions with one of |
| 8772 | % these filters: |
| 8773 | % |
| 8774 | % Bessel Blackman Box |
| 8775 | % Catrom Cubic Gaussian |
| 8776 | % Hanning Hermite Lanczos |
| 8777 | % Mitchell Point Quandratic |
| 8778 | % Sinc Triangle |
| 8779 | % |
| 8780 | % Most of the filters are FIR (finite impulse response), however, Bessel, |
| 8781 | % Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc |
| 8782 | % are windowed (brought down to zero) with the Blackman filter. |
| 8783 | % |
| 8784 | % The format of the MagickResizeImage method is: |
| 8785 | % |
| 8786 | % MagickBooleanType MagickResizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8787 | % const size_t columns,const size_t rows, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8788 | % const FilterTypes filter,const double blur) |
| 8789 | % |
| 8790 | % A description of each parameter follows: |
| 8791 | % |
| 8792 | % o wand: the magick wand. |
| 8793 | % |
| 8794 | % o columns: the number of columns in the scaled image. |
| 8795 | % |
| 8796 | % o rows: the number of rows in the scaled image. |
| 8797 | % |
| 8798 | % o filter: Image filter to use. |
| 8799 | % |
| 8800 | % o blur: the blur factor where > 1 is blurry, < 1 is sharp. |
| 8801 | % |
| 8802 | */ |
| 8803 | WandExport MagickBooleanType MagickResizeImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8804 | const size_t columns,const size_t rows,const FilterTypes filter, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8805 | const double blur) |
| 8806 | { |
| 8807 | Image |
| 8808 | *resize_image; |
| 8809 | |
| 8810 | assert(wand != (MagickWand *) NULL); |
| 8811 | assert(wand->signature == WandSignature); |
| 8812 | if (wand->debug != MagickFalse) |
| 8813 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8814 | if (wand->images == (Image *) NULL) |
| 8815 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8816 | resize_image=ResizeImage(wand->images,columns,rows,filter,blur, |
| 8817 | wand->exception); |
| 8818 | if (resize_image == (Image *) NULL) |
| 8819 | return(MagickFalse); |
| 8820 | ReplaceImageInList(&wand->images,resize_image); |
| 8821 | return(MagickTrue); |
| 8822 | } |
| 8823 | |
| 8824 | /* |
| 8825 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8826 | % % |
| 8827 | % % |
| 8828 | % % |
| 8829 | % M a g i c k R o l l I m a g e % |
| 8830 | % % |
| 8831 | % % |
| 8832 | % % |
| 8833 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8834 | % |
| 8835 | % MagickRollImage() offsets an image as defined by x and y. |
| 8836 | % |
| 8837 | % The format of the MagickRollImage method is: |
| 8838 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8839 | % MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x, |
| 8840 | % const size_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8841 | % |
| 8842 | % A description of each parameter follows: |
| 8843 | % |
| 8844 | % o wand: the magick wand. |
| 8845 | % |
| 8846 | % o x: the x offset. |
| 8847 | % |
| 8848 | % o y: the y offset. |
| 8849 | % |
| 8850 | % |
| 8851 | */ |
| 8852 | WandExport MagickBooleanType MagickRollImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8853 | const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8854 | { |
| 8855 | Image |
| 8856 | *roll_image; |
| 8857 | |
| 8858 | assert(wand != (MagickWand *) NULL); |
| 8859 | assert(wand->signature == WandSignature); |
| 8860 | if (wand->debug != MagickFalse) |
| 8861 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8862 | if (wand->images == (Image *) NULL) |
| 8863 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8864 | roll_image=RollImage(wand->images,x,y,wand->exception); |
| 8865 | if (roll_image == (Image *) NULL) |
| 8866 | return(MagickFalse); |
| 8867 | ReplaceImageInList(&wand->images,roll_image); |
| 8868 | return(MagickTrue); |
| 8869 | } |
| 8870 | |
| 8871 | /* |
| 8872 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8873 | % % |
| 8874 | % % |
| 8875 | % % |
| 8876 | % M a g i c k R o t a t e I m a g e % |
| 8877 | % % |
| 8878 | % % |
| 8879 | % % |
| 8880 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8881 | % |
| 8882 | % MagickRotateImage() rotates an image the specified number of degrees. Empty |
| 8883 | % triangles left over from rotating the image are filled with the |
| 8884 | % background color. |
| 8885 | % |
| 8886 | % The format of the MagickRotateImage method is: |
| 8887 | % |
| 8888 | % MagickBooleanType MagickRotateImage(MagickWand *wand, |
| 8889 | % const PixelWand *background,const double degrees) |
| 8890 | % |
| 8891 | % A description of each parameter follows: |
| 8892 | % |
| 8893 | % o wand: the magick wand. |
| 8894 | % |
| 8895 | % o background: the background pixel wand. |
| 8896 | % |
| 8897 | % o degrees: the number of degrees to rotate the image. |
| 8898 | % |
| 8899 | % |
| 8900 | */ |
| 8901 | WandExport MagickBooleanType MagickRotateImage(MagickWand *wand, |
| 8902 | const PixelWand *background,const double degrees) |
| 8903 | { |
| 8904 | Image |
| 8905 | *rotate_image; |
| 8906 | |
| 8907 | assert(wand != (MagickWand *) NULL); |
| 8908 | assert(wand->signature == WandSignature); |
| 8909 | if (wand->debug != MagickFalse) |
| 8910 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8911 | if (wand->images == (Image *) NULL) |
| 8912 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8913 | PixelGetQuantumColor(background,&wand->images->background_color); |
| 8914 | rotate_image=RotateImage(wand->images,degrees,wand->exception); |
| 8915 | if (rotate_image == (Image *) NULL) |
| 8916 | return(MagickFalse); |
| 8917 | ReplaceImageInList(&wand->images,rotate_image); |
| 8918 | return(MagickTrue); |
| 8919 | } |
| 8920 | |
| 8921 | /* |
| 8922 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8923 | % % |
| 8924 | % % |
| 8925 | % % |
| 8926 | % M a g i c k S a m p l e I m a g e % |
| 8927 | % % |
| 8928 | % % |
| 8929 | % % |
| 8930 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8931 | % |
| 8932 | % MagickSampleImage() scales an image to the desired dimensions with pixel |
| 8933 | % sampling. Unlike other scaling methods, this method does not introduce |
| 8934 | % any additional color into the scaled image. |
| 8935 | % |
| 8936 | % The format of the MagickSampleImage method is: |
| 8937 | % |
| 8938 | % MagickBooleanType MagickSampleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8939 | % const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8940 | % |
| 8941 | % A description of each parameter follows: |
| 8942 | % |
| 8943 | % o wand: the magick wand. |
| 8944 | % |
| 8945 | % o columns: the number of columns in the scaled image. |
| 8946 | % |
| 8947 | % o rows: the number of rows in the scaled image. |
| 8948 | % |
| 8949 | % |
| 8950 | */ |
| 8951 | WandExport MagickBooleanType MagickSampleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8952 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8953 | { |
| 8954 | Image |
| 8955 | *sample_image; |
| 8956 | |
| 8957 | assert(wand != (MagickWand *) NULL); |
| 8958 | assert(wand->signature == WandSignature); |
| 8959 | if (wand->debug != MagickFalse) |
| 8960 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 8961 | if (wand->images == (Image *) NULL) |
| 8962 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 8963 | sample_image=SampleImage(wand->images,columns,rows,wand->exception); |
| 8964 | if (sample_image == (Image *) NULL) |
| 8965 | return(MagickFalse); |
| 8966 | ReplaceImageInList(&wand->images,sample_image); |
| 8967 | return(MagickTrue); |
| 8968 | } |
| 8969 | |
| 8970 | /* |
| 8971 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8972 | % % |
| 8973 | % % |
| 8974 | % % |
| 8975 | % M a g i c k S c a l e I m a g e % |
| 8976 | % % |
| 8977 | % % |
| 8978 | % % |
| 8979 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8980 | % |
| 8981 | % MagickScaleImage() scales the size of an image to the given dimensions. |
| 8982 | % |
| 8983 | % The format of the MagickScaleImage method is: |
| 8984 | % |
| 8985 | % MagickBooleanType MagickScaleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8986 | % const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8987 | % |
| 8988 | % A description of each parameter follows: |
| 8989 | % |
| 8990 | % o wand: the magick wand. |
| 8991 | % |
| 8992 | % o columns: the number of columns in the scaled image. |
| 8993 | % |
| 8994 | % o rows: the number of rows in the scaled image. |
| 8995 | % |
| 8996 | % |
| 8997 | */ |
| 8998 | WandExport MagickBooleanType MagickScaleImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 8999 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9000 | { |
| 9001 | Image |
| 9002 | *scale_image; |
| 9003 | |
| 9004 | assert(wand != (MagickWand *) NULL); |
| 9005 | assert(wand->signature == WandSignature); |
| 9006 | if (wand->debug != MagickFalse) |
| 9007 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9008 | if (wand->images == (Image *) NULL) |
| 9009 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9010 | scale_image=ScaleImage(wand->images,columns,rows,wand->exception); |
| 9011 | if (scale_image == (Image *) NULL) |
| 9012 | return(MagickFalse); |
| 9013 | ReplaceImageInList(&wand->images,scale_image); |
| 9014 | return(MagickTrue); |
| 9015 | } |
| 9016 | |
| 9017 | /* |
| 9018 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9019 | % % |
| 9020 | % % |
| 9021 | % % |
| 9022 | % M a g i c k S e g m e n t I m a g e % |
| 9023 | % % |
| 9024 | % % |
| 9025 | % % |
| 9026 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9027 | % |
| 9028 | % MagickSegmentImage() segments an image by analyzing the histograms of the |
| 9029 | % color components and identifying units that are homogeneous with the fuzzy |
| 9030 | % C-means technique. |
| 9031 | % |
| 9032 | % The format of the SegmentImage method is: |
| 9033 | % |
| 9034 | % MagickBooleanType MagickSegmentImage(MagickWand *wand, |
| 9035 | % const ColorspaceType colorspace,const MagickBooleanType verbose, |
| 9036 | % const double cluster_threshold,const double smooth_threshold) |
| 9037 | % |
| 9038 | % A description of each parameter follows. |
| 9039 | % |
| 9040 | % o wand: the wand. |
| 9041 | % |
| 9042 | % o colorspace: the image colorspace. |
| 9043 | % |
| 9044 | % o verbose: Set to MagickTrue to print detailed information about the |
| 9045 | % identified classes. |
| 9046 | % |
| 9047 | % o cluster_threshold: This represents the minimum number of pixels |
| 9048 | % contained in a hexahedra before it can be considered valid (expressed as |
| 9049 | % a percentage). |
| 9050 | % |
| 9051 | % o smooth_threshold: the smoothing threshold eliminates noise in the second |
| 9052 | % derivative of the histogram. As the value is increased, you can expect a |
| 9053 | % smoother second derivative. |
| 9054 | % |
| 9055 | */ |
| 9056 | MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand, |
| 9057 | const ColorspaceType colorspace,const MagickBooleanType verbose, |
| 9058 | const double cluster_threshold,const double smooth_threshold) |
| 9059 | { |
| 9060 | MagickBooleanType |
| 9061 | status; |
| 9062 | |
| 9063 | assert(wand != (MagickWand *) NULL); |
| 9064 | assert(wand->signature == WandSignature); |
| 9065 | if (wand->debug != MagickFalse) |
| 9066 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9067 | if (wand->images == (Image *) NULL) |
| 9068 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9069 | status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold, |
| 9070 | smooth_threshold); |
| 9071 | if (status == MagickFalse) |
| 9072 | InheritException(wand->exception,&wand->images->exception); |
| 9073 | return(status); |
| 9074 | } |
| 9075 | |
| 9076 | /* |
| 9077 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9078 | % % |
| 9079 | % % |
| 9080 | % % |
| 9081 | % M a g i c k S e l e c t i v e B l u r I m a g e % |
| 9082 | % % |
| 9083 | % % |
| 9084 | % % |
| 9085 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9086 | % |
| 9087 | % MagickSelectiveBlurImage() selectively blur an image within a contrast |
| 9088 | % threshold. It is similar to the unsharpen mask that sharpens everything with |
| 9089 | % contrast above a certain threshold. |
| 9090 | % |
| 9091 | % The format of the MagickSelectiveBlurImage method is: |
| 9092 | % |
| 9093 | % MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand, |
| 9094 | % const double radius,const double sigma,const double threshold) |
| 9095 | % MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand, |
| 9096 | % const ChannelType channel,const double radius,const double sigma, |
| 9097 | % const double threshold) |
| 9098 | % |
| 9099 | % A description of each parameter follows: |
| 9100 | % |
| 9101 | % o wand: the magick wand. |
| 9102 | % |
| 9103 | % o channel: the image channel(s). |
| 9104 | % |
| 9105 | % o radius: the radius of the gaussian, in pixels, not counting the center |
| 9106 | % pixel. |
| 9107 | % |
| 9108 | % o sigma: the standard deviation of the gaussian, in pixels. |
| 9109 | % |
| 9110 | % o threshold: only pixels within this contrast threshold are included |
cristy | 6a917d9 | 2009-10-06 19:23:54 +0000 | [diff] [blame] | 9111 | % in the blur operation. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9112 | % |
| 9113 | */ |
| 9114 | |
| 9115 | WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand, |
| 9116 | const double radius,const double sigma,const double threshold) |
| 9117 | { |
| 9118 | MagickBooleanType |
| 9119 | status; |
| 9120 | |
| 9121 | status=MagickSelectiveBlurImageChannel(wand,DefaultChannels,radius,sigma, |
| 9122 | threshold); |
| 9123 | return(status); |
| 9124 | } |
| 9125 | |
| 9126 | WandExport MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand, |
| 9127 | const ChannelType channel,const double radius,const double sigma, |
| 9128 | const double threshold) |
| 9129 | { |
| 9130 | Image |
| 9131 | *blur_image; |
| 9132 | |
| 9133 | assert(wand != (MagickWand *) NULL); |
| 9134 | assert(wand->signature == WandSignature); |
| 9135 | if (wand->debug != MagickFalse) |
| 9136 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9137 | if (wand->images == (Image *) NULL) |
| 9138 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9139 | blur_image=SelectiveBlurImageChannel(wand->images,channel,radius,sigma, |
| 9140 | threshold,wand->exception); |
| 9141 | if (blur_image == (Image *) NULL) |
| 9142 | return(MagickFalse); |
| 9143 | ReplaceImageInList(&wand->images,blur_image); |
| 9144 | return(MagickTrue); |
| 9145 | } |
| 9146 | |
| 9147 | /* |
| 9148 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9149 | % % |
| 9150 | % % |
| 9151 | % % |
| 9152 | % M a g i c k S e p a r a t e I m a g e C h a n n e l % |
| 9153 | % % |
| 9154 | % % |
| 9155 | % % |
| 9156 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9157 | % |
| 9158 | % MagickSeparateImageChannel() separates a channel from the image and returns a |
| 9159 | % grayscale image. A channel is a particular color component of each pixel |
| 9160 | % in the image. |
| 9161 | % |
| 9162 | % The format of the MagickSeparateImageChannel method is: |
| 9163 | % |
| 9164 | % MagickBooleanType MagickSeparateImageChannel(MagickWand *wand, |
| 9165 | % const ChannelType channel) |
| 9166 | % |
| 9167 | % A description of each parameter follows: |
| 9168 | % |
| 9169 | % o wand: the magick wand. |
| 9170 | % |
| 9171 | % o channel: the image channel(s). |
| 9172 | % |
| 9173 | */ |
| 9174 | WandExport MagickBooleanType MagickSeparateImageChannel(MagickWand *wand, |
| 9175 | const ChannelType channel) |
| 9176 | { |
| 9177 | MagickBooleanType |
| 9178 | status; |
| 9179 | |
| 9180 | assert(wand != (MagickWand *) NULL); |
| 9181 | assert(wand->signature == WandSignature); |
| 9182 | if (wand->debug != MagickFalse) |
| 9183 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9184 | if (wand->images == (Image *) NULL) |
| 9185 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9186 | status=SeparateImageChannel(wand->images,channel); |
| 9187 | if (status == MagickFalse) |
| 9188 | InheritException(wand->exception,&wand->images->exception); |
| 9189 | return(status); |
| 9190 | } |
| 9191 | |
| 9192 | /* |
| 9193 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9194 | % % |
| 9195 | % % |
| 9196 | % % |
| 9197 | % M a g i c k S e p i a T o n e I m a g e % |
| 9198 | % % |
| 9199 | % % |
| 9200 | % % |
| 9201 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9202 | % |
| 9203 | % MagickSepiaToneImage() applies a special effect to the image, similar to the |
| 9204 | % effect achieved in a photo darkroom by sepia toning. Threshold ranges from |
| 9205 | % 0 to QuantumRange and is a measure of the extent of the sepia toning. A |
| 9206 | % threshold of 80% is a good starting point for a reasonable tone. |
| 9207 | % |
| 9208 | % The format of the MagickSepiaToneImage method is: |
| 9209 | % |
| 9210 | % MagickBooleanType MagickSepiaToneImage(MagickWand *wand, |
| 9211 | % const double threshold) |
| 9212 | % |
| 9213 | % A description of each parameter follows: |
| 9214 | % |
| 9215 | % o wand: the magick wand. |
| 9216 | % |
| 9217 | % o threshold: Define the extent of the sepia toning. |
| 9218 | % |
| 9219 | */ |
| 9220 | WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand, |
| 9221 | const double threshold) |
| 9222 | { |
| 9223 | Image |
| 9224 | *sepia_image; |
| 9225 | |
| 9226 | assert(wand != (MagickWand *) NULL); |
| 9227 | assert(wand->signature == WandSignature); |
| 9228 | if (wand->debug != MagickFalse) |
| 9229 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9230 | if (wand->images == (Image *) NULL) |
| 9231 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9232 | sepia_image=SepiaToneImage(wand->images,threshold,wand->exception); |
| 9233 | if (sepia_image == (Image *) NULL) |
| 9234 | return(MagickFalse); |
| 9235 | ReplaceImageInList(&wand->images,sepia_image); |
| 9236 | return(MagickTrue); |
| 9237 | } |
| 9238 | |
| 9239 | /* |
| 9240 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9241 | % % |
| 9242 | % % |
| 9243 | % % |
| 9244 | % M a g i c k S e t I m a g e % |
| 9245 | % % |
| 9246 | % % |
| 9247 | % % |
| 9248 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9249 | % |
| 9250 | % MagickSetImage() replaces the last image returned by MagickSetImageIndex(), |
| 9251 | % MagickNextImage(), MagickPreviousImage() with the images from the specified |
| 9252 | % wand. |
| 9253 | % |
| 9254 | % The format of the MagickSetImage method is: |
| 9255 | % |
| 9256 | % MagickBooleanType MagickSetImage(MagickWand *wand, |
| 9257 | % const MagickWand *set_wand) |
| 9258 | % |
| 9259 | % A description of each parameter follows: |
| 9260 | % |
| 9261 | % o wand: the magick wand. |
| 9262 | % |
| 9263 | % o set_wand: the set_wand wand. |
| 9264 | % |
| 9265 | */ |
| 9266 | WandExport MagickBooleanType MagickSetImage(MagickWand *wand, |
| 9267 | const MagickWand *set_wand) |
| 9268 | { |
| 9269 | Image |
| 9270 | *images; |
| 9271 | |
| 9272 | assert(wand != (MagickWand *) NULL); |
| 9273 | assert(wand->signature == WandSignature); |
| 9274 | if (wand->debug != MagickFalse) |
| 9275 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9276 | assert(set_wand != (MagickWand *) NULL); |
| 9277 | assert(set_wand->signature == WandSignature); |
| 9278 | if (wand->debug != MagickFalse) |
| 9279 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name); |
| 9280 | if (set_wand->images == (Image *) NULL) |
| 9281 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9282 | images=CloneImageList(set_wand->images,wand->exception); |
| 9283 | if (images == (Image *) NULL) |
| 9284 | return(MagickFalse); |
| 9285 | ReplaceImageInList(&wand->images,images); |
| 9286 | return(MagickTrue); |
| 9287 | } |
| 9288 | |
| 9289 | /* |
| 9290 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9291 | % % |
| 9292 | % % |
| 9293 | % % |
| 9294 | % M a g i c k S e t I m a g e A l p h a C h a n n e l % |
| 9295 | % % |
| 9296 | % % |
| 9297 | % % |
| 9298 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9299 | % |
| 9300 | % MagickSetImageAlphaChannel() activates, deactivates, resets, or sets the |
| 9301 | % alpha channel. |
| 9302 | % |
| 9303 | % The format of the MagickSetImageAlphaChannel method is: |
| 9304 | % |
| 9305 | % MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, |
| 9306 | % const AlphaChannelType alpha_type) |
| 9307 | % |
| 9308 | % A description of each parameter follows: |
| 9309 | % |
| 9310 | % o wand: the magick wand. |
| 9311 | % |
| 9312 | % o alpha_type: the alpha channel type: ActivateAlphaChannel, |
| 9313 | % DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel. |
| 9314 | % |
| 9315 | */ |
| 9316 | WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, |
| 9317 | const AlphaChannelType alpha_type) |
| 9318 | { |
| 9319 | assert(wand != (MagickWand *) NULL); |
| 9320 | assert(wand->signature == WandSignature); |
| 9321 | if (wand->debug != MagickFalse) |
| 9322 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9323 | if (wand->images == (Image *) NULL) |
| 9324 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9325 | return(SetImageAlphaChannel(wand->images,alpha_type)); |
| 9326 | } |
| 9327 | |
| 9328 | /* |
| 9329 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9330 | % % |
| 9331 | % % |
| 9332 | % % |
| 9333 | % M a g i c k S e t I m a g e B a c k g r o u n d C o l o r % |
| 9334 | % % |
| 9335 | % % |
| 9336 | % % |
| 9337 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9338 | % |
| 9339 | % MagickSetImageBackgroundColor() sets the image background color. |
| 9340 | % |
| 9341 | % The format of the MagickSetImageBackgroundColor method is: |
| 9342 | % |
| 9343 | % MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand, |
| 9344 | % const PixelWand *background) |
| 9345 | % |
| 9346 | % A description of each parameter follows: |
| 9347 | % |
| 9348 | % o wand: the magick wand. |
| 9349 | % |
| 9350 | % o background: the background pixel wand. |
| 9351 | % |
| 9352 | */ |
| 9353 | WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand, |
| 9354 | const PixelWand *background) |
| 9355 | { |
| 9356 | assert(wand != (MagickWand *) NULL); |
| 9357 | assert(wand->signature == WandSignature); |
| 9358 | if (wand->debug != MagickFalse) |
| 9359 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9360 | if (wand->images == (Image *) NULL) |
| 9361 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9362 | PixelGetQuantumColor(background,&wand->images->background_color); |
| 9363 | return(MagickTrue); |
| 9364 | } |
| 9365 | |
| 9366 | /* |
| 9367 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9368 | % % |
| 9369 | % % |
| 9370 | % % |
| 9371 | % M a g i c k S e t I m a g e B i a s % |
| 9372 | % % |
| 9373 | % % |
| 9374 | % % |
| 9375 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9376 | % |
| 9377 | % MagickSetImageBias() sets the image bias for any method that convolves an |
| 9378 | % image (e.g. MagickConvolveImage()). |
| 9379 | % |
| 9380 | % The format of the MagickSetImageBias method is: |
| 9381 | % |
| 9382 | % MagickBooleanType MagickSetImageBias(MagickWand *wand, |
| 9383 | % const double bias) |
| 9384 | % |
| 9385 | % A description of each parameter follows: |
| 9386 | % |
| 9387 | % o wand: the magick wand. |
| 9388 | % |
| 9389 | % o bias: the image bias. |
| 9390 | % |
| 9391 | */ |
| 9392 | WandExport MagickBooleanType MagickSetImageBias(MagickWand *wand, |
| 9393 | const double bias) |
| 9394 | { |
| 9395 | assert(wand != (MagickWand *) NULL); |
| 9396 | assert(wand->signature == WandSignature); |
| 9397 | if (wand->debug != MagickFalse) |
| 9398 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9399 | if (wand->images == (Image *) NULL) |
| 9400 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9401 | wand->images->bias=bias; |
| 9402 | return(MagickTrue); |
| 9403 | } |
| 9404 | |
| 9405 | /* |
| 9406 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9407 | % % |
| 9408 | % % |
| 9409 | % % |
| 9410 | % M a g i c k S e t I m a g e B l u e P r i m a r y % |
| 9411 | % % |
| 9412 | % % |
| 9413 | % % |
| 9414 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9415 | % |
| 9416 | % MagickSetImageBluePrimary() sets the image chromaticity blue primary point. |
| 9417 | % |
| 9418 | % The format of the MagickSetImageBluePrimary method is: |
| 9419 | % |
| 9420 | % MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand, |
| 9421 | % const double x,const double y) |
| 9422 | % |
| 9423 | % A description of each parameter follows: |
| 9424 | % |
| 9425 | % o wand: the magick wand. |
| 9426 | % |
| 9427 | % o x: the blue primary x-point. |
| 9428 | % |
| 9429 | % o y: the blue primary y-point. |
| 9430 | % |
| 9431 | */ |
| 9432 | WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand, |
| 9433 | const double x,const double y) |
| 9434 | { |
| 9435 | assert(wand != (MagickWand *) NULL); |
| 9436 | assert(wand->signature == WandSignature); |
| 9437 | if (wand->debug != MagickFalse) |
| 9438 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9439 | if (wand->images == (Image *) NULL) |
| 9440 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9441 | wand->images->chromaticity.blue_primary.x=x; |
| 9442 | wand->images->chromaticity.blue_primary.y=y; |
| 9443 | return(MagickTrue); |
| 9444 | } |
| 9445 | |
| 9446 | /* |
| 9447 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9448 | % % |
| 9449 | % % |
| 9450 | % % |
| 9451 | % M a g i c k S e t I m a g e B o r d e r C o l o r % |
| 9452 | % % |
| 9453 | % % |
| 9454 | % % |
| 9455 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9456 | % |
| 9457 | % MagickSetImageBorderColor() sets the image border color. |
| 9458 | % |
| 9459 | % The format of the MagickSetImageBorderColor method is: |
| 9460 | % |
| 9461 | % MagickBooleanType MagickSetImageBorderColor(MagickWand *wand, |
| 9462 | % const PixelWand *border) |
| 9463 | % |
| 9464 | % A description of each parameter follows: |
| 9465 | % |
| 9466 | % o wand: the magick wand. |
| 9467 | % |
| 9468 | % o border: the border pixel wand. |
| 9469 | % |
| 9470 | */ |
| 9471 | WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand, |
| 9472 | const PixelWand *border) |
| 9473 | { |
| 9474 | assert(wand != (MagickWand *) NULL); |
| 9475 | assert(wand->signature == WandSignature); |
| 9476 | if (wand->debug != MagickFalse) |
| 9477 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9478 | if (wand->images == (Image *) NULL) |
| 9479 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9480 | PixelGetQuantumColor(border,&wand->images->border_color); |
| 9481 | return(MagickTrue); |
| 9482 | } |
| 9483 | |
| 9484 | /* |
| 9485 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9486 | % % |
| 9487 | % % |
| 9488 | % % |
| 9489 | % M a g i c k S e t I m a g e C h a n n e l D e p t h % |
| 9490 | % % |
| 9491 | % % |
| 9492 | % % |
| 9493 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9494 | % |
| 9495 | % MagickSetImageChannelDepth() sets the depth of a particular image channel. |
| 9496 | % |
| 9497 | % The format of the MagickSetImageChannelDepth method is: |
| 9498 | % |
| 9499 | % MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9500 | % const ChannelType channel,const size_t depth) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9501 | % |
| 9502 | % A description of each parameter follows: |
| 9503 | % |
| 9504 | % o wand: the magick wand. |
| 9505 | % |
| 9506 | % o channel: the image channel(s). |
| 9507 | % |
| 9508 | % o depth: the image depth in bits. |
| 9509 | % |
| 9510 | */ |
| 9511 | WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9512 | const ChannelType channel,const size_t depth) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9513 | { |
| 9514 | assert(wand != (MagickWand *) NULL); |
| 9515 | assert(wand->signature == WandSignature); |
| 9516 | if (wand->debug != MagickFalse) |
| 9517 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9518 | if (wand->images == (Image *) NULL) |
| 9519 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9520 | return(SetImageChannelDepth(wand->images,channel,depth)); |
| 9521 | } |
| 9522 | |
| 9523 | /* |
| 9524 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9525 | % % |
| 9526 | % % |
| 9527 | % % |
| 9528 | % M a g i c k S e t I m a g e C l i p M a s k % |
| 9529 | % % |
| 9530 | % % |
| 9531 | % % |
| 9532 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9533 | % |
| 9534 | % MagickSetImageClipMask() sets image clip mask. |
| 9535 | % |
| 9536 | % The format of the MagickSetImageClipMask method is: |
| 9537 | % |
| 9538 | % MagickBooleanType MagickSetImageClipMask(MagickWand *wand, |
| 9539 | % const MagickWand *clip_mask) |
| 9540 | % |
| 9541 | % A description of each parameter follows: |
| 9542 | % |
| 9543 | % o wand: the magick wand. |
| 9544 | % |
| 9545 | % o clip_mask: the clip_mask wand. |
| 9546 | % |
| 9547 | */ |
| 9548 | WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand, |
| 9549 | const MagickWand *clip_mask) |
| 9550 | { |
| 9551 | assert(wand != (MagickWand *) NULL); |
| 9552 | assert(wand->signature == WandSignature); |
| 9553 | if (wand->debug != MagickFalse) |
| 9554 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9555 | assert(clip_mask != (MagickWand *) NULL); |
| 9556 | assert(clip_mask->signature == WandSignature); |
| 9557 | if (wand->debug != MagickFalse) |
| 9558 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name); |
| 9559 | if (clip_mask->images == (Image *) NULL) |
| 9560 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9561 | return(SetImageClipMask(wand->images,clip_mask->images)); |
| 9562 | } |
| 9563 | |
| 9564 | /* |
| 9565 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9566 | % % |
| 9567 | % % |
| 9568 | % % |
cristy | a5b77cb | 2010-05-07 19:34:48 +0000 | [diff] [blame] | 9569 | % M a g i c k S e t I m a g e C o l o r % |
| 9570 | % % |
| 9571 | % % |
| 9572 | % % |
| 9573 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9574 | % |
| 9575 | % MagickSetImageColor() set the entire wand canvas to the specified color. |
| 9576 | % |
| 9577 | % The format of the MagickSetImageColor method is: |
| 9578 | % |
| 9579 | % MagickBooleanType MagickSetImageColor(MagickWand *wand, |
| 9580 | % const PixelWand *color) |
| 9581 | % |
| 9582 | % A description of each parameter follows: |
| 9583 | % |
| 9584 | % o wand: the magick wand. |
| 9585 | % |
| 9586 | % o background: the image color. |
| 9587 | % |
| 9588 | */ |
| 9589 | WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand, |
| 9590 | const PixelWand *color) |
| 9591 | { |
| 9592 | MagickBooleanType |
| 9593 | status; |
| 9594 | |
| 9595 | MagickPixelPacket |
| 9596 | pixel; |
| 9597 | |
| 9598 | assert(wand != (MagickWand *) NULL); |
| 9599 | assert(wand->signature == WandSignature); |
| 9600 | if (wand->debug != MagickFalse) |
| 9601 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9602 | PixelGetMagickColor(color,&pixel); |
| 9603 | status=SetImageColor(wand->images,&pixel); |
| 9604 | if (status == MagickFalse) |
| 9605 | InheritException(wand->exception,&wand->images->exception); |
| 9606 | return(status); |
| 9607 | } |
| 9608 | |
| 9609 | /* |
| 9610 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9611 | % % |
| 9612 | % % |
| 9613 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9614 | % M a g i c k S e t I m a g e C o l o r m a p C o l o r % |
| 9615 | % % |
| 9616 | % % |
| 9617 | % % |
| 9618 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9619 | % |
| 9620 | % MagickSetImageColormapColor() sets the color of the specified colormap |
| 9621 | % index. |
| 9622 | % |
| 9623 | % The format of the MagickSetImageColormapColor method is: |
| 9624 | % |
| 9625 | % MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9626 | % const size_t index,const PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9627 | % |
| 9628 | % A description of each parameter follows: |
| 9629 | % |
| 9630 | % o wand: the magick wand. |
| 9631 | % |
| 9632 | % o index: the offset into the image colormap. |
| 9633 | % |
| 9634 | % o color: Return the colormap color in this wand. |
| 9635 | % |
| 9636 | */ |
| 9637 | WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9638 | const size_t index,const PixelWand *color) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9639 | { |
| 9640 | assert(wand != (MagickWand *) NULL); |
| 9641 | assert(wand->signature == WandSignature); |
| 9642 | if (wand->debug != MagickFalse) |
| 9643 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9644 | if (wand->images == (Image *) NULL) |
| 9645 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9646 | if ((wand->images->colormap == (PixelPacket *) NULL) || |
| 9647 | (index >= wand->images->colors)) |
| 9648 | ThrowWandException(WandError,"InvalidColormapIndex",wand->name); |
| 9649 | PixelGetQuantumColor(color,wand->images->colormap+index); |
| 9650 | return(SyncImage(wand->images)); |
| 9651 | } |
| 9652 | |
| 9653 | /* |
| 9654 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9655 | % % |
| 9656 | % % |
| 9657 | % % |
| 9658 | % M a g i c k S e t I m a g e C o l o r s p a c e % |
| 9659 | % % |
| 9660 | % % |
| 9661 | % % |
| 9662 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9663 | % |
| 9664 | % MagickSetImageColorspace() sets the image colorspace. |
| 9665 | % |
| 9666 | % The format of the MagickSetImageColorspace method is: |
| 9667 | % |
| 9668 | % MagickBooleanType MagickSetImageColorspace(MagickWand *wand, |
| 9669 | % const ColorspaceType colorspace) |
| 9670 | % |
| 9671 | % A description of each parameter follows: |
| 9672 | % |
| 9673 | % o wand: the magick wand. |
| 9674 | % |
| 9675 | % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace, |
| 9676 | % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, |
| 9677 | % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, |
| 9678 | % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, |
| 9679 | % HSLColorspace, or HWBColorspace. |
| 9680 | % |
| 9681 | */ |
| 9682 | WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand, |
| 9683 | const ColorspaceType colorspace) |
| 9684 | { |
| 9685 | assert(wand != (MagickWand *) NULL); |
| 9686 | assert(wand->signature == WandSignature); |
| 9687 | if (wand->debug != MagickFalse) |
| 9688 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9689 | if (wand->images == (Image *) NULL) |
| 9690 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9691 | return(SetImageColorspace(wand->images,colorspace)); |
| 9692 | } |
| 9693 | |
| 9694 | /* |
| 9695 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9696 | % % |
| 9697 | % % |
| 9698 | % % |
| 9699 | % M a g i c k S e t I m a g e C o m p o s e % |
| 9700 | % % |
| 9701 | % % |
| 9702 | % % |
| 9703 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9704 | % |
| 9705 | % MagickSetImageCompose() sets the image composite operator, useful for |
| 9706 | % specifying how to composite the image thumbnail when using the |
| 9707 | % MagickMontageImage() method. |
| 9708 | % |
| 9709 | % The format of the MagickSetImageCompose method is: |
| 9710 | % |
| 9711 | % MagickBooleanType MagickSetImageCompose(MagickWand *wand, |
| 9712 | % const CompositeOperator compose) |
| 9713 | % |
| 9714 | % A description of each parameter follows: |
| 9715 | % |
| 9716 | % o wand: the magick wand. |
| 9717 | % |
| 9718 | % o compose: the image composite operator. |
| 9719 | % |
| 9720 | */ |
| 9721 | WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand, |
| 9722 | const CompositeOperator compose) |
| 9723 | { |
| 9724 | assert(wand != (MagickWand *) NULL); |
| 9725 | assert(wand->signature == WandSignature); |
| 9726 | if (wand->debug != MagickFalse) |
| 9727 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9728 | if (wand->images == (Image *) NULL) |
| 9729 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9730 | wand->images->compose=compose; |
| 9731 | return(MagickTrue); |
| 9732 | } |
| 9733 | |
| 9734 | /* |
| 9735 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9736 | % % |
| 9737 | % % |
| 9738 | % % |
| 9739 | % M a g i c k S e t I m a g e C o m p r e s s i o n % |
| 9740 | % % |
| 9741 | % % |
| 9742 | % % |
| 9743 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9744 | % |
| 9745 | % MagickSetImageCompression() sets the image compression. |
| 9746 | % |
| 9747 | % The format of the MagickSetImageCompression method is: |
| 9748 | % |
| 9749 | % MagickBooleanType MagickSetImageCompression(MagickWand *wand, |
| 9750 | % const CompressionType compression) |
| 9751 | % |
| 9752 | % A description of each parameter follows: |
| 9753 | % |
| 9754 | % o wand: the magick wand. |
| 9755 | % |
| 9756 | % o compression: the image compression type. |
| 9757 | % |
| 9758 | */ |
| 9759 | WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand, |
| 9760 | const CompressionType compression) |
| 9761 | { |
| 9762 | assert(wand != (MagickWand *) NULL); |
| 9763 | assert(wand->signature == WandSignature); |
| 9764 | if (wand->debug != MagickFalse) |
| 9765 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9766 | if (wand->images == (Image *) NULL) |
| 9767 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9768 | wand->images->compression=compression; |
| 9769 | return(MagickTrue); |
| 9770 | } |
| 9771 | |
| 9772 | /* |
| 9773 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9774 | % % |
| 9775 | % % |
| 9776 | % % |
| 9777 | % M a g i c k S e t I m a g e C o m p r e s s i o n Q u a l i t y % |
| 9778 | % % |
| 9779 | % % |
| 9780 | % % |
| 9781 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9782 | % |
| 9783 | % MagickSetImageCompressionQuality() sets the image compression quality. |
| 9784 | % |
| 9785 | % The format of the MagickSetImageCompressionQuality method is: |
| 9786 | % |
| 9787 | % MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9788 | % const size_t quality) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9789 | % |
| 9790 | % A description of each parameter follows: |
| 9791 | % |
| 9792 | % o wand: the magick wand. |
| 9793 | % |
| 9794 | % o quality: the image compression tlityype. |
| 9795 | % |
| 9796 | */ |
| 9797 | WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9798 | const size_t quality) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9799 | { |
| 9800 | assert(wand != (MagickWand *) NULL); |
| 9801 | assert(wand->signature == WandSignature); |
| 9802 | if (wand->debug != MagickFalse) |
| 9803 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9804 | if (wand->images == (Image *) NULL) |
| 9805 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9806 | wand->images->quality=quality; |
| 9807 | return(MagickTrue); |
| 9808 | } |
| 9809 | |
| 9810 | /* |
| 9811 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9812 | % % |
| 9813 | % % |
| 9814 | % % |
| 9815 | % M a g i c k S e t I m a g e D e l a y % |
| 9816 | % % |
| 9817 | % % |
| 9818 | % % |
| 9819 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9820 | % |
| 9821 | % MagickSetImageDelay() sets the image delay. |
| 9822 | % |
| 9823 | % The format of the MagickSetImageDelay method is: |
| 9824 | % |
| 9825 | % MagickBooleanType MagickSetImageDelay(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9826 | % const size_t delay) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9827 | % |
| 9828 | % A description of each parameter follows: |
| 9829 | % |
| 9830 | % o wand: the magick wand. |
| 9831 | % |
| 9832 | % o delay: the image delay in ticks-per-second units. |
| 9833 | % |
| 9834 | */ |
| 9835 | WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9836 | const size_t delay) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9837 | { |
| 9838 | assert(wand != (MagickWand *) NULL); |
| 9839 | assert(wand->signature == WandSignature); |
| 9840 | if (wand->debug != MagickFalse) |
| 9841 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9842 | if (wand->images == (Image *) NULL) |
| 9843 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9844 | wand->images->delay=delay; |
| 9845 | return(MagickTrue); |
| 9846 | } |
| 9847 | |
| 9848 | /* |
| 9849 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9850 | % % |
| 9851 | % % |
| 9852 | % % |
| 9853 | % M a g i c k S e t I m a g e D e p t h % |
| 9854 | % % |
| 9855 | % % |
| 9856 | % % |
| 9857 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9858 | % |
| 9859 | % MagickSetImageDepth() sets the image depth. |
| 9860 | % |
| 9861 | % The format of the MagickSetImageDepth method is: |
| 9862 | % |
| 9863 | % MagickBooleanType MagickSetImageDepth(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9864 | % const size_t depth) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9865 | % |
| 9866 | % A description of each parameter follows: |
| 9867 | % |
| 9868 | % o wand: the magick wand. |
| 9869 | % |
| 9870 | % o depth: the image depth in bits: 8, 16, or 32. |
| 9871 | % |
| 9872 | */ |
| 9873 | WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9874 | const size_t depth) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9875 | { |
| 9876 | assert(wand != (MagickWand *) NULL); |
| 9877 | assert(wand->signature == WandSignature); |
| 9878 | if (wand->debug != MagickFalse) |
| 9879 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9880 | if (wand->images == (Image *) NULL) |
| 9881 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9882 | wand->images->depth=depth; |
| 9883 | return(MagickTrue); |
| 9884 | } |
| 9885 | |
| 9886 | /* |
| 9887 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9888 | % % |
| 9889 | % % |
| 9890 | % % |
| 9891 | % M a g i c k S e t I m a g e D i s p o s e % |
| 9892 | % % |
| 9893 | % % |
| 9894 | % % |
| 9895 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9896 | % |
| 9897 | % MagickSetImageDispose() sets the image disposal method. |
| 9898 | % |
| 9899 | % The format of the MagickSetImageDispose method is: |
| 9900 | % |
| 9901 | % MagickBooleanType MagickSetImageDispose(MagickWand *wand, |
| 9902 | % const DisposeType dispose) |
| 9903 | % |
| 9904 | % A description of each parameter follows: |
| 9905 | % |
| 9906 | % o wand: the magick wand. |
| 9907 | % |
| 9908 | % o dispose: the image disposeal type. |
| 9909 | % |
| 9910 | */ |
| 9911 | WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand, |
| 9912 | const DisposeType dispose) |
| 9913 | { |
| 9914 | assert(wand != (MagickWand *) NULL); |
| 9915 | assert(wand->signature == WandSignature); |
| 9916 | if (wand->debug != MagickFalse) |
| 9917 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9918 | if (wand->images == (Image *) NULL) |
| 9919 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9920 | wand->images->dispose=dispose; |
| 9921 | return(MagickTrue); |
| 9922 | } |
| 9923 | |
| 9924 | /* |
| 9925 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9926 | % % |
| 9927 | % % |
| 9928 | % % |
| 9929 | % M a g i c k S e t I m a g e E x t e n t % |
| 9930 | % % |
| 9931 | % % |
| 9932 | % % |
| 9933 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9934 | % |
| 9935 | % MagickSetImageExtent() sets the image size (i.e. columns & rows). |
| 9936 | % |
| 9937 | % The format of the MagickSetImageExtent method is: |
| 9938 | % |
| 9939 | % MagickBooleanType MagickSetImageExtent(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9940 | % const size_t columns,const unsigned rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9941 | % |
| 9942 | % A description of each parameter follows: |
| 9943 | % |
| 9944 | % o wand: the magick wand. |
| 9945 | % |
| 9946 | % o columns: The image width in pixels. |
| 9947 | % |
| 9948 | % o rows: The image height in pixels. |
| 9949 | % |
| 9950 | */ |
| 9951 | WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 9952 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 9953 | { |
| 9954 | assert(wand != (MagickWand *) NULL); |
| 9955 | assert(wand->signature == WandSignature); |
| 9956 | if (wand->debug != MagickFalse) |
| 9957 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9958 | if (wand->images == (Image *) NULL) |
| 9959 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9960 | return(SetImageExtent(wand->images,columns,rows)); |
| 9961 | } |
| 9962 | |
| 9963 | /* |
| 9964 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9965 | % % |
| 9966 | % % |
| 9967 | % % |
| 9968 | % M a g i c k S e t I m a g e F i l e n a m e % |
| 9969 | % % |
| 9970 | % % |
| 9971 | % % |
| 9972 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 9973 | % |
| 9974 | % MagickSetImageFilename() sets the filename of a particular image in a |
| 9975 | % sequence. |
| 9976 | % |
| 9977 | % The format of the MagickSetImageFilename method is: |
| 9978 | % |
| 9979 | % MagickBooleanType MagickSetImageFilename(MagickWand *wand, |
| 9980 | % const char *filename) |
| 9981 | % |
| 9982 | % A description of each parameter follows: |
| 9983 | % |
| 9984 | % o wand: the magick wand. |
| 9985 | % |
| 9986 | % o filename: the image filename. |
| 9987 | % |
| 9988 | */ |
| 9989 | WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand, |
| 9990 | const char *filename) |
| 9991 | { |
| 9992 | assert(wand != (MagickWand *) NULL); |
| 9993 | assert(wand->signature == WandSignature); |
| 9994 | if (wand->debug != MagickFalse) |
| 9995 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 9996 | if (wand->images == (Image *) NULL) |
| 9997 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 9998 | if (filename != (const char *) NULL) |
| 9999 | (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent); |
| 10000 | return(MagickTrue); |
| 10001 | } |
| 10002 | |
| 10003 | /* |
| 10004 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10005 | % % |
| 10006 | % % |
| 10007 | % % |
| 10008 | % M a g i c k S e t I m a g e F o r m a t % |
| 10009 | % % |
| 10010 | % % |
| 10011 | % % |
| 10012 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10013 | % |
| 10014 | % MagickSetImageFormat() sets the format of a particular image in a |
| 10015 | % sequence. |
| 10016 | % |
| 10017 | % The format of the MagickSetImageFormat method is: |
| 10018 | % |
| 10019 | % MagickBooleanType MagickSetImageFormat(MagickWand *wand, |
| 10020 | % const char *format) |
| 10021 | % |
| 10022 | % A description of each parameter follows: |
| 10023 | % |
| 10024 | % o wand: the magick wand. |
| 10025 | % |
| 10026 | % o format: the image format. |
| 10027 | % |
| 10028 | */ |
| 10029 | WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand, |
| 10030 | const char *format) |
| 10031 | { |
| 10032 | const MagickInfo |
| 10033 | *magick_info; |
| 10034 | |
| 10035 | assert(wand != (MagickWand *) NULL); |
| 10036 | assert(wand->signature == WandSignature); |
| 10037 | if (wand->debug != MagickFalse) |
| 10038 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10039 | if (wand->images == (Image *) NULL) |
| 10040 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10041 | if ((format == (char *) NULL) || (*format == '\0')) |
| 10042 | { |
| 10043 | *wand->images->magick='\0'; |
| 10044 | return(MagickTrue); |
| 10045 | } |
| 10046 | magick_info=GetMagickInfo(format,wand->exception); |
| 10047 | if (magick_info == (const MagickInfo *) NULL) |
| 10048 | return(MagickFalse); |
| 10049 | ClearMagickException(wand->exception); |
| 10050 | (void) CopyMagickString(wand->images->magick,format,MaxTextExtent); |
| 10051 | return(MagickTrue); |
| 10052 | } |
| 10053 | |
| 10054 | /* |
| 10055 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10056 | % % |
| 10057 | % % |
| 10058 | % % |
| 10059 | % M a g i c k S e t I m a g e F u z z % |
| 10060 | % % |
| 10061 | % % |
| 10062 | % % |
| 10063 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10064 | % |
| 10065 | % MagickSetImageFuzz() sets the image fuzz. |
| 10066 | % |
| 10067 | % The format of the MagickSetImageFuzz method is: |
| 10068 | % |
| 10069 | % MagickBooleanType MagickSetImageFuzz(MagickWand *wand, |
| 10070 | % const double fuzz) |
| 10071 | % |
| 10072 | % A description of each parameter follows: |
| 10073 | % |
| 10074 | % o wand: the magick wand. |
| 10075 | % |
| 10076 | % o fuzz: the image fuzz. |
| 10077 | % |
| 10078 | */ |
| 10079 | WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand, |
| 10080 | const double fuzz) |
| 10081 | { |
| 10082 | assert(wand != (MagickWand *) NULL); |
| 10083 | assert(wand->signature == WandSignature); |
| 10084 | if (wand->debug != MagickFalse) |
| 10085 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10086 | if (wand->images == (Image *) NULL) |
| 10087 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10088 | wand->images->fuzz=fuzz; |
| 10089 | return(MagickTrue); |
| 10090 | } |
| 10091 | |
| 10092 | /* |
| 10093 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10094 | % % |
| 10095 | % % |
| 10096 | % % |
| 10097 | % M a g i c k S e t I m a g e G a m m a % |
| 10098 | % % |
| 10099 | % % |
| 10100 | % % |
| 10101 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10102 | % |
| 10103 | % MagickSetImageGamma() sets the image gamma. |
| 10104 | % |
| 10105 | % The format of the MagickSetImageGamma method is: |
| 10106 | % |
| 10107 | % MagickBooleanType MagickSetImageGamma(MagickWand *wand, |
| 10108 | % const double gamma) |
| 10109 | % |
| 10110 | % A description of each parameter follows: |
| 10111 | % |
| 10112 | % o wand: the magick wand. |
| 10113 | % |
| 10114 | % o gamma: the image gamma. |
| 10115 | % |
| 10116 | */ |
| 10117 | WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand, |
| 10118 | const double gamma) |
| 10119 | { |
| 10120 | assert(wand != (MagickWand *) NULL); |
| 10121 | assert(wand->signature == WandSignature); |
| 10122 | if (wand->debug != MagickFalse) |
| 10123 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10124 | if (wand->images == (Image *) NULL) |
| 10125 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10126 | wand->images->gamma=gamma; |
| 10127 | return(MagickTrue); |
| 10128 | } |
| 10129 | |
| 10130 | /* |
| 10131 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10132 | % % |
| 10133 | % % |
| 10134 | % % |
| 10135 | % M a g i c k S e t I m a g e G r a v i t y % |
| 10136 | % % |
| 10137 | % % |
| 10138 | % % |
| 10139 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10140 | % |
| 10141 | % MagickSetImageGravity() sets the image gravity type. |
| 10142 | % |
| 10143 | % The format of the MagickSetImageGravity method is: |
| 10144 | % |
| 10145 | % MagickBooleanType MagickSetImageGravity(MagickWand *wand, |
| 10146 | % const GravityType gravity) |
| 10147 | % |
| 10148 | % A description of each parameter follows: |
| 10149 | % |
| 10150 | % o wand: the magick wand. |
| 10151 | % |
| 10152 | % o gravity: the image interlace scheme: NoInterlace, LineInterlace, |
| 10153 | % PlaneInterlace, PartitionInterlace. |
| 10154 | % |
| 10155 | */ |
| 10156 | WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand, |
| 10157 | const GravityType gravity) |
| 10158 | { |
| 10159 | assert(wand != (MagickWand *) NULL); |
| 10160 | assert(wand->signature == WandSignature); |
| 10161 | if (wand->debug != MagickFalse) |
| 10162 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10163 | if (wand->images == (Image *) NULL) |
| 10164 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10165 | wand->images->gravity=gravity; |
| 10166 | return(MagickTrue); |
| 10167 | } |
| 10168 | |
| 10169 | /* |
| 10170 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10171 | % % |
| 10172 | % % |
| 10173 | % % |
| 10174 | % M a g i c k S e t I m a g e G r e e n P r i m a r y % |
| 10175 | % % |
| 10176 | % % |
| 10177 | % % |
| 10178 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10179 | % |
| 10180 | % MagickSetImageGreenPrimary() sets the image chromaticity green primary |
| 10181 | % point. |
| 10182 | % |
| 10183 | % The format of the MagickSetImageGreenPrimary method is: |
| 10184 | % |
| 10185 | % MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand, |
| 10186 | % const double x,const double y) |
| 10187 | % |
| 10188 | % A description of each parameter follows: |
| 10189 | % |
| 10190 | % o wand: the magick wand. |
| 10191 | % |
| 10192 | % o x: the green primary x-point. |
| 10193 | % |
| 10194 | % o y: the green primary y-point. |
| 10195 | % |
| 10196 | % |
| 10197 | */ |
| 10198 | WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand, |
| 10199 | const double x,const double y) |
| 10200 | { |
| 10201 | assert(wand != (MagickWand *) NULL); |
| 10202 | assert(wand->signature == WandSignature); |
| 10203 | if (wand->debug != MagickFalse) |
| 10204 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10205 | if (wand->images == (Image *) NULL) |
| 10206 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10207 | wand->images->chromaticity.green_primary.x=x; |
| 10208 | wand->images->chromaticity.green_primary.y=y; |
| 10209 | return(MagickTrue); |
| 10210 | } |
| 10211 | |
| 10212 | /* |
| 10213 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10214 | % % |
| 10215 | % % |
| 10216 | % % |
| 10217 | % M a g i c k S e t I m a g e I n t e r l a c e S c h e m e % |
| 10218 | % % |
| 10219 | % % |
| 10220 | % % |
| 10221 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10222 | % |
| 10223 | % MagickSetImageInterlaceScheme() sets the image interlace scheme. |
| 10224 | % |
| 10225 | % The format of the MagickSetImageInterlaceScheme method is: |
| 10226 | % |
| 10227 | % MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand, |
| 10228 | % const InterlaceType interlace) |
| 10229 | % |
| 10230 | % A description of each parameter follows: |
| 10231 | % |
| 10232 | % o wand: the magick wand. |
| 10233 | % |
| 10234 | % o interlace: the image interlace scheme: NoInterlace, LineInterlace, |
| 10235 | % PlaneInterlace, PartitionInterlace. |
| 10236 | % |
| 10237 | */ |
| 10238 | WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand, |
| 10239 | const InterlaceType interlace) |
| 10240 | { |
| 10241 | assert(wand != (MagickWand *) NULL); |
| 10242 | assert(wand->signature == WandSignature); |
| 10243 | if (wand->debug != MagickFalse) |
| 10244 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10245 | if (wand->images == (Image *) NULL) |
| 10246 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10247 | wand->images->interlace=interlace; |
| 10248 | return(MagickTrue); |
| 10249 | } |
| 10250 | |
| 10251 | /* |
| 10252 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10253 | % % |
| 10254 | % % |
| 10255 | % % |
| 10256 | % M a g i c k S e t I m a g e I n t e r p o l a t e M e t h o d % |
| 10257 | % % |
| 10258 | % % |
| 10259 | % % |
| 10260 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10261 | % |
| 10262 | % MagickSetImageInterpolateMethod() sets the image interpolate pixel method. |
| 10263 | % |
| 10264 | % The format of the MagickSetImageInterpolateMethod method is: |
| 10265 | % |
| 10266 | % MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand, |
| 10267 | % const InterpolatePixelMethod method) |
| 10268 | % |
| 10269 | % A description of each parameter follows: |
| 10270 | % |
| 10271 | % o wand: the magick wand. |
| 10272 | % |
| 10273 | % o method: the image interpole pixel methods: choose from Undefined, |
| 10274 | % Average, Bicubic, Bilinear, Filter, Integer, Mesh, NearestNeighbor. |
| 10275 | % |
| 10276 | */ |
| 10277 | WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand, |
| 10278 | const InterpolatePixelMethod method) |
| 10279 | { |
| 10280 | assert(wand != (MagickWand *) NULL); |
| 10281 | assert(wand->signature == WandSignature); |
| 10282 | if (wand->debug != MagickFalse) |
| 10283 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10284 | if (wand->images == (Image *) NULL) |
| 10285 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10286 | wand->images->interpolate=method; |
| 10287 | return(MagickTrue); |
| 10288 | } |
| 10289 | |
| 10290 | /* |
| 10291 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10292 | % % |
| 10293 | % % |
| 10294 | % % |
| 10295 | % M a g i c k S e t I m a g e I t e r a t i o n s % |
| 10296 | % % |
| 10297 | % % |
| 10298 | % % |
| 10299 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10300 | % |
| 10301 | % MagickSetImageIterations() sets the image iterations. |
| 10302 | % |
| 10303 | % The format of the MagickSetImageIterations method is: |
| 10304 | % |
| 10305 | % MagickBooleanType MagickSetImageIterations(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10306 | % const size_t iterations) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10307 | % |
| 10308 | % A description of each parameter follows: |
| 10309 | % |
| 10310 | % o wand: the magick wand. |
| 10311 | % |
| 10312 | % o delay: the image delay in 1/100th of a second. |
| 10313 | % |
| 10314 | */ |
| 10315 | WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10316 | const size_t iterations) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10317 | { |
| 10318 | assert(wand != (MagickWand *) NULL); |
| 10319 | assert(wand->signature == WandSignature); |
| 10320 | if (wand->debug != MagickFalse) |
| 10321 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10322 | if (wand->images == (Image *) NULL) |
| 10323 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10324 | wand->images->iterations=iterations; |
| 10325 | return(MagickTrue); |
| 10326 | } |
| 10327 | |
| 10328 | /* |
| 10329 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10330 | % % |
| 10331 | % % |
| 10332 | % % |
| 10333 | % M a g i c k S e t I m a g e M a t t e % |
| 10334 | % % |
| 10335 | % % |
| 10336 | % % |
| 10337 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10338 | % |
| 10339 | % MagickSetImageMatte() sets the image matte channel. |
| 10340 | % |
| 10341 | % The format of the MagickSetImageMatteColor method is: |
| 10342 | % |
| 10343 | % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, |
| 10344 | % const MagickBooleanType *matte) |
| 10345 | % |
| 10346 | % A description of each parameter follows: |
| 10347 | % |
| 10348 | % o wand: the magick wand. |
| 10349 | % |
| 10350 | % o matte: Set to MagickTrue to enable the image matte channel otherwise |
| 10351 | % MagickFalse. |
| 10352 | % |
| 10353 | */ |
| 10354 | WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand, |
| 10355 | const MagickBooleanType matte) |
| 10356 | { |
| 10357 | assert(wand != (MagickWand *) NULL); |
| 10358 | assert(wand->signature == WandSignature); |
| 10359 | if (wand->debug != MagickFalse) |
| 10360 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10361 | if (wand->images == (Image *) NULL) |
| 10362 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10363 | if ((wand->images->matte == MagickFalse) && (matte != MagickFalse)) |
| 10364 | (void) SetImageOpacity(wand->images,OpaqueOpacity); |
| 10365 | wand->images->matte=matte; |
| 10366 | return(MagickTrue); |
| 10367 | } |
| 10368 | |
| 10369 | /* |
| 10370 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10371 | % % |
| 10372 | % % |
| 10373 | % % |
| 10374 | % M a g i c k S e t I m a g e M a t t e C o l o r % |
| 10375 | % % |
| 10376 | % % |
| 10377 | % % |
| 10378 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10379 | % |
| 10380 | % MagickSetImageMatteColor() sets the image matte color. |
| 10381 | % |
| 10382 | % The format of the MagickSetImageMatteColor method is: |
| 10383 | % |
| 10384 | % MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, |
| 10385 | % const PixelWand *matte) |
| 10386 | % |
| 10387 | % A description of each parameter follows: |
| 10388 | % |
| 10389 | % o wand: the magick wand. |
| 10390 | % |
| 10391 | % o matte: the matte pixel wand. |
| 10392 | % |
| 10393 | */ |
| 10394 | WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, |
| 10395 | const PixelWand *matte) |
| 10396 | { |
| 10397 | assert(wand != (MagickWand *) NULL); |
| 10398 | assert(wand->signature == WandSignature); |
| 10399 | if (wand->debug != MagickFalse) |
| 10400 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10401 | if (wand->images == (Image *) NULL) |
| 10402 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10403 | PixelGetQuantumColor(matte,&wand->images->matte_color); |
| 10404 | return(MagickTrue); |
| 10405 | } |
| 10406 | |
| 10407 | /* |
| 10408 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10409 | % % |
| 10410 | % % |
| 10411 | % % |
| 10412 | % M a g i c k S e t I m a g e O p a c i t y % |
| 10413 | % % |
| 10414 | % % |
| 10415 | % % |
| 10416 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10417 | % |
| 10418 | % MagickSetImageOpacity() sets the image to the specified opacity level. |
| 10419 | % |
| 10420 | % The format of the MagickSetImageOpacity method is: |
| 10421 | % |
| 10422 | % MagickBooleanType MagickSetImageOpacity(MagickWand *wand, |
| 10423 | % const double alpha) |
| 10424 | % |
| 10425 | % A description of each parameter follows: |
| 10426 | % |
| 10427 | % o wand: the magick wand. |
| 10428 | % |
| 10429 | % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully |
| 10430 | % transparent. |
| 10431 | % |
| 10432 | */ |
| 10433 | WandExport MagickBooleanType MagickSetImageOpacity(MagickWand *wand, |
| 10434 | const double alpha) |
| 10435 | { |
| 10436 | MagickBooleanType |
| 10437 | status; |
| 10438 | |
| 10439 | assert(wand != (MagickWand *) NULL); |
| 10440 | assert(wand->signature == WandSignature); |
| 10441 | if (wand->debug != MagickFalse) |
| 10442 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10443 | if (wand->images == (Image *) NULL) |
| 10444 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | ce70c17 | 2010-01-07 17:15:30 +0000 | [diff] [blame] | 10445 | status=SetImageOpacity(wand->images,ClampToQuantum((MagickRealType) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10446 | QuantumRange-QuantumRange*alpha)); |
| 10447 | if (status == MagickFalse) |
| 10448 | InheritException(wand->exception,&wand->images->exception); |
| 10449 | return(status); |
| 10450 | } |
| 10451 | |
| 10452 | /* |
| 10453 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10454 | % % |
| 10455 | % % |
| 10456 | % % |
| 10457 | % M a g i c k S e t I m a g e O r i e n t a t i o n % |
| 10458 | % % |
| 10459 | % % |
| 10460 | % % |
| 10461 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10462 | % |
| 10463 | % MagickSetImageOrientation() sets the image orientation. |
| 10464 | % |
| 10465 | % The format of the MagickSetImageOrientation method is: |
| 10466 | % |
| 10467 | % MagickBooleanType MagickSetImageOrientation(MagickWand *wand, |
| 10468 | % const OrientationType orientation) |
| 10469 | % |
| 10470 | % A description of each parameter follows: |
| 10471 | % |
| 10472 | % o wand: the magick wand. |
| 10473 | % |
| 10474 | % o orientation: the image orientation type. |
| 10475 | % |
| 10476 | */ |
| 10477 | WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand, |
| 10478 | const OrientationType orientation) |
| 10479 | { |
| 10480 | assert(wand != (MagickWand *) NULL); |
| 10481 | assert(wand->signature == WandSignature); |
| 10482 | if (wand->debug != MagickFalse) |
| 10483 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10484 | if (wand->images == (Image *) NULL) |
| 10485 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10486 | wand->images->orientation=orientation; |
| 10487 | return(MagickTrue); |
| 10488 | } |
| 10489 | |
| 10490 | /* |
| 10491 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10492 | % % |
| 10493 | % % |
| 10494 | % % |
| 10495 | % M a g i c k S e t I m a g e P a g e % |
| 10496 | % % |
| 10497 | % % |
| 10498 | % % |
| 10499 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10500 | % |
| 10501 | % MagickSetImagePage() sets the page geometry of the image. |
| 10502 | % |
| 10503 | % The format of the MagickSetImagePage method is: |
| 10504 | % |
| 10505 | % MagickBooleanType MagickSetImagePage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10506 | % const size_t width,const size_t height,const ssize_t x, |
| 10507 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10508 | % |
| 10509 | % A description of each parameter follows: |
| 10510 | % |
| 10511 | % o wand: the magick wand. |
| 10512 | % |
| 10513 | % o width: the page width. |
| 10514 | % |
| 10515 | % o height: the page height. |
| 10516 | % |
| 10517 | % o x: the page x-offset. |
| 10518 | % |
| 10519 | % o y: the page y-offset. |
| 10520 | % |
| 10521 | */ |
| 10522 | WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10523 | const size_t width,const size_t height,const ssize_t x, |
| 10524 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10525 | { |
| 10526 | assert(wand != (MagickWand *) NULL); |
| 10527 | assert(wand->signature == WandSignature); |
| 10528 | if (wand->debug != MagickFalse) |
| 10529 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10530 | if (wand->images == (Image *) NULL) |
| 10531 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10532 | wand->images->page.width=width; |
| 10533 | wand->images->page.height=height; |
| 10534 | wand->images->page.x=x; |
| 10535 | wand->images->page.y=y; |
| 10536 | return(MagickTrue); |
| 10537 | } |
| 10538 | |
| 10539 | /* |
| 10540 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10541 | % % |
| 10542 | % % |
| 10543 | % % |
| 10544 | % M a g i c k S e t I m a g e P r o g r e s s M o n i t o r % |
| 10545 | % % |
| 10546 | % % |
| 10547 | % % |
| 10548 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10549 | % |
| 10550 | % MagickSetImageProgressMonitor() sets the wand image progress monitor to the |
| 10551 | % specified method and returns the previous progress monitor if any. The |
| 10552 | % progress monitor method looks like this: |
| 10553 | % |
| 10554 | % MagickBooleanType MagickProgressMonitor(const char *text, |
| 10555 | % const MagickOffsetType offset,const MagickSizeType span, |
| 10556 | % void *client_data) |
| 10557 | % |
| 10558 | % If the progress monitor returns MagickFalse, the current operation is |
| 10559 | % interrupted. |
| 10560 | % |
| 10561 | % The format of the MagickSetImageProgressMonitor method is: |
| 10562 | % |
| 10563 | % MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand |
| 10564 | % const MagickProgressMonitor progress_monitor,void *client_data) |
| 10565 | % |
| 10566 | % A description of each parameter follows: |
| 10567 | % |
| 10568 | % o wand: the magick wand. |
| 10569 | % |
| 10570 | % o progress_monitor: Specifies a pointer to a method to monitor progress |
| 10571 | % of an image operation. |
| 10572 | % |
| 10573 | % o client_data: Specifies a pointer to any client data. |
| 10574 | % |
| 10575 | */ |
| 10576 | WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand, |
| 10577 | const MagickProgressMonitor progress_monitor,void *client_data) |
| 10578 | { |
| 10579 | MagickProgressMonitor |
| 10580 | previous_monitor; |
| 10581 | |
| 10582 | assert(wand != (MagickWand *) NULL); |
| 10583 | assert(wand->signature == WandSignature); |
| 10584 | if (wand->debug != MagickFalse) |
| 10585 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10586 | if (wand->images == (Image *) NULL) |
| 10587 | { |
| 10588 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 10589 | "ContainsNoImages","`%s'",wand->name); |
| 10590 | return((MagickProgressMonitor) NULL); |
| 10591 | } |
| 10592 | previous_monitor=SetImageProgressMonitor(wand->images, |
| 10593 | progress_monitor,client_data); |
| 10594 | return(previous_monitor); |
| 10595 | } |
| 10596 | |
| 10597 | /* |
| 10598 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10599 | % % |
| 10600 | % % |
| 10601 | % % |
| 10602 | % M a g i c k S e t I m a g e R e d P r i m a r y % |
| 10603 | % % |
| 10604 | % % |
| 10605 | % % |
| 10606 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10607 | % |
| 10608 | % MagickSetImageRedPrimary() sets the image chromaticity red primary point. |
| 10609 | % |
| 10610 | % The format of the MagickSetImageRedPrimary method is: |
| 10611 | % |
| 10612 | % MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand, |
| 10613 | % const double x,const double y) |
| 10614 | % |
| 10615 | % A description of each parameter follows: |
| 10616 | % |
| 10617 | % o wand: the magick wand. |
| 10618 | % |
| 10619 | % o x: the red primary x-point. |
| 10620 | % |
| 10621 | % o y: the red primary y-point. |
| 10622 | % |
| 10623 | */ |
| 10624 | WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand, |
| 10625 | const double x,const double y) |
| 10626 | { |
| 10627 | assert(wand != (MagickWand *) NULL); |
| 10628 | assert(wand->signature == WandSignature); |
| 10629 | if (wand->debug != MagickFalse) |
| 10630 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10631 | if (wand->images == (Image *) NULL) |
| 10632 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10633 | wand->images->chromaticity.red_primary.x=x; |
| 10634 | wand->images->chromaticity.red_primary.y=y; |
| 10635 | return(MagickTrue); |
| 10636 | } |
| 10637 | |
| 10638 | /* |
| 10639 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10640 | % % |
| 10641 | % % |
| 10642 | % % |
| 10643 | % M a g i c k S e t I m a g e R e n d e r i n g I n t e n t % |
| 10644 | % % |
| 10645 | % % |
| 10646 | % % |
| 10647 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10648 | % |
| 10649 | % MagickSetImageRenderingIntent() sets the image rendering intent. |
| 10650 | % |
| 10651 | % The format of the MagickSetImageRenderingIntent method is: |
| 10652 | % |
| 10653 | % MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand, |
| 10654 | % const RenderingIntent rendering_intent) |
| 10655 | % |
| 10656 | % A description of each parameter follows: |
| 10657 | % |
| 10658 | % o wand: the magick wand. |
| 10659 | % |
| 10660 | % o rendering_intent: the image rendering intent: UndefinedIntent, |
| 10661 | % SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent. |
| 10662 | % |
| 10663 | */ |
| 10664 | WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand, |
| 10665 | const RenderingIntent rendering_intent) |
| 10666 | { |
| 10667 | assert(wand != (MagickWand *) NULL); |
| 10668 | assert(wand->signature == WandSignature); |
| 10669 | if (wand->debug != MagickFalse) |
| 10670 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10671 | if (wand->images == (Image *) NULL) |
| 10672 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10673 | wand->images->rendering_intent=rendering_intent; |
| 10674 | return(MagickTrue); |
| 10675 | } |
| 10676 | |
| 10677 | /* |
| 10678 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10679 | % % |
| 10680 | % % |
| 10681 | % % |
| 10682 | % M a g i c k S e t I m a g e R e s o l u t i o n % |
| 10683 | % % |
| 10684 | % % |
| 10685 | % % |
| 10686 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10687 | % |
| 10688 | % MagickSetImageResolution() sets the image resolution. |
| 10689 | % |
| 10690 | % The format of the MagickSetImageResolution method is: |
| 10691 | % |
| 10692 | % MagickBooleanType MagickSetImageResolution(MagickWand *wand, |
| 10693 | % const double x_resolution,const doubtl y_resolution) |
| 10694 | % |
| 10695 | % A description of each parameter follows: |
| 10696 | % |
| 10697 | % o wand: the magick wand. |
| 10698 | % |
| 10699 | % o x_resolution: the image x resolution. |
| 10700 | % |
| 10701 | % o y_resolution: the image y resolution. |
| 10702 | % |
| 10703 | */ |
| 10704 | WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand, |
| 10705 | const double x_resolution,const double y_resolution) |
| 10706 | { |
| 10707 | assert(wand != (MagickWand *) NULL); |
| 10708 | assert(wand->signature == WandSignature); |
| 10709 | if (wand->debug != MagickFalse) |
| 10710 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10711 | if (wand->images == (Image *) NULL) |
| 10712 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10713 | wand->images->x_resolution=x_resolution; |
| 10714 | wand->images->y_resolution=y_resolution; |
| 10715 | return(MagickTrue); |
| 10716 | } |
| 10717 | |
| 10718 | /* |
| 10719 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10720 | % % |
| 10721 | % % |
| 10722 | % % |
| 10723 | % M a g i c k S e t I m a g e S c e n e % |
| 10724 | % % |
| 10725 | % % |
| 10726 | % % |
| 10727 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10728 | % |
| 10729 | % MagickSetImageScene() sets the image scene. |
| 10730 | % |
| 10731 | % The format of the MagickSetImageScene method is: |
| 10732 | % |
| 10733 | % MagickBooleanType MagickSetImageScene(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10734 | % const size_t scene) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10735 | % |
| 10736 | % A description of each parameter follows: |
| 10737 | % |
| 10738 | % o wand: the magick wand. |
| 10739 | % |
| 10740 | % o delay: the image scene number. |
| 10741 | % |
| 10742 | */ |
| 10743 | WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10744 | const size_t scene) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10745 | { |
| 10746 | assert(wand != (MagickWand *) NULL); |
| 10747 | assert(wand->signature == WandSignature); |
| 10748 | if (wand->debug != MagickFalse) |
| 10749 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10750 | if (wand->images == (Image *) NULL) |
| 10751 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10752 | wand->images->scene=scene; |
| 10753 | return(MagickTrue); |
| 10754 | } |
| 10755 | |
| 10756 | /* |
| 10757 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10758 | % % |
| 10759 | % % |
| 10760 | % % |
| 10761 | % M a g i c k S e t I m a g e T i c k s P e r S e c o n d % |
| 10762 | % % |
| 10763 | % % |
| 10764 | % % |
| 10765 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10766 | % |
| 10767 | % MagickSetImageTicksPerSecond() sets the image ticks-per-second. |
| 10768 | % |
| 10769 | % The format of the MagickSetImageTicksPerSecond method is: |
| 10770 | % |
| 10771 | % MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10772 | % const ssize_t ticks_per-second) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10773 | % |
| 10774 | % A description of each parameter follows: |
| 10775 | % |
| 10776 | % o wand: the magick wand. |
| 10777 | % |
| 10778 | % o ticks_per_second: the units to use for the image delay. |
| 10779 | % |
| 10780 | */ |
| 10781 | WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 10782 | const ssize_t ticks_per_second) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10783 | { |
| 10784 | assert(wand != (MagickWand *) NULL); |
| 10785 | assert(wand->signature == WandSignature); |
| 10786 | if (wand->debug != MagickFalse) |
| 10787 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10788 | if (wand->images == (Image *) NULL) |
| 10789 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10790 | wand->images->ticks_per_second=ticks_per_second; |
| 10791 | return(MagickTrue); |
| 10792 | } |
| 10793 | |
| 10794 | /* |
| 10795 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10796 | % % |
| 10797 | % % |
| 10798 | % % |
| 10799 | % M a g i c k S e t I m a g e T y p e % |
| 10800 | % % |
| 10801 | % % |
| 10802 | % % |
| 10803 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10804 | % |
| 10805 | % MagickSetImageType() sets the image type. |
| 10806 | % |
| 10807 | % The format of the MagickSetImageType method is: |
| 10808 | % |
| 10809 | % MagickBooleanType MagickSetImageType(MagickWand *wand, |
| 10810 | % const ImageType image_type) |
| 10811 | % |
| 10812 | % A description of each parameter follows: |
| 10813 | % |
| 10814 | % o wand: the magick wand. |
| 10815 | % |
cristy | 5f1c1ff | 2010-12-23 21:38:06 +0000 | [diff] [blame] | 10816 | % o image_type: the image type: UndefinedType, BilevelType, GrayscaleType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10817 | % GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, |
| 10818 | % TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, |
| 10819 | % or OptimizeType. |
| 10820 | % |
| 10821 | */ |
| 10822 | WandExport MagickBooleanType MagickSetImageType(MagickWand *wand, |
| 10823 | const ImageType image_type) |
| 10824 | { |
| 10825 | assert(wand != (MagickWand *) NULL); |
| 10826 | assert(wand->signature == WandSignature); |
| 10827 | if (wand->debug != MagickFalse) |
| 10828 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10829 | if (wand->images == (Image *) NULL) |
| 10830 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10831 | return(SetImageType(wand->images,image_type)); |
| 10832 | } |
| 10833 | |
| 10834 | /* |
| 10835 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10836 | % % |
| 10837 | % % |
| 10838 | % % |
| 10839 | % M a g i c k S e t I m a g e U n i t s % |
| 10840 | % % |
| 10841 | % % |
| 10842 | % % |
| 10843 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10844 | % |
| 10845 | % MagickSetImageUnits() sets the image units of resolution. |
| 10846 | % |
| 10847 | % The format of the MagickSetImageUnits method is: |
| 10848 | % |
| 10849 | % MagickBooleanType MagickSetImageUnits(MagickWand *wand, |
| 10850 | % const ResolutionType units) |
| 10851 | % |
| 10852 | % A description of each parameter follows: |
| 10853 | % |
| 10854 | % o wand: the magick wand. |
| 10855 | % |
| 10856 | % o units: the image units of resolution : UndefinedResolution, |
| 10857 | % PixelsPerInchResolution, or PixelsPerCentimeterResolution. |
| 10858 | % |
| 10859 | */ |
| 10860 | WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand, |
| 10861 | const ResolutionType units) |
| 10862 | { |
| 10863 | assert(wand != (MagickWand *) NULL); |
| 10864 | assert(wand->signature == WandSignature); |
| 10865 | if (wand->debug != MagickFalse) |
| 10866 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10867 | if (wand->images == (Image *) NULL) |
| 10868 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10869 | wand->images->units=units; |
| 10870 | return(MagickTrue); |
| 10871 | } |
| 10872 | |
| 10873 | /* |
| 10874 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10875 | % % |
| 10876 | % % |
| 10877 | % % |
| 10878 | % M a g i c k S e t I m a g e V i r t u a l P i x e l M e t h o d % |
| 10879 | % % |
| 10880 | % % |
| 10881 | % % |
| 10882 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10883 | % |
| 10884 | % MagickSetImageVirtualPixelMethod() sets the image virtual pixel method. |
| 10885 | % |
| 10886 | % The format of the MagickSetImageVirtualPixelMethod method is: |
| 10887 | % |
| 10888 | % VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand, |
| 10889 | % const VirtualPixelMethod method) |
| 10890 | % |
| 10891 | % A description of each parameter follows: |
| 10892 | % |
| 10893 | % o wand: the magick wand. |
| 10894 | % |
| 10895 | % o method: the image virtual pixel method : UndefinedVirtualPixelMethod, |
| 10896 | % ConstantVirtualPixelMethod, EdgeVirtualPixelMethod, |
| 10897 | % MirrorVirtualPixelMethod, or TileVirtualPixelMethod. |
| 10898 | % |
| 10899 | */ |
| 10900 | WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand, |
| 10901 | const VirtualPixelMethod method) |
| 10902 | { |
| 10903 | assert(wand != (MagickWand *) NULL); |
| 10904 | assert(wand->signature == WandSignature); |
| 10905 | if (wand->debug != MagickFalse) |
| 10906 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10907 | if (wand->images == (Image *) NULL) |
| 10908 | return(UndefinedVirtualPixelMethod); |
| 10909 | return(SetImageVirtualPixelMethod(wand->images,method)); |
| 10910 | } |
| 10911 | |
| 10912 | /* |
| 10913 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10914 | % % |
| 10915 | % % |
| 10916 | % % |
| 10917 | % M a g i c k S e t I m a g e W h i t e P o i n t % |
| 10918 | % % |
| 10919 | % % |
| 10920 | % % |
| 10921 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10922 | % |
| 10923 | % MagickSetImageWhitePoint() sets the image chromaticity white point. |
| 10924 | % |
| 10925 | % The format of the MagickSetImageWhitePoint method is: |
| 10926 | % |
| 10927 | % MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand, |
| 10928 | % const double x,const double y) |
| 10929 | % |
| 10930 | % A description of each parameter follows: |
| 10931 | % |
| 10932 | % o wand: the magick wand. |
| 10933 | % |
| 10934 | % o x: the white x-point. |
| 10935 | % |
| 10936 | % o y: the white y-point. |
| 10937 | % |
| 10938 | */ |
| 10939 | WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand, |
| 10940 | const double x,const double y) |
| 10941 | { |
| 10942 | assert(wand != (MagickWand *) NULL); |
| 10943 | assert(wand->signature == WandSignature); |
| 10944 | if (wand->debug != MagickFalse) |
| 10945 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10946 | if (wand->images == (Image *) NULL) |
| 10947 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10948 | wand->images->chromaticity.white_point.x=x; |
| 10949 | wand->images->chromaticity.white_point.y=y; |
| 10950 | return(MagickTrue); |
| 10951 | } |
| 10952 | |
| 10953 | /* |
| 10954 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10955 | % % |
| 10956 | % % |
| 10957 | % % |
| 10958 | % M a g i c k S h a d e I m a g e C h a n n e l % |
| 10959 | % % |
| 10960 | % % |
| 10961 | % % |
| 10962 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10963 | % |
| 10964 | % MagickShadeImage() shines a distant light on an image to create a |
| 10965 | % three-dimensional effect. You control the positioning of the light with |
| 10966 | % azimuth and elevation; azimuth is measured in degrees off the x axis |
| 10967 | % and elevation is measured in pixels above the Z axis. |
| 10968 | % |
| 10969 | % The format of the MagickShadeImage method is: |
| 10970 | % |
| 10971 | % MagickBooleanType MagickShadeImage(MagickWand *wand, |
| 10972 | % const MagickBooleanType gray,const double azimuth, |
| 10973 | % const double elevation) |
| 10974 | % |
| 10975 | % A description of each parameter follows: |
| 10976 | % |
| 10977 | % o wand: the magick wand. |
| 10978 | % |
| 10979 | % o gray: A value other than zero shades the intensity of each pixel. |
| 10980 | % |
| 10981 | % o azimuth, elevation: Define the light source direction. |
| 10982 | % |
| 10983 | */ |
| 10984 | WandExport MagickBooleanType MagickShadeImage(MagickWand *wand, |
| 10985 | const MagickBooleanType gray,const double asimuth,const double elevation) |
| 10986 | { |
| 10987 | Image |
| 10988 | *shade_image; |
| 10989 | |
| 10990 | assert(wand != (MagickWand *) NULL); |
| 10991 | assert(wand->signature == WandSignature); |
| 10992 | if (wand->debug != MagickFalse) |
| 10993 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 10994 | if (wand->images == (Image *) NULL) |
| 10995 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 10996 | shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception); |
| 10997 | if (shade_image == (Image *) NULL) |
| 10998 | return(MagickFalse); |
| 10999 | ReplaceImageInList(&wand->images,shade_image); |
| 11000 | return(MagickTrue); |
| 11001 | } |
| 11002 | |
| 11003 | /* |
| 11004 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11005 | % % |
| 11006 | % % |
| 11007 | % % |
| 11008 | % M a g i c k S h a d o w I m a g e % |
| 11009 | % % |
| 11010 | % % |
| 11011 | % % |
| 11012 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11013 | % |
| 11014 | % MagickShadowImage() simulates an image shadow. |
| 11015 | % |
| 11016 | % The format of the MagickShadowImage method is: |
| 11017 | % |
| 11018 | % MagickBooleanType MagickShadowImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11019 | % const double opacity,const double sigma,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11020 | % |
| 11021 | % A description of each parameter follows: |
| 11022 | % |
| 11023 | % o wand: the magick wand. |
| 11024 | % |
| 11025 | % o opacity: percentage transparency. |
| 11026 | % |
| 11027 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 11028 | % |
| 11029 | % o x: the shadow x-offset. |
| 11030 | % |
| 11031 | % o y: the shadow y-offset. |
| 11032 | % |
| 11033 | */ |
| 11034 | WandExport MagickBooleanType MagickShadowImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11035 | const double opacity,const double sigma,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11036 | { |
| 11037 | Image |
| 11038 | *shadow_image; |
| 11039 | |
| 11040 | assert(wand != (MagickWand *) NULL); |
| 11041 | assert(wand->signature == WandSignature); |
| 11042 | if (wand->debug != MagickFalse) |
| 11043 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11044 | if (wand->images == (Image *) NULL) |
| 11045 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11046 | shadow_image=ShadowImage(wand->images,opacity,sigma,x,y,wand->exception); |
| 11047 | if (shadow_image == (Image *) NULL) |
| 11048 | return(MagickFalse); |
| 11049 | ReplaceImageInList(&wand->images,shadow_image); |
| 11050 | return(MagickTrue); |
| 11051 | } |
| 11052 | |
| 11053 | /* |
| 11054 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11055 | % % |
| 11056 | % % |
| 11057 | % % |
| 11058 | % M a g i c k S h a r p e n I m a g e % |
| 11059 | % % |
| 11060 | % % |
| 11061 | % % |
| 11062 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11063 | % |
| 11064 | % MagickSharpenImage() sharpens an image. We convolve the image with a |
| 11065 | % Gaussian operator of the given radius and standard deviation (sigma). |
| 11066 | % For reasonable results, the radius should be larger than sigma. Use a |
| 11067 | % radius of 0 and MagickSharpenImage() selects a suitable radius for you. |
| 11068 | % |
| 11069 | % The format of the MagickSharpenImage method is: |
| 11070 | % |
| 11071 | % MagickBooleanType MagickSharpenImage(MagickWand *wand, |
| 11072 | % const double radius,const double sigma) |
| 11073 | % MagickBooleanType MagickSharpenImageChannel(MagickWand *wand, |
| 11074 | % const ChannelType channel,const double radius,const double sigma) |
| 11075 | % |
| 11076 | % A description of each parameter follows: |
| 11077 | % |
| 11078 | % o wand: the magick wand. |
| 11079 | % |
| 11080 | % o channel: the image channel(s). |
| 11081 | % |
| 11082 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 11083 | % pixel. |
| 11084 | % |
| 11085 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 11086 | % |
| 11087 | */ |
| 11088 | |
| 11089 | WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand, |
| 11090 | const double radius,const double sigma) |
| 11091 | { |
| 11092 | MagickBooleanType |
| 11093 | status; |
| 11094 | |
| 11095 | status=MagickSharpenImageChannel(wand,DefaultChannels,radius,sigma); |
| 11096 | return(status); |
| 11097 | } |
| 11098 | |
| 11099 | WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand, |
| 11100 | const ChannelType channel,const double radius,const double sigma) |
| 11101 | { |
| 11102 | Image |
| 11103 | *sharp_image; |
| 11104 | |
| 11105 | assert(wand != (MagickWand *) NULL); |
| 11106 | assert(wand->signature == WandSignature); |
| 11107 | if (wand->debug != MagickFalse) |
| 11108 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11109 | if (wand->images == (Image *) NULL) |
| 11110 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11111 | sharp_image=SharpenImageChannel(wand->images,channel,radius,sigma, |
| 11112 | wand->exception); |
| 11113 | if (sharp_image == (Image *) NULL) |
| 11114 | return(MagickFalse); |
| 11115 | ReplaceImageInList(&wand->images,sharp_image); |
| 11116 | return(MagickTrue); |
| 11117 | } |
| 11118 | |
| 11119 | /* |
| 11120 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11121 | % % |
| 11122 | % % |
| 11123 | % % |
| 11124 | % M a g i c k S h a v e I m a g e % |
| 11125 | % % |
| 11126 | % % |
| 11127 | % % |
| 11128 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11129 | % |
| 11130 | % MagickShaveImage() shaves pixels from the image edges. It allocates the |
| 11131 | % memory necessary for the new Image structure and returns a pointer to the |
| 11132 | % new image. |
| 11133 | % |
| 11134 | % The format of the MagickShaveImage method is: |
| 11135 | % |
| 11136 | % MagickBooleanType MagickShaveImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11137 | % const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11138 | % |
| 11139 | % A description of each parameter follows: |
| 11140 | % |
| 11141 | % o wand: the magick wand. |
| 11142 | % |
| 11143 | % o columns: the number of columns in the scaled image. |
| 11144 | % |
| 11145 | % o rows: the number of rows in the scaled image. |
| 11146 | % |
| 11147 | % |
| 11148 | */ |
| 11149 | WandExport MagickBooleanType MagickShaveImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11150 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11151 | { |
| 11152 | Image |
| 11153 | *shave_image; |
| 11154 | |
| 11155 | RectangleInfo |
| 11156 | shave_info; |
| 11157 | |
| 11158 | assert(wand != (MagickWand *) NULL); |
| 11159 | assert(wand->signature == WandSignature); |
| 11160 | if (wand->debug != MagickFalse) |
| 11161 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11162 | if (wand->images == (Image *) NULL) |
| 11163 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11164 | shave_info.width=columns; |
| 11165 | shave_info.height=rows; |
| 11166 | shave_info.x=0; |
| 11167 | shave_info.y=0; |
| 11168 | shave_image=ShaveImage(wand->images,&shave_info,wand->exception); |
| 11169 | if (shave_image == (Image *) NULL) |
| 11170 | return(MagickFalse); |
| 11171 | ReplaceImageInList(&wand->images,shave_image); |
| 11172 | return(MagickTrue); |
| 11173 | } |
| 11174 | |
| 11175 | /* |
| 11176 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11177 | % % |
| 11178 | % % |
| 11179 | % % |
| 11180 | % M a g i c k S h e a r I m a g e % |
| 11181 | % % |
| 11182 | % % |
| 11183 | % % |
| 11184 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11185 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 11186 | % MagickShearImage() slides one edge of an image along the X or Y axis, |
| 11187 | % creating a parallelogram. An X direction shear slides an edge along the X |
| 11188 | % axis, while a Y direction shear slides an edge along the Y axis. The amount |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11189 | % of the shear is controlled by a shear angle. For X direction shears, x_shear |
| 11190 | % is measured relative to the Y axis, and similarly, for Y direction shears |
| 11191 | % y_shear is measured relative to the X axis. Empty triangles left over from |
| 11192 | % shearing the image are filled with the background color. |
| 11193 | % |
| 11194 | % The format of the MagickShearImage method is: |
| 11195 | % |
| 11196 | % MagickBooleanType MagickShearImage(MagickWand *wand, |
| 11197 | % const PixelWand *background,const double x_shear,onst double y_shear) |
| 11198 | % |
| 11199 | % A description of each parameter follows: |
| 11200 | % |
| 11201 | % o wand: the magick wand. |
| 11202 | % |
| 11203 | % o background: the background pixel wand. |
| 11204 | % |
| 11205 | % o x_shear: the number of degrees to shear the image. |
| 11206 | % |
| 11207 | % o y_shear: the number of degrees to shear the image. |
| 11208 | % |
| 11209 | */ |
| 11210 | WandExport MagickBooleanType MagickShearImage(MagickWand *wand, |
| 11211 | const PixelWand *background,const double x_shear,const double y_shear) |
| 11212 | { |
| 11213 | Image |
| 11214 | *shear_image; |
| 11215 | |
| 11216 | assert(wand != (MagickWand *) NULL); |
| 11217 | assert(wand->signature == WandSignature); |
| 11218 | if (wand->debug != MagickFalse) |
| 11219 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11220 | if (wand->images == (Image *) NULL) |
| 11221 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11222 | PixelGetQuantumColor(background,&wand->images->background_color); |
| 11223 | shear_image=ShearImage(wand->images,x_shear,y_shear,wand->exception); |
| 11224 | if (shear_image == (Image *) NULL) |
| 11225 | return(MagickFalse); |
| 11226 | ReplaceImageInList(&wand->images,shear_image); |
| 11227 | return(MagickTrue); |
| 11228 | } |
| 11229 | |
| 11230 | /* |
| 11231 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11232 | % % |
| 11233 | % % |
| 11234 | % % |
| 11235 | % M a g i c k S i g m o i d a l C o n t r a s t I m a g e % |
| 11236 | % % |
| 11237 | % % |
| 11238 | % % |
| 11239 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11240 | % |
| 11241 | % MagickSigmoidalContrastImage() adjusts the contrast of an image with a |
| 11242 | % non-linear sigmoidal contrast algorithm. Increase the contrast of the |
| 11243 | % image using a sigmoidal transfer function without saturating highlights or |
| 11244 | % shadows. Contrast indicates how much to increase the contrast (0 is none; |
| 11245 | % 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in |
| 11246 | % the resultant image (0 is white; 50% is middle-gray; 100% is black). Set |
| 11247 | % sharpen to MagickTrue to increase the image contrast otherwise the contrast |
| 11248 | % is reduced. |
| 11249 | % |
| 11250 | % The format of the MagickSigmoidalContrastImage method is: |
| 11251 | % |
| 11252 | % MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand, |
| 11253 | % const MagickBooleanType sharpen,const double alpha,const double beta) |
| 11254 | % MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand, |
| 11255 | % const ChannelType channel,const MagickBooleanType sharpen, |
| 11256 | % const double alpha,const double beta) |
| 11257 | % |
| 11258 | % A description of each parameter follows: |
| 11259 | % |
| 11260 | % o wand: the magick wand. |
| 11261 | % |
| 11262 | % o channel: Identify which channel to level: RedChannel, GreenChannel, |
| 11263 | % |
| 11264 | % o sharpen: Increase or decrease image contrast. |
| 11265 | % |
cristy | fa76958 | 2010-09-30 23:30:03 +0000 | [diff] [blame] | 11266 | % o alpha: strength of the contrast, the larger the number the more |
| 11267 | % 'threshold-like' it becomes. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11268 | % |
cristy | fa76958 | 2010-09-30 23:30:03 +0000 | [diff] [blame] | 11269 | % o beta: midpoint of the function as a color value 0 to QuantumRange. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11270 | % |
| 11271 | */ |
| 11272 | |
| 11273 | WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand, |
| 11274 | const MagickBooleanType sharpen,const double alpha,const double beta) |
| 11275 | { |
| 11276 | MagickBooleanType |
| 11277 | status; |
| 11278 | |
| 11279 | status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen, |
| 11280 | alpha,beta); |
| 11281 | return(status); |
| 11282 | } |
| 11283 | |
| 11284 | WandExport MagickBooleanType MagickSigmoidalContrastImageChannel( |
| 11285 | MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen, |
| 11286 | const double alpha,const double beta) |
| 11287 | { |
| 11288 | MagickBooleanType |
| 11289 | status; |
| 11290 | |
| 11291 | assert(wand != (MagickWand *) NULL); |
| 11292 | assert(wand->signature == WandSignature); |
| 11293 | if (wand->debug != MagickFalse) |
| 11294 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11295 | if (wand->images == (Image *) NULL) |
| 11296 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11297 | status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta); |
| 11298 | if (status == MagickFalse) |
| 11299 | InheritException(wand->exception,&wand->images->exception); |
| 11300 | return(status); |
| 11301 | } |
| 11302 | |
| 11303 | /* |
| 11304 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11305 | % % |
| 11306 | % % |
| 11307 | % % |
| 11308 | % M a g i c k S i m i l a r i t y I m a g e % |
| 11309 | % % |
| 11310 | % % |
| 11311 | % % |
| 11312 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11313 | % |
| 11314 | % MagickSimilarityImage() compares the reference image of the image and |
| 11315 | % returns the best match offset. In addition, it returns a similarity image |
| 11316 | % such that an exact match location is completely white and if none of the |
| 11317 | % pixels match, black, otherwise some gray level in-between. |
| 11318 | % |
| 11319 | % The format of the MagickSimilarityImage method is: |
| 11320 | % |
| 11321 | % MagickWand *MagickSimilarityImage(MagickWand *wand, |
| 11322 | % const MagickWand *reference,RectangeInfo *offset,double *similarity) |
| 11323 | % |
| 11324 | % A description of each parameter follows: |
| 11325 | % |
| 11326 | % o wand: the magick wand. |
| 11327 | % |
| 11328 | % o reference: the reference wand. |
| 11329 | % |
| 11330 | % o offset: the best match offset of the reference image within the image. |
| 11331 | % |
| 11332 | % o similarity: the computed similarity between the images. |
| 11333 | % |
| 11334 | */ |
| 11335 | WandExport MagickWand *MagickSimilarityImage(MagickWand *wand, |
| 11336 | const MagickWand *reference,RectangleInfo *offset,double *similarity) |
| 11337 | { |
| 11338 | Image |
| 11339 | *similarity_image; |
| 11340 | |
| 11341 | assert(wand != (MagickWand *) NULL); |
| 11342 | assert(wand->signature == WandSignature); |
| 11343 | if (wand->debug != MagickFalse) |
| 11344 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11345 | if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) |
| 11346 | { |
| 11347 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 11348 | "ContainsNoImages","`%s'",wand->name); |
| 11349 | return((MagickWand *) NULL); |
| 11350 | } |
| 11351 | similarity_image=SimilarityImage(wand->images,reference->images,offset, |
| 11352 | similarity,&wand->images->exception); |
| 11353 | if (similarity_image == (Image *) NULL) |
| 11354 | return((MagickWand *) NULL); |
| 11355 | return(CloneMagickWandFromImages(wand,similarity_image)); |
| 11356 | } |
| 11357 | |
| 11358 | /* |
| 11359 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11360 | % % |
| 11361 | % % |
| 11362 | % % |
| 11363 | % M a g i c k S k e t c h I m a g e % |
| 11364 | % % |
| 11365 | % % |
| 11366 | % % |
| 11367 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11368 | % |
| 11369 | % MagickSketchImage() simulates a pencil sketch. We convolve the image with |
| 11370 | % a Gaussian operator of the given radius and standard deviation (sigma). |
| 11371 | % For reasonable results, radius should be larger than sigma. Use a |
| 11372 | % radius of 0 and SketchImage() selects a suitable radius for you. |
| 11373 | % Angle gives the angle of the blurring motion. |
| 11374 | % |
| 11375 | % The format of the MagickSketchImage method is: |
| 11376 | % |
| 11377 | % MagickBooleanType MagickSketchImage(MagickWand *wand, |
| 11378 | % const double radius,const double sigma,const double angle) |
| 11379 | % |
| 11380 | % A description of each parameter follows: |
| 11381 | % |
| 11382 | % o wand: the magick wand. |
| 11383 | % |
| 11384 | % o radius: the radius of the Gaussian, in pixels, not counting |
| 11385 | % the center pixel. |
| 11386 | % |
| 11387 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 11388 | % |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 11389 | % o angle: Apply the effect along this angle. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11390 | % |
| 11391 | */ |
| 11392 | WandExport MagickBooleanType MagickSketchImage(MagickWand *wand, |
| 11393 | const double radius,const double sigma,const double angle) |
| 11394 | { |
| 11395 | Image |
| 11396 | *sketch_image; |
| 11397 | |
| 11398 | assert(wand != (MagickWand *) NULL); |
| 11399 | assert(wand->signature == WandSignature); |
| 11400 | if (wand->debug != MagickFalse) |
| 11401 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11402 | if (wand->images == (Image *) NULL) |
| 11403 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11404 | sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception); |
| 11405 | if (sketch_image == (Image *) NULL) |
| 11406 | return(MagickFalse); |
| 11407 | ReplaceImageInList(&wand->images,sketch_image); |
| 11408 | return(MagickTrue); |
| 11409 | } |
| 11410 | |
| 11411 | /* |
| 11412 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11413 | % % |
| 11414 | % % |
| 11415 | % % |
cristy | 4285d78 | 2011-02-09 20:12:28 +0000 | [diff] [blame] | 11416 | % M a g i c k S m u s h I m a g e s % |
| 11417 | % % |
| 11418 | % % |
| 11419 | % % |
| 11420 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11421 | % |
| 11422 | % MagickSmushImages() takes all images from the current image pointer to the |
| 11423 | % end of the image list and smushs them to each other top-to-bottom if the |
| 11424 | % stack parameter is true, otherwise left-to-right. |
| 11425 | % |
| 11426 | % The format of the MagickSmushImages method is: |
| 11427 | % |
| 11428 | % MagickWand *MagickSmushImages(MagickWand *wand, |
| 11429 | % const MagickBooleanType stack,const ssize_t offset) |
| 11430 | % |
| 11431 | % A description of each parameter follows: |
| 11432 | % |
| 11433 | % o wand: the magick wand. |
| 11434 | % |
| 11435 | % o stack: By default, images are stacked left-to-right. Set stack to |
| 11436 | % MagickTrue to stack them top-to-bottom. |
| 11437 | % |
| 11438 | % o offset: minimum distance in pixels between images. |
| 11439 | % |
| 11440 | */ |
| 11441 | WandExport MagickWand *MagickSmushImages(MagickWand *wand, |
| 11442 | const MagickBooleanType stack,const ssize_t offset) |
| 11443 | { |
| 11444 | Image |
| 11445 | *smush_image; |
| 11446 | |
| 11447 | assert(wand != (MagickWand *) NULL); |
| 11448 | assert(wand->signature == WandSignature); |
| 11449 | if (wand->debug != MagickFalse) |
| 11450 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11451 | if (wand->images == (Image *) NULL) |
| 11452 | return((MagickWand *) NULL); |
| 11453 | smush_image=SmushImages(wand->images,stack,offset,wand->exception); |
| 11454 | if (smush_image == (Image *) NULL) |
| 11455 | return((MagickWand *) NULL); |
| 11456 | return(CloneMagickWandFromImages(wand,smush_image)); |
| 11457 | } |
| 11458 | |
| 11459 | /* |
| 11460 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11461 | % % |
| 11462 | % % |
| 11463 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11464 | % M a g i c k S o l a r i z e I m a g e % |
| 11465 | % % |
| 11466 | % % |
| 11467 | % % |
| 11468 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11469 | % |
| 11470 | % MagickSolarizeImage() applies a special effect to the image, similar to the |
| 11471 | % effect achieved in a photo darkroom by selectively exposing areas of photo |
| 11472 | % sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a |
| 11473 | % measure of the extent of the solarization. |
| 11474 | % |
| 11475 | % The format of the MagickSolarizeImage method is: |
| 11476 | % |
| 11477 | % MagickBooleanType MagickSolarizeImage(MagickWand *wand, |
| 11478 | % const double threshold) |
| 11479 | % |
| 11480 | % A description of each parameter follows: |
| 11481 | % |
| 11482 | % o wand: the magick wand. |
| 11483 | % |
| 11484 | % o threshold: Define the extent of the solarization. |
| 11485 | % |
| 11486 | */ |
| 11487 | WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand, |
| 11488 | const double threshold) |
| 11489 | { |
| 11490 | MagickBooleanType |
| 11491 | status; |
| 11492 | |
| 11493 | assert(wand != (MagickWand *) NULL); |
| 11494 | assert(wand->signature == WandSignature); |
| 11495 | if (wand->debug != MagickFalse) |
| 11496 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11497 | if (wand->images == (Image *) NULL) |
| 11498 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11499 | status=SolarizeImage(wand->images,threshold); |
| 11500 | if (status == MagickFalse) |
| 11501 | InheritException(wand->exception,&wand->images->exception); |
| 11502 | return(status); |
| 11503 | } |
| 11504 | |
| 11505 | /* |
| 11506 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11507 | % % |
| 11508 | % % |
| 11509 | % % |
| 11510 | % M a g i c k S p a r s e C o l o r I m a g e % |
| 11511 | % % |
| 11512 | % % |
| 11513 | % % |
| 11514 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11515 | % |
| 11516 | % MagickSparseColorImage(), given a set of coordinates, interpolates the |
| 11517 | % colors found at those coordinates, across the whole image, using various |
| 11518 | % methods. |
| 11519 | % |
| 11520 | % The format of the MagickSparseColorImage method is: |
| 11521 | % |
| 11522 | % MagickBooleanType MagickSparseColorImage(MagickWand *wand, |
| 11523 | % const ChannelType channel,const SparseColorMethod method, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11524 | % const size_t number_arguments,const double *arguments) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11525 | % |
| 11526 | % A description of each parameter follows: |
| 11527 | % |
| 11528 | % o image: the image to be sparseed. |
| 11529 | % |
| 11530 | % o method: the method of image sparseion. |
| 11531 | % |
| 11532 | % ArcSparseColorion will always ignore source image offset, and always |
| 11533 | % 'bestfit' the destination image with the top left corner offset |
| 11534 | % relative to the polar mapping center. |
| 11535 | % |
| 11536 | % Bilinear has no simple inverse mapping so will not allow 'bestfit' |
| 11537 | % style of image sparseion. |
| 11538 | % |
| 11539 | % Affine, Perspective, and Bilinear, will do least squares fitting of |
| 11540 | % the distrotion when more than the minimum number of control point |
| 11541 | % pairs are provided. |
| 11542 | % |
| 11543 | % Perspective, and Bilinear, will fall back to a Affine sparseion when |
| 11544 | % less than 4 control point pairs are provided. While Affine sparseions |
| 11545 | % will let you use any number of control point pairs, that is Zero pairs |
| 11546 | % is a No-Op (viewport only) distrotion, one pair is a translation and |
| 11547 | % two pairs of control points will do a scale-rotate-translate, without |
| 11548 | % any shearing. |
| 11549 | % |
| 11550 | % o number_arguments: the number of arguments given for this sparseion |
| 11551 | % method. |
| 11552 | % |
| 11553 | % o arguments: the arguments for this sparseion method. |
| 11554 | % |
| 11555 | */ |
| 11556 | WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand, |
| 11557 | const ChannelType channel,const SparseColorMethod method, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11558 | const size_t number_arguments,const double *arguments) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11559 | { |
| 11560 | Image |
| 11561 | *sparse_image; |
| 11562 | |
| 11563 | assert(wand != (MagickWand *) NULL); |
| 11564 | assert(wand->signature == WandSignature); |
| 11565 | if (wand->debug != MagickFalse) |
| 11566 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11567 | if (wand->images == (Image *) NULL) |
| 11568 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11569 | sparse_image=SparseColorImage(wand->images,channel,method,number_arguments, |
| 11570 | arguments,wand->exception); |
| 11571 | if (sparse_image == (Image *) NULL) |
| 11572 | return(MagickFalse); |
| 11573 | ReplaceImageInList(&wand->images,sparse_image); |
| 11574 | return(MagickTrue); |
| 11575 | } |
| 11576 | |
| 11577 | /* |
| 11578 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11579 | % % |
| 11580 | % % |
| 11581 | % % |
| 11582 | % M a g i c k S p l i c e I m a g e % |
| 11583 | % % |
| 11584 | % % |
| 11585 | % % |
| 11586 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11587 | % |
| 11588 | % MagickSpliceImage() splices a solid color into the image. |
| 11589 | % |
| 11590 | % The format of the MagickSpliceImage method is: |
| 11591 | % |
| 11592 | % MagickBooleanType MagickSpliceImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11593 | % const size_t width,const size_t height,const ssize_t x, |
| 11594 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11595 | % |
| 11596 | % A description of each parameter follows: |
| 11597 | % |
| 11598 | % o wand: the magick wand. |
| 11599 | % |
| 11600 | % o width: the region width. |
| 11601 | % |
| 11602 | % o height: the region height. |
| 11603 | % |
| 11604 | % o x: the region x offset. |
| 11605 | % |
| 11606 | % o y: the region y offset. |
| 11607 | % |
| 11608 | */ |
| 11609 | WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11610 | const size_t width,const size_t height,const ssize_t x, |
| 11611 | const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11612 | { |
| 11613 | Image |
| 11614 | *splice_image; |
| 11615 | |
| 11616 | RectangleInfo |
| 11617 | splice; |
| 11618 | |
| 11619 | assert(wand != (MagickWand *) NULL); |
| 11620 | assert(wand->signature == WandSignature); |
| 11621 | if (wand->debug != MagickFalse) |
| 11622 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11623 | if (wand->images == (Image *) NULL) |
| 11624 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11625 | splice.width=width; |
| 11626 | splice.height=height; |
| 11627 | splice.x=x; |
| 11628 | splice.y=y; |
| 11629 | splice_image=SpliceImage(wand->images,&splice,wand->exception); |
| 11630 | if (splice_image == (Image *) NULL) |
| 11631 | return(MagickFalse); |
| 11632 | ReplaceImageInList(&wand->images,splice_image); |
| 11633 | return(MagickTrue); |
| 11634 | } |
| 11635 | |
| 11636 | /* |
| 11637 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11638 | % % |
| 11639 | % % |
| 11640 | % % |
| 11641 | % M a g i c k S p r e a d I m a g e % |
| 11642 | % % |
| 11643 | % % |
| 11644 | % % |
| 11645 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11646 | % |
| 11647 | % MagickSpreadImage() is a special effects method that randomly displaces each |
| 11648 | % pixel in a block defined by the radius parameter. |
| 11649 | % |
| 11650 | % The format of the MagickSpreadImage method is: |
| 11651 | % |
| 11652 | % MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius) |
| 11653 | % |
| 11654 | % A description of each parameter follows: |
| 11655 | % |
| 11656 | % o wand: the magick wand. |
| 11657 | % |
| 11658 | % o radius: Choose a random pixel in a neighborhood of this extent. |
| 11659 | % |
| 11660 | */ |
| 11661 | WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand, |
| 11662 | const double radius) |
| 11663 | { |
| 11664 | Image |
| 11665 | *spread_image; |
| 11666 | |
| 11667 | assert(wand != (MagickWand *) NULL); |
| 11668 | assert(wand->signature == WandSignature); |
| 11669 | if (wand->debug != MagickFalse) |
| 11670 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11671 | if (wand->images == (Image *) NULL) |
| 11672 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11673 | spread_image=SpreadImage(wand->images,radius,wand->exception); |
| 11674 | if (spread_image == (Image *) NULL) |
| 11675 | return(MagickFalse); |
| 11676 | ReplaceImageInList(&wand->images,spread_image); |
| 11677 | return(MagickTrue); |
| 11678 | } |
| 11679 | |
| 11680 | /* |
| 11681 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11682 | % % |
| 11683 | % % |
| 11684 | % % |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11685 | % M a g i c k S t a t i s t i c I m a g e % |
| 11686 | % % |
| 11687 | % % |
| 11688 | % % |
| 11689 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11690 | % |
| 11691 | % MagickStatisticImage() replace each pixel with corresponding statistic from |
cristy | 8d75204 | 2011-03-19 01:00:36 +0000 | [diff] [blame] | 11692 | % the neighborhood of the specified width and height. |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11693 | % |
| 11694 | % The format of the MagickStatisticImage method is: |
| 11695 | % |
| 11696 | % MagickBooleanType MagickStatisticImage(MagickWand *wand, |
cristy | 95c3834 | 2011-03-18 22:39:51 +0000 | [diff] [blame] | 11697 | % const StatisticType type,const double width,const size_t height) |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11698 | % MagickBooleanType MagickStatisticImageChannel(MagickWand *wand, |
cristy | 95c3834 | 2011-03-18 22:39:51 +0000 | [diff] [blame] | 11699 | % const ChannelType channel,const StatisticType type,const double width, |
| 11700 | % const size_t height) |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11701 | % |
| 11702 | % A description of each parameter follows: |
| 11703 | % |
| 11704 | % o wand: the magick wand. |
| 11705 | % |
| 11706 | % o channel: the image channel(s). |
| 11707 | % |
| 11708 | % o type: the statistic type (e.g. median, mode, etc.). |
| 11709 | % |
cristy | 8d75204 | 2011-03-19 01:00:36 +0000 | [diff] [blame] | 11710 | % o width: the width of the pixel neighborhood. |
| 11711 | % |
| 11712 | % o height: the height of the pixel neighborhood. |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11713 | % |
| 11714 | */ |
| 11715 | WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand, |
cristy | 95c3834 | 2011-03-18 22:39:51 +0000 | [diff] [blame] | 11716 | const ChannelType channel,const StatisticType type,const size_t width, |
| 11717 | const size_t height) |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11718 | { |
| 11719 | Image |
| 11720 | *statistic_image; |
| 11721 | |
| 11722 | assert(wand != (MagickWand *) NULL); |
| 11723 | assert(wand->signature == WandSignature); |
| 11724 | if (wand->debug != MagickFalse) |
| 11725 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11726 | if (wand->images == (Image *) NULL) |
| 11727 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | 95c3834 | 2011-03-18 22:39:51 +0000 | [diff] [blame] | 11728 | statistic_image=StatisticImageChannel(wand->images,channel,type,width,height, |
cristy | 1245368 | 2011-03-18 18:45:04 +0000 | [diff] [blame] | 11729 | wand->exception); |
| 11730 | if (statistic_image == (Image *) NULL) |
| 11731 | return(MagickFalse); |
| 11732 | ReplaceImageInList(&wand->images,statistic_image); |
| 11733 | return(MagickTrue); |
| 11734 | } |
| 11735 | |
| 11736 | /* |
| 11737 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11738 | % % |
| 11739 | % % |
| 11740 | % % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11741 | % M a g i c k S t e g a n o I m a g e % |
| 11742 | % % |
| 11743 | % % |
| 11744 | % % |
| 11745 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11746 | % |
| 11747 | % MagickSteganoImage() hides a digital watermark within the image. |
| 11748 | % Recover the hidden watermark later to prove that the authenticity of |
| 11749 | % an image. Offset defines the start position within the image to hide |
| 11750 | % the watermark. |
| 11751 | % |
| 11752 | % The format of the MagickSteganoImage method is: |
| 11753 | % |
| 11754 | % MagickWand *MagickSteganoImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11755 | % const MagickWand *watermark_wand,const ssize_t offset) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11756 | % |
| 11757 | % A description of each parameter follows: |
| 11758 | % |
| 11759 | % o wand: the magick wand. |
| 11760 | % |
| 11761 | % o watermark_wand: the watermark wand. |
| 11762 | % |
| 11763 | % o offset: Start hiding at this offset into the image. |
| 11764 | % |
| 11765 | */ |
| 11766 | WandExport MagickWand *MagickSteganoImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 11767 | const MagickWand *watermark_wand,const ssize_t offset) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 11768 | { |
| 11769 | Image |
| 11770 | *stegano_image; |
| 11771 | |
| 11772 | assert(wand != (MagickWand *) NULL); |
| 11773 | assert(wand->signature == WandSignature); |
| 11774 | if (wand->debug != MagickFalse) |
| 11775 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11776 | if ((wand->images == (Image *) NULL) || |
| 11777 | (watermark_wand->images == (Image *) NULL)) |
| 11778 | { |
| 11779 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 11780 | "ContainsNoImages","`%s'",wand->name); |
| 11781 | return((MagickWand *) NULL); |
| 11782 | } |
| 11783 | wand->images->offset=offset; |
| 11784 | stegano_image=SteganoImage(wand->images,watermark_wand->images, |
| 11785 | wand->exception); |
| 11786 | if (stegano_image == (Image *) NULL) |
| 11787 | return((MagickWand *) NULL); |
| 11788 | return(CloneMagickWandFromImages(wand,stegano_image)); |
| 11789 | } |
| 11790 | |
| 11791 | /* |
| 11792 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11793 | % % |
| 11794 | % % |
| 11795 | % % |
| 11796 | % M a g i c k S t e r e o I m a g e % |
| 11797 | % % |
| 11798 | % % |
| 11799 | % % |
| 11800 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11801 | % |
| 11802 | % MagickStereoImage() composites two images and produces a single image that |
| 11803 | % is the composite of a left and right image of a stereo pair |
| 11804 | % |
| 11805 | % The format of the MagickStereoImage method is: |
| 11806 | % |
| 11807 | % MagickWand *MagickStereoImage(MagickWand *wand, |
| 11808 | % const MagickWand *offset_wand) |
| 11809 | % |
| 11810 | % A description of each parameter follows: |
| 11811 | % |
| 11812 | % o wand: the magick wand. |
| 11813 | % |
| 11814 | % o offset_wand: Another image wand. |
| 11815 | % |
| 11816 | */ |
| 11817 | WandExport MagickWand *MagickStereoImage(MagickWand *wand, |
| 11818 | const MagickWand *offset_wand) |
| 11819 | { |
| 11820 | Image |
| 11821 | *stereo_image; |
| 11822 | |
| 11823 | assert(wand != (MagickWand *) NULL); |
| 11824 | assert(wand->signature == WandSignature); |
| 11825 | if (wand->debug != MagickFalse) |
| 11826 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11827 | if ((wand->images == (Image *) NULL) || |
| 11828 | (offset_wand->images == (Image *) NULL)) |
| 11829 | { |
| 11830 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 11831 | "ContainsNoImages","`%s'",wand->name); |
| 11832 | return((MagickWand *) NULL); |
| 11833 | } |
| 11834 | stereo_image=StereoImage(wand->images,offset_wand->images,wand->exception); |
| 11835 | if (stereo_image == (Image *) NULL) |
| 11836 | return((MagickWand *) NULL); |
| 11837 | return(CloneMagickWandFromImages(wand,stereo_image)); |
| 11838 | } |
| 11839 | |
| 11840 | /* |
| 11841 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11842 | % % |
| 11843 | % % |
| 11844 | % % |
| 11845 | % M a g i c k S t r i p I m a g e % |
| 11846 | % % |
| 11847 | % % |
| 11848 | % % |
| 11849 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11850 | % |
| 11851 | % MagickStripImage() strips an image of all profiles and comments. |
| 11852 | % |
| 11853 | % The format of the MagickStripImage method is: |
| 11854 | % |
| 11855 | % MagickBooleanType MagickStripImage(MagickWand *wand) |
| 11856 | % |
| 11857 | % A description of each parameter follows: |
| 11858 | % |
| 11859 | % o wand: the magick wand. |
| 11860 | % |
| 11861 | */ |
| 11862 | WandExport MagickBooleanType MagickStripImage(MagickWand *wand) |
| 11863 | { |
| 11864 | MagickBooleanType |
| 11865 | status; |
| 11866 | |
| 11867 | assert(wand != (MagickWand *) NULL); |
| 11868 | assert(wand->signature == WandSignature); |
| 11869 | if (wand->debug != MagickFalse) |
| 11870 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11871 | if (wand->images == (Image *) NULL) |
| 11872 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11873 | status=StripImage(wand->images); |
| 11874 | if (status == MagickFalse) |
| 11875 | InheritException(wand->exception,&wand->images->exception); |
| 11876 | return(status); |
| 11877 | } |
| 11878 | |
| 11879 | /* |
| 11880 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11881 | % % |
| 11882 | % % |
| 11883 | % % |
| 11884 | % M a g i c k S w i r l I m a g e % |
| 11885 | % % |
| 11886 | % % |
| 11887 | % % |
| 11888 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11889 | % |
| 11890 | % MagickSwirlImage() swirls the pixels about the center of the image, where |
| 11891 | % degrees indicates the sweep of the arc through which each pixel is moved. |
| 11892 | % You get a more dramatic effect as the degrees move from 1 to 360. |
| 11893 | % |
| 11894 | % The format of the MagickSwirlImage method is: |
| 11895 | % |
| 11896 | % MagickBooleanType MagickSwirlImage(MagickWand *wand,const double degrees) |
| 11897 | % |
| 11898 | % A description of each parameter follows: |
| 11899 | % |
| 11900 | % o wand: the magick wand. |
| 11901 | % |
| 11902 | % o degrees: Define the tightness of the swirling effect. |
| 11903 | % |
| 11904 | */ |
| 11905 | WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand, |
| 11906 | const double degrees) |
| 11907 | { |
| 11908 | Image |
| 11909 | *swirl_image; |
| 11910 | |
| 11911 | assert(wand != (MagickWand *) NULL); |
| 11912 | assert(wand->signature == WandSignature); |
| 11913 | if (wand->debug != MagickFalse) |
| 11914 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11915 | if (wand->images == (Image *) NULL) |
| 11916 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 11917 | swirl_image=SwirlImage(wand->images,degrees,wand->exception); |
| 11918 | if (swirl_image == (Image *) NULL) |
| 11919 | return(MagickFalse); |
| 11920 | ReplaceImageInList(&wand->images,swirl_image); |
| 11921 | return(MagickTrue); |
| 11922 | } |
| 11923 | |
| 11924 | /* |
| 11925 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11926 | % % |
| 11927 | % % |
| 11928 | % % |
| 11929 | % M a g i c k T e x t u r e I m a g e % |
| 11930 | % % |
| 11931 | % % |
| 11932 | % % |
| 11933 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11934 | % |
| 11935 | % MagickTextureImage() repeatedly tiles the texture image across and down the |
| 11936 | % image canvas. |
| 11937 | % |
| 11938 | % The format of the MagickTextureImage method is: |
| 11939 | % |
| 11940 | % MagickWand *MagickTextureImage(MagickWand *wand, |
| 11941 | % const MagickWand *texture_wand) |
| 11942 | % |
| 11943 | % A description of each parameter follows: |
| 11944 | % |
| 11945 | % o wand: the magick wand. |
| 11946 | % |
| 11947 | % o texture_wand: the texture wand |
| 11948 | % |
| 11949 | */ |
| 11950 | WandExport MagickWand *MagickTextureImage(MagickWand *wand, |
| 11951 | const MagickWand *texture_wand) |
| 11952 | { |
| 11953 | Image |
| 11954 | *texture_image; |
| 11955 | |
| 11956 | MagickBooleanType |
| 11957 | status; |
| 11958 | |
| 11959 | assert(wand != (MagickWand *) NULL); |
| 11960 | assert(wand->signature == WandSignature); |
| 11961 | if (wand->debug != MagickFalse) |
| 11962 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 11963 | if ((wand->images == (Image *) NULL) || |
| 11964 | (texture_wand->images == (Image *) NULL)) |
| 11965 | { |
| 11966 | (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, |
| 11967 | "ContainsNoImages","`%s'",wand->name); |
| 11968 | return((MagickWand *) NULL); |
| 11969 | } |
| 11970 | texture_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 11971 | if (texture_image == (Image *) NULL) |
| 11972 | return((MagickWand *) NULL); |
| 11973 | status=TextureImage(texture_image,texture_wand->images); |
| 11974 | if (status == MagickFalse) |
| 11975 | { |
| 11976 | InheritException(wand->exception,&texture_image->exception); |
| 11977 | texture_image=DestroyImage(texture_image); |
| 11978 | return((MagickWand *) NULL); |
| 11979 | } |
| 11980 | return(CloneMagickWandFromImages(wand,texture_image)); |
| 11981 | } |
| 11982 | |
| 11983 | /* |
| 11984 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11985 | % % |
| 11986 | % % |
| 11987 | % % |
| 11988 | % M a g i c k T h r e s h o l d I m a g e % |
| 11989 | % % |
| 11990 | % % |
| 11991 | % % |
| 11992 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11993 | % |
| 11994 | % MagickThresholdImage() changes the value of individual pixels based on |
| 11995 | % the intensity of each pixel compared to threshold. The result is a |
| 11996 | % high-contrast, two color image. |
| 11997 | % |
| 11998 | % The format of the MagickThresholdImage method is: |
| 11999 | % |
| 12000 | % MagickBooleanType MagickThresholdImage(MagickWand *wand, |
| 12001 | % const double threshold) |
| 12002 | % MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, |
| 12003 | % const ChannelType channel,const double threshold) |
| 12004 | % |
| 12005 | % A description of each parameter follows: |
| 12006 | % |
| 12007 | % o wand: the magick wand. |
| 12008 | % |
| 12009 | % o channel: the image channel(s). |
| 12010 | % |
| 12011 | % o threshold: Define the threshold value. |
| 12012 | % |
| 12013 | */ |
| 12014 | WandExport MagickBooleanType MagickThresholdImage(MagickWand *wand, |
| 12015 | const double threshold) |
| 12016 | { |
| 12017 | MagickBooleanType |
| 12018 | status; |
| 12019 | |
| 12020 | status=MagickThresholdImageChannel(wand,DefaultChannels,threshold); |
| 12021 | return(status); |
| 12022 | } |
| 12023 | |
| 12024 | WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, |
| 12025 | const ChannelType channel,const double threshold) |
| 12026 | { |
| 12027 | MagickBooleanType |
| 12028 | status; |
| 12029 | |
| 12030 | assert(wand != (MagickWand *) NULL); |
| 12031 | assert(wand->signature == WandSignature); |
| 12032 | if (wand->debug != MagickFalse) |
| 12033 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12034 | if (wand->images == (Image *) NULL) |
| 12035 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12036 | status=BilevelImageChannel(wand->images,channel,threshold); |
| 12037 | if (status == MagickFalse) |
| 12038 | InheritException(wand->exception,&wand->images->exception); |
| 12039 | return(status); |
| 12040 | } |
| 12041 | |
| 12042 | /* |
| 12043 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12044 | % % |
| 12045 | % % |
| 12046 | % % |
| 12047 | % M a g i c k T h u m b n a i l I m a g e % |
| 12048 | % % |
| 12049 | % % |
| 12050 | % % |
| 12051 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12052 | % |
| 12053 | % MagickThumbnailImage() changes the size of an image to the given dimensions |
| 12054 | % and removes any associated profiles. The goal is to produce small low cost |
| 12055 | % thumbnail images suited for display on the Web. |
| 12056 | % |
| 12057 | % The format of the MagickThumbnailImage method is: |
| 12058 | % |
| 12059 | % MagickBooleanType MagickThumbnailImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 12060 | % const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12061 | % |
| 12062 | % A description of each parameter follows: |
| 12063 | % |
| 12064 | % o wand: the magick wand. |
| 12065 | % |
| 12066 | % o columns: the number of columns in the scaled image. |
| 12067 | % |
| 12068 | % o rows: the number of rows in the scaled image. |
| 12069 | % |
| 12070 | */ |
| 12071 | WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 12072 | const size_t columns,const size_t rows) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12073 | { |
| 12074 | Image |
| 12075 | *thumbnail_image; |
| 12076 | |
| 12077 | assert(wand != (MagickWand *) NULL); |
| 12078 | assert(wand->signature == WandSignature); |
| 12079 | if (wand->debug != MagickFalse) |
| 12080 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12081 | if (wand->images == (Image *) NULL) |
| 12082 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12083 | thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception); |
| 12084 | if (thumbnail_image == (Image *) NULL) |
| 12085 | return(MagickFalse); |
| 12086 | ReplaceImageInList(&wand->images,thumbnail_image); |
| 12087 | return(MagickTrue); |
| 12088 | } |
| 12089 | |
| 12090 | /* |
| 12091 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12092 | % % |
| 12093 | % % |
| 12094 | % % |
| 12095 | % M a g i c k T i n t I m a g e % |
| 12096 | % % |
| 12097 | % % |
| 12098 | % % |
| 12099 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12100 | % |
| 12101 | % MagickTintImage() applies a color vector to each pixel in the image. The |
| 12102 | % length of the vector is 0 for black and white and at its maximum for the |
| 12103 | % midtones. The vector weighting function is |
| 12104 | % f(x)=(1-(4.0*((x-0.5)*(x-0.5)))). |
| 12105 | % |
| 12106 | % The format of the MagickTintImage method is: |
| 12107 | % |
| 12108 | % MagickBooleanType MagickTintImage(MagickWand *wand, |
| 12109 | % const PixelWand *tint,const PixelWand *opacity) |
| 12110 | % |
| 12111 | % A description of each parameter follows: |
| 12112 | % |
| 12113 | % o wand: the magick wand. |
| 12114 | % |
| 12115 | % o tint: the tint pixel wand. |
| 12116 | % |
| 12117 | % o opacity: the opacity pixel wand. |
| 12118 | % |
| 12119 | */ |
| 12120 | WandExport MagickBooleanType MagickTintImage(MagickWand *wand, |
| 12121 | const PixelWand *tint,const PixelWand *opacity) |
| 12122 | { |
| 12123 | char |
| 12124 | percent_opaque[MaxTextExtent]; |
| 12125 | |
| 12126 | Image |
| 12127 | *tint_image; |
| 12128 | |
| 12129 | PixelPacket |
| 12130 | target; |
| 12131 | |
| 12132 | assert(wand != (MagickWand *) NULL); |
| 12133 | assert(wand->signature == WandSignature); |
| 12134 | if (wand->debug != MagickFalse) |
| 12135 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12136 | if (wand->images == (Image *) NULL) |
| 12137 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 12138 | (void) FormatLocaleString(percent_opaque,MaxTextExtent, |
cristy | e7f5109 | 2010-01-17 00:39:37 +0000 | [diff] [blame] | 12139 | "%g,%g,%g,%g",(double) (100.0*QuantumScale* |
cristy | 8cd5b31 | 2010-01-07 01:10:24 +0000 | [diff] [blame] | 12140 | PixelGetRedQuantum(opacity)),(double) (100.0*QuantumScale* |
| 12141 | PixelGetGreenQuantum(opacity)),(double) (100.0*QuantumScale* |
| 12142 | PixelGetBlueQuantum(opacity)),(double) (100.0*QuantumScale* |
| 12143 | PixelGetOpacityQuantum(opacity))); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12144 | PixelGetQuantumColor(tint,&target); |
| 12145 | tint_image=TintImage(wand->images,percent_opaque,target,wand->exception); |
| 12146 | if (tint_image == (Image *) NULL) |
| 12147 | return(MagickFalse); |
| 12148 | ReplaceImageInList(&wand->images,tint_image); |
| 12149 | return(MagickTrue); |
| 12150 | } |
| 12151 | |
| 12152 | /* |
| 12153 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12154 | % % |
| 12155 | % % |
| 12156 | % % |
| 12157 | % M a g i c k T r a n s f o r m I m a g e % |
| 12158 | % % |
| 12159 | % % |
| 12160 | % % |
| 12161 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12162 | % |
| 12163 | % MagickTransformImage() is a convenience method that behaves like |
| 12164 | % MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping |
| 12165 | % information as a region geometry specification. If the operation fails, |
| 12166 | % a NULL image handle is returned. |
| 12167 | % |
| 12168 | % The format of the MagickTransformImage method is: |
| 12169 | % |
| 12170 | % MagickWand *MagickTransformImage(MagickWand *wand,const char *crop, |
| 12171 | % const char *geometry) |
| 12172 | % |
| 12173 | % A description of each parameter follows: |
| 12174 | % |
| 12175 | % o wand: the magick wand. |
| 12176 | % |
| 12177 | % o crop: A crop geometry string. This geometry defines a subregion of the |
| 12178 | % image to crop. |
| 12179 | % |
| 12180 | % o geometry: An image geometry string. This geometry defines the final |
| 12181 | % size of the image. |
| 12182 | % |
| 12183 | */ |
| 12184 | WandExport MagickWand *MagickTransformImage(MagickWand *wand, |
| 12185 | const char *crop,const char *geometry) |
| 12186 | { |
| 12187 | Image |
| 12188 | *transform_image; |
| 12189 | |
| 12190 | MagickBooleanType |
| 12191 | status; |
| 12192 | |
| 12193 | assert(wand != (MagickWand *) NULL); |
| 12194 | assert(wand->signature == WandSignature); |
| 12195 | if (wand->debug != MagickFalse) |
| 12196 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12197 | if (wand->images == (Image *) NULL) |
| 12198 | return((MagickWand *) NULL); |
| 12199 | transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 12200 | if (transform_image == (Image *) NULL) |
| 12201 | return((MagickWand *) NULL); |
| 12202 | status=TransformImage(&transform_image,crop,geometry); |
| 12203 | if (status == MagickFalse) |
| 12204 | { |
| 12205 | InheritException(wand->exception,&transform_image->exception); |
| 12206 | transform_image=DestroyImage(transform_image); |
| 12207 | return((MagickWand *) NULL); |
| 12208 | } |
| 12209 | return(CloneMagickWandFromImages(wand,transform_image)); |
| 12210 | } |
| 12211 | |
| 12212 | /* |
| 12213 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12214 | % % |
| 12215 | % % |
| 12216 | % % |
| 12217 | % M a g i c k T r a n s f o r m I m a g e C o l o r s p a c e % |
| 12218 | % % |
| 12219 | % % |
| 12220 | % % |
| 12221 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12222 | % |
| 12223 | % MagickTransformImageColorspace() transform the image colorspace. |
| 12224 | % |
| 12225 | % The format of the MagickTransformImageColorspace method is: |
| 12226 | % |
| 12227 | % MagickBooleanType MagickTransformImageColorspace(MagickWand *wand, |
| 12228 | % const ColorspaceType colorspace) |
| 12229 | % |
| 12230 | % A description of each parameter follows: |
| 12231 | % |
| 12232 | % o wand: the magick wand. |
| 12233 | % |
| 12234 | % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace, |
| 12235 | % GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, |
| 12236 | % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, |
| 12237 | % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, |
| 12238 | % HSLColorspace, or HWBColorspace. |
| 12239 | % |
| 12240 | */ |
| 12241 | WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand, |
| 12242 | const ColorspaceType colorspace) |
| 12243 | { |
| 12244 | assert(wand != (MagickWand *) NULL); |
| 12245 | assert(wand->signature == WandSignature); |
| 12246 | if (wand->debug != MagickFalse) |
| 12247 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12248 | if (wand->images == (Image *) NULL) |
| 12249 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12250 | return(TransformImageColorspace(wand->images,colorspace)); |
| 12251 | } |
| 12252 | |
| 12253 | /* |
| 12254 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12255 | % % |
| 12256 | % % |
| 12257 | % % |
| 12258 | % M a g i c k T r a n s p a r e n t P a i n t I m a g e % |
| 12259 | % % |
| 12260 | % % |
| 12261 | % % |
| 12262 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12263 | % |
| 12264 | % MagickTransparentPaintImage() changes any pixel that matches color with the |
| 12265 | % color defined by fill. |
| 12266 | % |
| 12267 | % The format of the MagickTransparentPaintImage method is: |
| 12268 | % |
| 12269 | % MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, |
| 12270 | % const PixelWand *target,const double alpha,const double fuzz, |
| 12271 | % const MagickBooleanType invert) |
| 12272 | % |
| 12273 | % A description of each parameter follows: |
| 12274 | % |
| 12275 | % o wand: the magick wand. |
| 12276 | % |
| 12277 | % o target: Change this target color to specified opacity value within |
| 12278 | % the image. |
| 12279 | % |
| 12280 | % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully |
| 12281 | % transparent. |
| 12282 | % |
| 12283 | % o fuzz: By default target must match a particular pixel color |
| 12284 | % exactly. However, in many cases two colors may differ by a small amount. |
| 12285 | % The fuzz member of image defines how much tolerance is acceptable to |
| 12286 | % consider two colors as the same. For example, set fuzz to 10 and the |
| 12287 | % color red at intensities of 100 and 102 respectively are now interpreted |
| 12288 | % as the same color for the purposes of the floodfill. |
| 12289 | % |
| 12290 | % o invert: paint any pixel that does not match the target color. |
| 12291 | % |
| 12292 | */ |
| 12293 | WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, |
| 12294 | const PixelWand *target,const double alpha,const double fuzz, |
| 12295 | const MagickBooleanType invert) |
| 12296 | { |
| 12297 | MagickBooleanType |
| 12298 | status; |
| 12299 | |
| 12300 | MagickPixelPacket |
| 12301 | target_pixel; |
| 12302 | |
| 12303 | assert(wand != (MagickWand *) NULL); |
| 12304 | assert(wand->signature == WandSignature); |
| 12305 | if (wand->debug != MagickFalse) |
| 12306 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12307 | if (wand->images == (Image *) NULL) |
| 12308 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12309 | PixelGetMagickColor(target,&target_pixel); |
| 12310 | wand->images->fuzz=fuzz; |
cristy | ce70c17 | 2010-01-07 17:15:30 +0000 | [diff] [blame] | 12311 | status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum( |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12312 | (MagickRealType) QuantumRange-QuantumRange*alpha),invert); |
| 12313 | if (status == MagickFalse) |
| 12314 | InheritException(wand->exception,&wand->images->exception); |
| 12315 | return(status); |
| 12316 | } |
| 12317 | |
| 12318 | /* |
| 12319 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12320 | % % |
| 12321 | % % |
| 12322 | % % |
| 12323 | % M a g i c k T r a n s p o s e I m a g e % |
| 12324 | % % |
| 12325 | % % |
| 12326 | % % |
| 12327 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12328 | % |
| 12329 | % MagickTransposeImage() creates a vertical mirror image by reflecting the |
| 12330 | % pixels around the central x-axis while rotating them 90-degrees. |
| 12331 | % |
| 12332 | % The format of the MagickTransposeImage method is: |
| 12333 | % |
| 12334 | % MagickBooleanType MagickTransposeImage(MagickWand *wand) |
| 12335 | % |
| 12336 | % A description of each parameter follows: |
| 12337 | % |
| 12338 | % o wand: the magick wand. |
| 12339 | % |
| 12340 | */ |
| 12341 | WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand) |
| 12342 | { |
| 12343 | Image |
| 12344 | *transpose_image; |
| 12345 | |
| 12346 | assert(wand != (MagickWand *) NULL); |
| 12347 | assert(wand->signature == WandSignature); |
| 12348 | if (wand->debug != MagickFalse) |
| 12349 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12350 | if (wand->images == (Image *) NULL) |
| 12351 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12352 | transpose_image=TransposeImage(wand->images,wand->exception); |
| 12353 | if (transpose_image == (Image *) NULL) |
| 12354 | return(MagickFalse); |
| 12355 | ReplaceImageInList(&wand->images,transpose_image); |
| 12356 | return(MagickTrue); |
| 12357 | } |
| 12358 | |
| 12359 | /* |
| 12360 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12361 | % % |
| 12362 | % % |
| 12363 | % % |
| 12364 | % M a g i c k T r a n s v e r s e I m a g e % |
| 12365 | % % |
| 12366 | % % |
| 12367 | % % |
| 12368 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12369 | % |
| 12370 | % MagickTransverseImage() creates a horizontal mirror image by reflecting the |
| 12371 | % pixels around the central y-axis while rotating them 270-degrees. |
| 12372 | % |
| 12373 | % The format of the MagickTransverseImage method is: |
| 12374 | % |
| 12375 | % MagickBooleanType MagickTransverseImage(MagickWand *wand) |
| 12376 | % |
| 12377 | % A description of each parameter follows: |
| 12378 | % |
| 12379 | % o wand: the magick wand. |
| 12380 | % |
| 12381 | */ |
| 12382 | WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand) |
| 12383 | { |
| 12384 | Image |
| 12385 | *transverse_image; |
| 12386 | |
| 12387 | assert(wand != (MagickWand *) NULL); |
| 12388 | assert(wand->signature == WandSignature); |
| 12389 | if (wand->debug != MagickFalse) |
| 12390 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12391 | if (wand->images == (Image *) NULL) |
| 12392 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12393 | transverse_image=TransverseImage(wand->images,wand->exception); |
| 12394 | if (transverse_image == (Image *) NULL) |
| 12395 | return(MagickFalse); |
| 12396 | ReplaceImageInList(&wand->images,transverse_image); |
| 12397 | return(MagickTrue); |
| 12398 | } |
| 12399 | |
| 12400 | /* |
| 12401 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12402 | % % |
| 12403 | % % |
| 12404 | % % |
| 12405 | % M a g i c k T r i m I m a g e % |
| 12406 | % % |
| 12407 | % % |
| 12408 | % % |
| 12409 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12410 | % |
| 12411 | % MagickTrimImage() remove edges that are the background color from the image. |
| 12412 | % |
| 12413 | % The format of the MagickTrimImage method is: |
| 12414 | % |
| 12415 | % MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz) |
| 12416 | % |
| 12417 | % A description of each parameter follows: |
| 12418 | % |
| 12419 | % o wand: the magick wand. |
| 12420 | % |
| 12421 | % o fuzz: By default target must match a particular pixel color |
| 12422 | % exactly. However, in many cases two colors may differ by a small amount. |
| 12423 | % The fuzz member of image defines how much tolerance is acceptable to |
| 12424 | % consider two colors as the same. For example, set fuzz to 10 and the |
| 12425 | % color red at intensities of 100 and 102 respectively are now interpreted |
| 12426 | % as the same color for the purposes of the floodfill. |
| 12427 | % |
| 12428 | */ |
| 12429 | WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz) |
| 12430 | { |
| 12431 | Image |
| 12432 | *trim_image; |
| 12433 | |
| 12434 | assert(wand != (MagickWand *) NULL); |
| 12435 | assert(wand->signature == WandSignature); |
| 12436 | if (wand->debug != MagickFalse) |
| 12437 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12438 | if (wand->images == (Image *) NULL) |
| 12439 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12440 | wand->images->fuzz=fuzz; |
| 12441 | trim_image=TrimImage(wand->images,wand->exception); |
| 12442 | if (trim_image == (Image *) NULL) |
| 12443 | return(MagickFalse); |
| 12444 | ReplaceImageInList(&wand->images,trim_image); |
| 12445 | return(MagickTrue); |
| 12446 | } |
| 12447 | |
| 12448 | /* |
| 12449 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12450 | % % |
| 12451 | % % |
| 12452 | % % |
| 12453 | % M a g i c k U n i q u e I m a g e C o l o r s % |
| 12454 | % % |
| 12455 | % % |
| 12456 | % % |
| 12457 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12458 | % |
| 12459 | % MagickUniqueImageColors() discards all but one of any pixel color. |
| 12460 | % |
| 12461 | % The format of the MagickUniqueImageColors method is: |
| 12462 | % |
| 12463 | % MagickBooleanType MagickUniqueImageColors(MagickWand *wand) |
| 12464 | % |
| 12465 | % A description of each parameter follows: |
| 12466 | % |
| 12467 | % o wand: the magick wand. |
| 12468 | % |
| 12469 | */ |
| 12470 | WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand) |
| 12471 | { |
| 12472 | Image |
| 12473 | *unique_image; |
| 12474 | |
| 12475 | assert(wand != (MagickWand *) NULL); |
| 12476 | assert(wand->signature == WandSignature); |
| 12477 | if (wand->debug != MagickFalse) |
| 12478 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12479 | if (wand->images == (Image *) NULL) |
| 12480 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12481 | unique_image=UniqueImageColors(wand->images,wand->exception); |
| 12482 | if (unique_image == (Image *) NULL) |
| 12483 | return(MagickFalse); |
| 12484 | ReplaceImageInList(&wand->images,unique_image); |
| 12485 | return(MagickTrue); |
| 12486 | } |
| 12487 | |
| 12488 | /* |
| 12489 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12490 | % % |
| 12491 | % % |
| 12492 | % % |
| 12493 | % M a g i c k U n s h a r p M a s k I m a g e % |
| 12494 | % % |
| 12495 | % % |
| 12496 | % % |
| 12497 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12498 | % |
| 12499 | % MagickUnsharpMaskImage() sharpens an image. We convolve the image with a |
| 12500 | % Gaussian operator of the given radius and standard deviation (sigma). |
| 12501 | % For reasonable results, radius should be larger than sigma. Use a radius |
| 12502 | % of 0 and UnsharpMaskImage() selects a suitable radius for you. |
| 12503 | % |
| 12504 | % The format of the MagickUnsharpMaskImage method is: |
| 12505 | % |
| 12506 | % MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand, |
| 12507 | % const double radius,const double sigma,const double amount, |
| 12508 | % const double threshold) |
| 12509 | % MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand, |
| 12510 | % const ChannelType channel,const double radius,const double sigma, |
| 12511 | % const double amount,const double threshold) |
| 12512 | % |
| 12513 | % A description of each parameter follows: |
| 12514 | % |
| 12515 | % o wand: the magick wand. |
| 12516 | % |
| 12517 | % o channel: the image channel(s). |
| 12518 | % |
| 12519 | % o radius: the radius of the Gaussian, in pixels, not counting the center |
| 12520 | % pixel. |
| 12521 | % |
| 12522 | % o sigma: the standard deviation of the Gaussian, in pixels. |
| 12523 | % |
| 12524 | % o amount: the percentage of the difference between the original and the |
| 12525 | % blur image that is added back into the original. |
| 12526 | % |
| 12527 | % o threshold: the threshold in pixels needed to apply the diffence amount. |
| 12528 | % |
| 12529 | */ |
| 12530 | |
| 12531 | WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand, |
| 12532 | const double radius,const double sigma,const double amount, |
| 12533 | const double threshold) |
| 12534 | { |
| 12535 | MagickBooleanType |
| 12536 | status; |
| 12537 | |
| 12538 | status=MagickUnsharpMaskImageChannel(wand,DefaultChannels,radius,sigma, |
| 12539 | amount,threshold); |
| 12540 | return(status); |
| 12541 | } |
| 12542 | |
| 12543 | WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand, |
| 12544 | const ChannelType channel,const double radius,const double sigma, |
| 12545 | const double amount,const double threshold) |
| 12546 | { |
| 12547 | Image |
| 12548 | *unsharp_image; |
| 12549 | |
| 12550 | assert(wand != (MagickWand *) NULL); |
| 12551 | assert(wand->signature == WandSignature); |
| 12552 | if (wand->debug != MagickFalse) |
| 12553 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12554 | if (wand->images == (Image *) NULL) |
| 12555 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12556 | unsharp_image=UnsharpMaskImageChannel(wand->images,channel,radius,sigma, |
| 12557 | amount,threshold,wand->exception); |
| 12558 | if (unsharp_image == (Image *) NULL) |
| 12559 | return(MagickFalse); |
| 12560 | ReplaceImageInList(&wand->images,unsharp_image); |
| 12561 | return(MagickTrue); |
| 12562 | } |
| 12563 | |
| 12564 | /* |
| 12565 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12566 | % % |
| 12567 | % % |
| 12568 | % % |
| 12569 | % M a g i c k V i g n e t t e I m a g e % |
| 12570 | % % |
| 12571 | % % |
| 12572 | % % |
| 12573 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12574 | % |
| 12575 | % MagickVignetteImage() softens the edges of the image in vignette style. |
| 12576 | % |
| 12577 | % The format of the MagickVignetteImage method is: |
| 12578 | % |
| 12579 | % MagickBooleanType MagickVignetteImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 12580 | % const double black_point,const double white_point,const ssize_t x, |
| 12581 | % const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12582 | % |
| 12583 | % A description of each parameter follows: |
| 12584 | % |
| 12585 | % o wand: the magick wand. |
| 12586 | % |
| 12587 | % o black_point: the black point. |
| 12588 | % |
| 12589 | % o white_point: the white point. |
| 12590 | % |
| 12591 | % o x, y: Define the x and y ellipse offset. |
| 12592 | % |
| 12593 | */ |
| 12594 | WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand, |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 12595 | const double black_point,const double white_point,const ssize_t x,const ssize_t y) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12596 | { |
| 12597 | Image |
| 12598 | *vignette_image; |
| 12599 | |
| 12600 | assert(wand != (MagickWand *) NULL); |
| 12601 | assert(wand->signature == WandSignature); |
| 12602 | if (wand->debug != MagickFalse) |
| 12603 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12604 | if (wand->images == (Image *) NULL) |
| 12605 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12606 | vignette_image=VignetteImage(wand->images,black_point,white_point,x,y, |
| 12607 | wand->exception); |
| 12608 | if (vignette_image == (Image *) NULL) |
| 12609 | return(MagickFalse); |
| 12610 | ReplaceImageInList(&wand->images,vignette_image); |
| 12611 | return(MagickTrue); |
| 12612 | } |
| 12613 | |
| 12614 | /* |
| 12615 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12616 | % % |
| 12617 | % % |
| 12618 | % % |
| 12619 | % M a g i c k W a v e I m a g e % |
| 12620 | % % |
| 12621 | % % |
| 12622 | % % |
| 12623 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12624 | % |
| 12625 | % MagickWaveImage() creates a "ripple" effect in the image by shifting |
cristy | cee9711 | 2010-05-28 00:44:52 +0000 | [diff] [blame] | 12626 | % the pixels vertically along a sine wave whose amplitude and wavelength |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12627 | % is specified by the given parameters. |
| 12628 | % |
| 12629 | % The format of the MagickWaveImage method is: |
| 12630 | % |
| 12631 | % MagickBooleanType MagickWaveImage(MagickWand *wand,const double amplitude, |
| 12632 | % const double wave_length) |
| 12633 | % |
| 12634 | % A description of each parameter follows: |
| 12635 | % |
| 12636 | % o wand: the magick wand. |
| 12637 | % |
| 12638 | % o amplitude, wave_length: Define the amplitude and wave length of the |
| 12639 | % sine wave. |
| 12640 | % |
| 12641 | */ |
| 12642 | WandExport MagickBooleanType MagickWaveImage(MagickWand *wand, |
| 12643 | const double amplitude,const double wave_length) |
| 12644 | { |
| 12645 | Image |
| 12646 | *wave_image; |
| 12647 | |
| 12648 | assert(wand != (MagickWand *) NULL); |
| 12649 | assert(wand->signature == WandSignature); |
| 12650 | if (wand->debug != MagickFalse) |
| 12651 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12652 | if (wand->images == (Image *) NULL) |
| 12653 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12654 | wave_image=WaveImage(wand->images,amplitude,wave_length,wand->exception); |
| 12655 | if (wave_image == (Image *) NULL) |
| 12656 | return(MagickFalse); |
| 12657 | ReplaceImageInList(&wand->images,wave_image); |
| 12658 | return(MagickTrue); |
| 12659 | } |
| 12660 | |
| 12661 | /* |
| 12662 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12663 | % % |
| 12664 | % % |
| 12665 | % % |
| 12666 | % M a g i c k W h i t e T h r e s h o l d I m a g e % |
| 12667 | % % |
| 12668 | % % |
| 12669 | % % |
| 12670 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12671 | % |
| 12672 | % MagickWhiteThresholdImage() is like ThresholdImage() but force all pixels |
| 12673 | % above the threshold into white while leaving all pixels below the threshold |
| 12674 | % unchanged. |
| 12675 | % |
| 12676 | % The format of the MagickWhiteThresholdImage method is: |
| 12677 | % |
| 12678 | % MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, |
| 12679 | % const PixelWand *threshold) |
| 12680 | % |
| 12681 | % A description of each parameter follows: |
| 12682 | % |
| 12683 | % o wand: the magick wand. |
| 12684 | % |
| 12685 | % o threshold: the pixel wand. |
| 12686 | % |
| 12687 | */ |
| 12688 | WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, |
| 12689 | const PixelWand *threshold) |
| 12690 | { |
| 12691 | char |
| 12692 | thresholds[MaxTextExtent]; |
| 12693 | |
| 12694 | MagickBooleanType |
| 12695 | status; |
| 12696 | |
| 12697 | assert(wand != (MagickWand *) NULL); |
| 12698 | assert(wand->signature == WandSignature); |
| 12699 | if (wand->debug != MagickFalse) |
| 12700 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12701 | if (wand->images == (Image *) NULL) |
| 12702 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
cristy | b51dff5 | 2011-05-19 16:55:47 +0000 | [diff] [blame^] | 12703 | (void) FormatLocaleString(thresholds,MaxTextExtent, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12704 | QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, |
| 12705 | PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), |
| 12706 | PixelGetBlueQuantum(threshold),PixelGetOpacityQuantum(threshold)); |
| 12707 | status=WhiteThresholdImage(wand->images,thresholds); |
| 12708 | if (status == MagickFalse) |
| 12709 | InheritException(wand->exception,&wand->images->exception); |
| 12710 | return(status); |
| 12711 | } |
| 12712 | |
| 12713 | /* |
| 12714 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12715 | % % |
| 12716 | % % |
| 12717 | % % |
| 12718 | % M a g i c k W r i t e I m a g e % |
| 12719 | % % |
| 12720 | % % |
| 12721 | % % |
| 12722 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12723 | % |
| 12724 | % MagickWriteImage() writes an image to the specified filename. If the |
| 12725 | % filename parameter is NULL, the image is written to the filename set |
| 12726 | % by MagickReadImage() or MagickSetImageFilename(). |
| 12727 | % |
| 12728 | % The format of the MagickWriteImage method is: |
| 12729 | % |
| 12730 | % MagickBooleanType MagickWriteImage(MagickWand *wand, |
| 12731 | % const char *filename) |
| 12732 | % |
| 12733 | % A description of each parameter follows: |
| 12734 | % |
| 12735 | % o wand: the magick wand. |
| 12736 | % |
| 12737 | % o filename: the image filename. |
| 12738 | % |
| 12739 | % |
| 12740 | */ |
| 12741 | WandExport MagickBooleanType MagickWriteImage(MagickWand *wand, |
| 12742 | const char *filename) |
| 12743 | { |
| 12744 | Image |
| 12745 | *image; |
| 12746 | |
| 12747 | ImageInfo |
| 12748 | *write_info; |
| 12749 | |
| 12750 | MagickBooleanType |
| 12751 | status; |
| 12752 | |
| 12753 | assert(wand != (MagickWand *) NULL); |
| 12754 | assert(wand->signature == WandSignature); |
| 12755 | if (wand->debug != MagickFalse) |
| 12756 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12757 | if (wand->images == (Image *) NULL) |
| 12758 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12759 | if (filename != (const char *) NULL) |
| 12760 | (void) CopyMagickString(wand->images->filename,filename,MaxTextExtent); |
| 12761 | image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 12762 | if (image == (Image *) NULL) |
| 12763 | return(MagickFalse); |
| 12764 | write_info=CloneImageInfo(wand->image_info); |
| 12765 | write_info->adjoin=MagickTrue; |
| 12766 | status=WriteImage(write_info,image); |
| 12767 | if (status == MagickFalse) |
| 12768 | InheritException(wand->exception,&image->exception); |
| 12769 | image=DestroyImage(image); |
| 12770 | write_info=DestroyImageInfo(write_info); |
| 12771 | return(status); |
| 12772 | } |
| 12773 | |
| 12774 | /* |
| 12775 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12776 | % % |
| 12777 | % % |
| 12778 | % % |
| 12779 | % M a g i c k W r i t e I m a g e F i l e % |
| 12780 | % % |
| 12781 | % % |
| 12782 | % % |
| 12783 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12784 | % |
| 12785 | % MagickWriteImageFile() writes an image to an open file descriptor. |
| 12786 | % |
| 12787 | % The format of the MagickWriteImageFile method is: |
| 12788 | % |
| 12789 | % MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file) |
| 12790 | % |
| 12791 | % A description of each parameter follows: |
| 12792 | % |
| 12793 | % o wand: the magick wand. |
| 12794 | % |
| 12795 | % o file: the file descriptor. |
| 12796 | % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12797 | */ |
| 12798 | WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file) |
| 12799 | { |
| 12800 | Image |
| 12801 | *image; |
| 12802 | |
| 12803 | ImageInfo |
| 12804 | *write_info; |
| 12805 | |
| 12806 | MagickBooleanType |
| 12807 | status; |
| 12808 | |
| 12809 | assert(wand != (MagickWand *) NULL); |
| 12810 | assert(wand->signature == WandSignature); |
| 12811 | assert(file != (FILE *) NULL); |
| 12812 | if (wand->debug != MagickFalse) |
| 12813 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12814 | if (wand->images == (Image *) NULL) |
| 12815 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12816 | image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); |
| 12817 | if (image == (Image *) NULL) |
| 12818 | return(MagickFalse); |
| 12819 | write_info=CloneImageInfo(wand->image_info); |
| 12820 | SetImageInfoFile(write_info,file); |
| 12821 | write_info->adjoin=MagickTrue; |
| 12822 | status=WriteImage(write_info,image); |
| 12823 | write_info=DestroyImageInfo(write_info); |
| 12824 | if (status == MagickFalse) |
| 12825 | InheritException(wand->exception,&image->exception); |
| 12826 | image=DestroyImage(image); |
| 12827 | return(status); |
| 12828 | } |
| 12829 | |
| 12830 | /* |
| 12831 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12832 | % % |
| 12833 | % % |
| 12834 | % % |
| 12835 | % M a g i c k W r i t e I m a g e s % |
| 12836 | % % |
| 12837 | % % |
| 12838 | % % |
| 12839 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12840 | % |
| 12841 | % MagickWriteImages() writes an image or image sequence. |
| 12842 | % |
| 12843 | % The format of the MagickWriteImages method is: |
| 12844 | % |
| 12845 | % MagickBooleanType MagickWriteImages(MagickWand *wand, |
| 12846 | % const char *filename,const MagickBooleanType adjoin) |
| 12847 | % |
| 12848 | % A description of each parameter follows: |
| 12849 | % |
| 12850 | % o wand: the magick wand. |
| 12851 | % |
| 12852 | % o filename: the image filename. |
| 12853 | % |
| 12854 | % o adjoin: join images into a single multi-image file. |
| 12855 | % |
| 12856 | */ |
| 12857 | WandExport MagickBooleanType MagickWriteImages(MagickWand *wand, |
| 12858 | const char *filename,const MagickBooleanType adjoin) |
| 12859 | { |
| 12860 | ImageInfo |
| 12861 | *write_info; |
| 12862 | |
| 12863 | MagickBooleanType |
| 12864 | status; |
| 12865 | |
| 12866 | assert(wand != (MagickWand *) NULL); |
| 12867 | assert(wand->signature == WandSignature); |
| 12868 | if (wand->debug != MagickFalse) |
| 12869 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12870 | if (wand->images == (Image *) NULL) |
| 12871 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12872 | write_info=CloneImageInfo(wand->image_info); |
| 12873 | write_info->adjoin=adjoin; |
| 12874 | status=WriteImages(write_info,wand->images,filename,wand->exception); |
| 12875 | if (status == MagickFalse) |
| 12876 | InheritException(wand->exception,&wand->images->exception); |
| 12877 | write_info=DestroyImageInfo(write_info); |
| 12878 | return(status); |
| 12879 | } |
| 12880 | |
| 12881 | /* |
| 12882 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12883 | % % |
| 12884 | % % |
| 12885 | % % |
| 12886 | % M a g i c k W r i t e I m a g e s F i l e % |
| 12887 | % % |
| 12888 | % % |
| 12889 | % % |
| 12890 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12891 | % |
| 12892 | % MagickWriteImagesFile() writes an image sequence to an open file descriptor. |
| 12893 | % |
| 12894 | % The format of the MagickWriteImagesFile method is: |
| 12895 | % |
| 12896 | % MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file) |
| 12897 | % |
| 12898 | % A description of each parameter follows: |
| 12899 | % |
| 12900 | % o wand: the magick wand. |
| 12901 | % |
| 12902 | % o file: the file descriptor. |
| 12903 | % |
| 12904 | */ |
| 12905 | WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file) |
| 12906 | { |
| 12907 | ImageInfo |
| 12908 | *write_info; |
| 12909 | |
| 12910 | MagickBooleanType |
| 12911 | status; |
| 12912 | |
| 12913 | assert(wand != (MagickWand *) NULL); |
| 12914 | assert(wand->signature == WandSignature); |
| 12915 | if (wand->debug != MagickFalse) |
| 12916 | (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); |
| 12917 | if (wand->images == (Image *) NULL) |
| 12918 | ThrowWandException(WandError,"ContainsNoImages",wand->name); |
| 12919 | write_info=CloneImageInfo(wand->image_info); |
| 12920 | SetImageInfoFile(write_info,file); |
| 12921 | write_info->adjoin=MagickTrue; |
| 12922 | status=WriteImages(write_info,wand->images,(const char *) NULL, |
| 12923 | wand->exception); |
| 12924 | write_info=DestroyImageInfo(write_info); |
| 12925 | if (status == MagickFalse) |
| 12926 | InheritException(wand->exception,&wand->images->exception); |
| 12927 | return(status); |
| 12928 | } |