Method: Magick::Image#blur_channel

Defined in:
ext/RMagick/rmimage.cpp

#blur_channel(radius = 0.0, sigma = 1.0, channel = Magick::AllChannels) ⇒ Magick::Image #blur_channel(radius = 0.0, sigma = 1.0, *channels) ⇒ Magick::Image

Blurs the specified channel. Convolves the image with a Gaussian operator of the given radius and standard deviation (sigma).

Overloads:

  • #blur_channel(radius = 0.0, sigma = 1.0, channel = Magick::AllChannels) ⇒ Magick::Image

    Parameters:

    • radius (Numeric) (defaults to: 0.0)

      the radius value

    • sigma (Numeric) (defaults to: 1.0)

      the sigma value

    • channel (Magick::ChannelType) (defaults to: Magick::AllChannels)

      a ChannelType arguments.

  • #blur_channel(radius = 0.0, sigma = 1.0, *channels) ⇒ Magick::Image

    Parameters:

    • radius (Numeric) (defaults to: 0.0)

      the radius value

    • sigma (Numeric) (defaults to: 1.0)

      the sigma value

    • *channels (Magick::ChannelType)

      one or more ChannelType arguments.

Returns:



2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
# File 'ext/RMagick/rmimage.cpp', line 2036

VALUE
Image_blur_channel(int argc, VALUE *argv, VALUE self)
{
    Image *image, *new_image;
    ExceptionInfo *exception;
    ChannelType channels;
    double radius = 0.0, sigma = 1.0;

    image = rm_check_destroyed(self);

    channels = extract_channels(&argc, argv);

    // There can be 0, 1, or 2 remaining arguments.
    switch (argc)
    {
        case 2:
            sigma = NUM2DBL(argv[1]);
        case 1:
            radius = NUM2DBL(argv[0]);
        case 0:
            break;
        default:
            raise_ChannelType_error(argv[argc-1]);
    }

    exception = AcquireExceptionInfo();
#if defined(IMAGEMAGICK_7)
    BEGIN_CHANNEL_MASK(image, channels);
    GVL_STRUCT_TYPE(BlurImage) args = { image, radius, sigma, exception };
    new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(BlurImage), &args);
    CHANGE_RESULT_CHANNEL_MASK(new_image);
    END_CHANNEL_MASK(image);
#else
    GVL_STRUCT_TYPE(BlurImageChannel) args = { image, channels, radius, sigma, exception };
    new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(BlurImageChannel), &args);
#endif
    rm_check_exception(exception, new_image, DestroyOnError);
    DestroyExceptionInfo(exception);

    return rm_image_new(new_image);
}