Method: Magick::Image#gaussian_blur_channel

Defined in:
ext/RMagick/rmimage.cpp

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

Blur the image on a channel.

Overloads:

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

    Parameters:

    • radius (Numeric) (defaults to: 0.0)

      The radius of the Gaussian operator.

    • sigma (Numeric) (defaults to: 1.0)

      The sigma (standard deviation) of the Gaussian operator.

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

      a ChannelType arguments.

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

    Parameters:

    • radius (Numeric) (defaults to: 0.0)

      The radius of the Gaussian operator.

    • sigma (Numeric) (defaults to: 1.0)

      The sigma (standard deviation) of the Gaussian operator.

    • *channels (Magick::ChannelType)

      one or more ChannelType arguments.

Returns:



7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
# File 'ext/RMagick/rmimage.cpp', line 7707

VALUE
Image_gaussian_blur_channel(int argc, VALUE *argv, VALUE self)
{
    Image *image, *new_image;
    ChannelType channels;
    ExceptionInfo *exception;
    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]);
            /* Fall thru */
        case 1:
            radius = NUM2DBL(argv[0]);
            /* Fall thru */
        case 0:
            break;
        default:
            raise_ChannelType_error(argv[argc-1]);
    }

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

    DestroyExceptionInfo(exception);

    return rm_image_new(new_image);
}