ext/RMagick/rmutil.c in rmagick-4.2.2 vs ext/RMagick/rmutil.c in rmagick-4.2.3
- old
+ new
@@ -856,10 +856,29 @@
RB_GC_GUARD(exc);
RB_GC_GUARD(mesg);
}
+#if defined(IMAGEMAGICK_7)
+/**
+ * Sets the alpha channel of a pixel color
+ *
+ * No Ruby usage (internal function)
+ *
+ * @param pixel the Pixel
+ * @param value the value
+ */
+void
+rm_set_pixelinfo_alpha(PixelInfo *pixel, const MagickRealType value)
+{
+ pixel->alpha = value;
+ if (value != (MagickRealType) OpaqueAlpha)
+ {
+ pixel->alpha_trait = BlendPixelTrait;
+ }
+}
+#endif
/**
* Initialize a new ImageMagickError object - store the "loc" string in the
* magick_location instance variable.
*
@@ -1006,9 +1025,10 @@
argv[0] = img;
opt_args = rb_class_new_instance(1, argv, optional_method_arguments);
if (rb_proc_arity(rb_block_proc()) == 0)
{
+ rb_warn("passing a block without an image argument is deprecated");
rb_obj_instance_eval(0, NULL, opt_args);
}
else
{
rb_yield(opt_args);