Method: Magick::Image#add_noise
- Defined in:
- ext/RMagick/rmimage.c
#add_noise(noise) ⇒ Object
Add random noise to a copy of the image.
Ruby usage:
- @verbatim Image#add_noise(noise_type) @endverbatim
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'ext/RMagick/rmimage.c', line 407
VALUE
Image_add_noise(VALUE self, VALUE noise)
{
Image *image, *new_image;
NoiseType noise_type;
ExceptionInfo exception;
image = rm_check_destroyed(self);
VALUE_TO_ENUM(noise, noise_type, NoiseType);
GetExceptionInfo(&exception);
new_image = AddNoiseImage(image, noise_type, &exception);
rm_check_exception(&exception, new_image, DestroyOnError);
(void) DestroyExceptionInfo(&exception);
rm_ensure_result(new_image);
return rm_image_new(new_image);
}
|