ruby-libgd 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/gd/gd.so +0 -0
- data/ext/gd/image.c +22 -0
- data/ext/gd/image.o +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c241cee619edc2c0a7f1c5b817d1b53d8c5927b721891ab2579d9adb10dc1161
|
|
4
|
+
data.tar.gz: ae707b24a98ab4e4f55c8667e55b56308c74ac0aa5a85a166aac110663b7c714
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e44fa537015326a1f2a8a955b076e340a17f4e95317fd1ba90abcc40a60da8713a4815b8a6fcc0fe9f363600038f7af11da2cf470260a4db54487bd5948ab73
|
|
7
|
+
data.tar.gz: d40dc2e849d313221d43285b02e1d155f531208e58bb041b87d1a10fe1e216ee37563f9465b124002061c8dd5dbe3afecff280de1fc2f7f10b52a14a95bbbcae
|
data/ext/gd/gd.so
CHANGED
|
Binary file
|
data/ext/gd/image.c
CHANGED
|
@@ -270,6 +270,25 @@ static VALUE gd_image_copy_resize(int argc, VALUE *argv, VALUE self) {
|
|
|
270
270
|
return self;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
static VALUE gd_image_antialias(VALUE self, VALUE flag) {
|
|
274
|
+
gd_image_wrapper *wrap;
|
|
275
|
+
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
276
|
+
|
|
277
|
+
if (!wrap->img)
|
|
278
|
+
rb_raise(rb_eRuntimeError, "image is NULL");
|
|
279
|
+
|
|
280
|
+
if (RTEST(flag)) {
|
|
281
|
+
int aa = gdTrueColorAlpha(255,255,255,0);
|
|
282
|
+
gdImageSetAntiAliased(wrap->img, aa);
|
|
283
|
+
gdImageAlphaBlending(wrap->img, 1);
|
|
284
|
+
} else {
|
|
285
|
+
gdImageSetAntiAliased(wrap->img, -1);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return flag;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
273
292
|
void gd_define_image(VALUE mGD) {
|
|
274
293
|
VALUE cGDImage = rb_define_class_under(mGD, "Image", rb_cObject);
|
|
275
294
|
|
|
@@ -285,4 +304,7 @@ void gd_define_image(VALUE mGD) {
|
|
|
285
304
|
rb_define_singleton_method(cGDImage, "new_true_color", gd_image_s_new_true_color, 2);
|
|
286
305
|
rb_define_method(cGDImage, "alpha_blending=", gd_image_alpha_blending, 1);
|
|
287
306
|
rb_define_method(cGDImage, "save_alpha=", gd_image_save_alpha, 1);
|
|
307
|
+
rb_define_method(cGDImage, "antialias=", gd_image_antialias, 1);
|
|
308
|
+
rb_define_method(cGDImage, "antialias", gd_image_antialias, 1);
|
|
309
|
+
|
|
288
310
|
}
|
data/ext/gd/image.o
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-libgd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Germán Alberto Giménez Silva
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: High-performance native Ruby bindings to libgd for image generation,
|
|
14
14
|
drawing, filters, alpha blending, and transformations.
|