Method: Magick::Image#solarize
- Defined in:
- ext/RMagick/rmimage.c
#solarize(*args) ⇒ Object
Apply a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the solarization.
Ruby usage:
- @verbatim Image#solarize @endverbatim
- @verbatim Image#solarize(threshold) @endverbatim
Notes:
- Default threshold is 50.0
12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 |
# File 'ext/RMagick/rmimage.c', line 12166 VALUE Image_solarize(int argc, VALUE *argv, VALUE self) { Image *image, *new_image; double threshold = 50.0; image = rm_check_destroyed(self); switch (argc) { case 1: threshold = NUM2DBL(argv[0]); if (threshold < 0.0 || threshold > QuantumRange) { rb_raise(rb_eArgError, "threshold out of range, must be >= 0.0 and < QuantumRange"); } case 0: break; default: rb_raise(rb_eArgError, "wrong number of arguments (%d for 0 or 1)", argc); break; } new_image = rm_clone_image(image); (void) SolarizeImage(new_image, threshold); rm_check_image_exception(new_image, DestroyOnError); return rm_image_new(new_image); } |