Method: Magick::Image#implode
- Defined in:
- ext/RMagick/rmimage.c
#implode(*args) ⇒ Object
Implode the image by the specified percentage.
Ruby usage:
- @verbatim Image#implode @endverbatim
- @verbatim Image#implode(amount) @endverbatim
Notes:
- Default amount is 0.50
7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 |
# File 'ext/RMagick/rmimage.c', line 7089
VALUE
Image_implode(int argc, VALUE *argv, VALUE self)
{
Image *image, *new_image;
double amount = 0.50;
ExceptionInfo exception;
switch (argc)
{
case 1:
amount = NUM2DBL(argv[0]);
case 0:
break;
default:
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0 or 1)", argc);
}
image = rm_check_destroyed(self);
GetExceptionInfo(&exception);
new_image = ImplodeImage(image, amount, &exception);
rm_check_exception(&exception, new_image, DestroyOnError);
(void) DestroyExceptionInfo(&exception);
rm_ensure_result(new_image);
return rm_image_new(new_image);
}
|