Method: Magick::Pixel#alpha

Defined in:
ext/RMagick/rmpixel.c

#alphaNumeric

Get Pixel alpha value.

Returns:

  • (Numeric)

    the alpha value



76
77
78
79
80
81
82
83
84
85
86
# File 'ext/RMagick/rmpixel.c', line 76

VALUE
Pixel_alpha(VALUE self)
{
    Pixel *pixel;
    Data_Get_Struct(self, Pixel, pixel);
#if defined(IMAGEMAGICK_7)
    return C_int_to_R_int(pixel->alpha);
#else
    return C_int_to_R_int(QuantumRange - pixel->opacity);
#endif
}