Method: Magick::Image#bias=

Defined in:
ext/RMagick/rmimage.cpp

#bias=(pct) ⇒ Numeric, String

Set image bias (used when convolving an image).

Parameters:

  • pct (Numeric, String)

    Either a number between 0.0 and 1.0 or a string in the form “NN%”

Returns:

  • (Numeric, String)

    the given value



1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
# File 'ext/RMagick/rmimage.cpp', line 1429

VALUE
Image_bias_eq(VALUE self, VALUE pct)
{
    Image *image;
    double bias;

    image = rm_check_frozen(self);
    bias = rm_percentage(pct, 1.0) * QuantumRange;

#if defined(IMAGEMAGICK_7)
    {
        char artifact[21];

        snprintf(artifact, sizeof(artifact), "%.20g", bias);
        SetImageArtifact(image, "convolve:bias", artifact);
    }
#else
    image->bias = bias;
#endif

    return pct;
}