ruby-libgd 0.1.3 → 0.1.5
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/arc.c +53 -41
- data/ext/gd/arc.o +0 -0
- data/ext/gd/circle.c +65 -16
- data/ext/gd/circle.o +0 -0
- data/ext/gd/draw_line.c +18 -2
- data/ext/gd/draw_line.o +0 -0
- data/ext/gd/ellipse.c +80 -0
- data/ext/gd/ellipse.o +0 -0
- data/ext/gd/gd.c +2 -1
- data/ext/gd/gd.o +0 -0
- data/ext/gd/gd.so +0 -0
- data/ext/gd/image.c +1 -2
- data/ext/gd/image.o +0 -0
- data/ext/gd/rectangle.c +32 -5
- data/ext/gd/rectangle.o +0 -0
- data/ext/gd/ruby_gd.h +2 -1
- metadata +3 -4
- data/ext/gd/join.sh +0 -24
- data/lib/gd/gd.so +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b088efd8a6a97e9c78b98b3cad9679b16f44bb42f8db23a9ee69ccf2d6e0d354
|
|
4
|
+
data.tar.gz: 95b261eda0e28242e35af5161f6064c4a6a80194e06dce40a2b406174e68487c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bdcc47d45dc49eb617e99b19bdd088e0881b9ea8b84a7248347775f0847d0f1fef9717263f2cca5d85b088d3ebae8d8c9c8549707d92a86aeeb66689e853dc86
|
|
7
|
+
data.tar.gz: d3908f63c2e5bcc10379eba83d8ef0df78707cdd00a6ce3a62f3ab6b979a1b1365aa384de0e53b9a83748f53b61aa5d796d507aea51b0fb531c8955c858314c6
|
data/ext/gd/arc.c
CHANGED
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
#include "ruby_gd.h"
|
|
2
2
|
|
|
3
|
-
static VALUE
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
static VALUE
|
|
4
|
+
gd_image_arc(int argc, VALUE *argv, VALUE self)
|
|
5
|
+
{
|
|
6
|
+
VALUE vcx, vcy, vw, vh, vstart, vend, vcolor, opts;
|
|
7
|
+
VALUE thickness = Qnil;
|
|
8
|
+
opts = Qnil;
|
|
9
|
+
|
|
10
|
+
rb_scan_args(argc, argv, "7:", &vcx, &vcy, &vw, &vh, &vstart, &vend, &vcolor, &opts);
|
|
11
|
+
|
|
12
|
+
if (!NIL_P(opts)) {
|
|
13
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
gd_image_wrapper *wrap;
|
|
17
|
+
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
18
|
+
|
|
19
|
+
int cx = NUM2INT(vcx);
|
|
20
|
+
int cy = NUM2INT(vcy);
|
|
21
|
+
int w = NUM2INT(vw);
|
|
22
|
+
int h = NUM2INT(vh);
|
|
23
|
+
int s = NUM2INT(vstart);
|
|
24
|
+
int e = NUM2INT(vend);
|
|
25
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
26
|
+
|
|
27
|
+
int t = NIL_P(thickness) ? 1 : NUM2INT(thickness);
|
|
28
|
+
int half = t / 2;
|
|
29
|
+
|
|
30
|
+
for (int i = -half; i <= half; i++) {
|
|
31
|
+
gdImageArc(wrap->img, cx + i, cy, w, h, s, e, c);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return self;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
|
-
static VALUE
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
) {
|
|
32
|
-
gd_image_wrapper *wrap;
|
|
33
|
-
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
37
|
+
static VALUE
|
|
38
|
+
gd_image_filled_arc(int argc, VALUE *argv, VALUE self)
|
|
39
|
+
{
|
|
40
|
+
VALUE vcx, vcy, vw, vh, vstart, vend, vcolor;
|
|
41
|
+
rb_scan_args(argc, argv, "7", &vcx, &vcy, &vw, &vh, &vstart, &vend, &vcolor);
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
int w = NUM2INT(vw);
|
|
38
|
-
int h = NUM2INT(vh);
|
|
39
|
-
int s = NUM2INT(vstart);
|
|
40
|
-
int e = NUM2INT(vend);
|
|
43
|
+
gd_image_wrapper *wrap;
|
|
44
|
+
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
int cx = NUM2INT(vcx);
|
|
47
|
+
int cy = NUM2INT(vcy);
|
|
48
|
+
int w = NUM2INT(vw);
|
|
49
|
+
int h = NUM2INT(vh);
|
|
50
|
+
int s = NUM2INT(vstart);
|
|
51
|
+
int e = NUM2INT(vend);
|
|
52
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
43
53
|
|
|
44
|
-
|
|
54
|
+
gdImageFilledArc(wrap->img, cx, cy, w, h, s, e, c, gdArc);
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
return self;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
void
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
void
|
|
60
|
+
gd_define_arc(VALUE cGDImage)
|
|
61
|
+
{
|
|
62
|
+
rb_define_method(cGDImage, "arc", gd_image_arc, -1);
|
|
63
|
+
rb_define_method(cGDImage, "filled_arc", gd_image_filled_arc, -1);
|
|
52
64
|
}
|
data/ext/gd/arc.o
CHANGED
|
Binary file
|
data/ext/gd/circle.c
CHANGED
|
@@ -1,33 +1,82 @@
|
|
|
1
1
|
#include "ruby_gd.h"
|
|
2
2
|
|
|
3
|
-
static VALUE gd_image_circle(
|
|
3
|
+
static VALUE gd_image_circle(int argc, VALUE *argv, VALUE self)
|
|
4
|
+
{
|
|
5
|
+
VALUE vcx, vcy, vradius, vcolor, opts;
|
|
6
|
+
VALUE thickness = Qnil;
|
|
7
|
+
opts = Qnil;
|
|
8
|
+
|
|
9
|
+
rb_scan_args(argc, argv, "4:", &vcx, &vcy, &vradius, &vcolor, &opts);
|
|
10
|
+
|
|
11
|
+
if (!NIL_P(opts)) {
|
|
12
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
gd_image_wrapper *wrap;
|
|
5
16
|
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
6
17
|
|
|
7
|
-
int
|
|
18
|
+
int cx = NUM2INT(vcx);
|
|
19
|
+
int cy = NUM2INT(vcy);
|
|
20
|
+
int r = NUM2INT(vradius);
|
|
21
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
8
22
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
int t = NIL_P(thickness) ? 1 : NUM2INT(thickness);
|
|
24
|
+
int half = t / 2;
|
|
25
|
+
|
|
26
|
+
for (int i = -half; i <= half; i++) {
|
|
27
|
+
gdImageArc(wrap->img,
|
|
28
|
+
cx, cy,
|
|
29
|
+
(r + i) * 2, (r + i) * 2,
|
|
30
|
+
0, 360,
|
|
31
|
+
c);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return self;
|
|
15
35
|
}
|
|
16
36
|
|
|
17
|
-
static VALUE gd_image_filled_circle(
|
|
37
|
+
static VALUE gd_image_filled_circle(int argc, VALUE *argv, VALUE self)
|
|
38
|
+
{
|
|
39
|
+
VALUE vcx, vcy, vradius, vcolor, opts;
|
|
40
|
+
VALUE thickness = Qnil;
|
|
41
|
+
opts = Qnil;
|
|
42
|
+
|
|
43
|
+
rb_scan_args(argc, argv, "4:", &vcx, &vcy, &vradius, &vcolor, &opts);
|
|
44
|
+
|
|
45
|
+
if (!NIL_P(opts)) {
|
|
46
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
47
|
+
}
|
|
48
|
+
|
|
18
49
|
gd_image_wrapper *wrap;
|
|
19
50
|
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
20
51
|
|
|
21
|
-
int
|
|
52
|
+
int cx = NUM2INT(vcx);
|
|
53
|
+
int cy = NUM2INT(vcy);
|
|
54
|
+
int r = NUM2INT(vradius);
|
|
55
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
22
56
|
|
|
57
|
+
/* Fill */
|
|
23
58
|
gdImageFilledEllipse(wrap->img,
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
cx, cy,
|
|
60
|
+
r * 2, r * 2,
|
|
26
61
|
c);
|
|
27
|
-
|
|
62
|
+
|
|
63
|
+
/* Stroke */
|
|
64
|
+
int t = NIL_P(thickness) ? 1 : NUM2INT(thickness);
|
|
65
|
+
int half = t / 2;
|
|
66
|
+
|
|
67
|
+
for (int i = -half; i <= half; i++) {
|
|
68
|
+
gdImageArc(wrap->img,
|
|
69
|
+
cx, cy,
|
|
70
|
+
(r + i) * 2, (r + i) * 2,
|
|
71
|
+
0, 360,
|
|
72
|
+
c);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return self;
|
|
28
76
|
}
|
|
29
77
|
|
|
30
|
-
void gd_define_circle(VALUE cGDImage)
|
|
31
|
-
|
|
32
|
-
rb_define_method(cGDImage, "
|
|
78
|
+
void gd_define_circle(VALUE cGDImage)
|
|
79
|
+
{
|
|
80
|
+
rb_define_method(cGDImage, "circle", gd_image_circle, -1);
|
|
81
|
+
rb_define_method(cGDImage, "filled_circle", gd_image_filled_circle, -1);
|
|
33
82
|
}
|
data/ext/gd/circle.o
CHANGED
|
Binary file
|
data/ext/gd/draw_line.c
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
#include "ruby_gd.h"
|
|
3
3
|
#include "clip.h"
|
|
4
4
|
|
|
5
|
-
static VALUE gd_image_line(
|
|
5
|
+
static VALUE gd_image_line(int argc, VALUE *argv, VALUE self) {
|
|
6
|
+
VALUE x1, y1, x2, y2, color, opts;
|
|
7
|
+
opts = Qnil;
|
|
8
|
+
|
|
9
|
+
rb_scan_args(argc, argv, "5:", &x1, &y1, &x2, &y2, &color, &opts);
|
|
10
|
+
|
|
11
|
+
VALUE thickness = Qnil;
|
|
12
|
+
if (!NIL_P(opts)) {
|
|
13
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
gd_image_wrapper *wrap;
|
|
7
17
|
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
8
18
|
|
|
@@ -39,11 +49,17 @@ static VALUE gd_image_line(VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2, V
|
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
int c = color_to_gd(wrap->img, color);
|
|
52
|
+
int old = 1;
|
|
53
|
+
|
|
54
|
+
if (!NIL_P(thickness)) {
|
|
55
|
+
gdImageSetThickness(wrap->img, NUM2INT(thickness));
|
|
56
|
+
}
|
|
42
57
|
gdImageLine(wrap->img, NUM2INT(x1), NUM2INT(y1), NUM2INT(x2), NUM2INT(y2), c);
|
|
58
|
+
gdImageSetThickness(wrap->img, old);
|
|
43
59
|
|
|
44
60
|
return Qnil;
|
|
45
61
|
}
|
|
46
62
|
|
|
47
63
|
void gd_define_line(VALUE cGDImage) {
|
|
48
|
-
rb_define_method(cGDImage, "line", gd_image_line,
|
|
64
|
+
rb_define_method(cGDImage, "line", gd_image_line, -1);
|
|
49
65
|
}
|
data/ext/gd/draw_line.o
CHANGED
|
Binary file
|
data/ext/gd/ellipse.c
CHANGED
|
@@ -2,3 +2,83 @@
|
|
|
2
2
|
- [ ] imageellipse — Draw an ellipse
|
|
3
3
|
- [ ] imagefilledellipse — Draw a filled ellipse
|
|
4
4
|
*/
|
|
5
|
+
#include "ruby_gd.h"
|
|
6
|
+
|
|
7
|
+
static VALUE gd_image_ellipse(int argc, VALUE *argv, VALUE self)
|
|
8
|
+
{
|
|
9
|
+
VALUE vcx, vcy, vw, vh, vcolor, opts;
|
|
10
|
+
VALUE thickness = Qnil;
|
|
11
|
+
opts = Qnil;
|
|
12
|
+
|
|
13
|
+
rb_scan_args(argc, argv, "5:", &vcx, &vcy, &vw, &vh, &vcolor, &opts);
|
|
14
|
+
|
|
15
|
+
if (!NIL_P(opts)) {
|
|
16
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
gd_image_wrapper *wrap;
|
|
20
|
+
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
21
|
+
|
|
22
|
+
int cx = NUM2INT(vcx);
|
|
23
|
+
int cy = NUM2INT(vcy);
|
|
24
|
+
int w = NUM2INT(vw);
|
|
25
|
+
int h = NUM2INT(vh);
|
|
26
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
27
|
+
|
|
28
|
+
int t = NIL_P(thickness) ? 1 : NUM2INT(thickness);
|
|
29
|
+
int half = t / 2;
|
|
30
|
+
|
|
31
|
+
for (int i = -half; i <= half; i++) {
|
|
32
|
+
gdImageArc(wrap->img,
|
|
33
|
+
cx, cy,
|
|
34
|
+
w + i * 2, h + i * 2,
|
|
35
|
+
0, 360,
|
|
36
|
+
c);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return self;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static VALUE gd_image_filled_ellipse(int argc, VALUE *argv, VALUE self)
|
|
43
|
+
{
|
|
44
|
+
VALUE vcx, vcy, vw, vh, vcolor, opts;
|
|
45
|
+
VALUE thickness = Qnil;
|
|
46
|
+
opts = Qnil;
|
|
47
|
+
|
|
48
|
+
rb_scan_args(argc, argv, "5:", &vcx, &vcy, &vw, &vh, &vcolor, &opts);
|
|
49
|
+
|
|
50
|
+
if (!NIL_P(opts)) {
|
|
51
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
gd_image_wrapper *wrap;
|
|
55
|
+
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
56
|
+
|
|
57
|
+
int cx = NUM2INT(vcx);
|
|
58
|
+
int cy = NUM2INT(vcy);
|
|
59
|
+
int w = NUM2INT(vw);
|
|
60
|
+
int h = NUM2INT(vh);
|
|
61
|
+
int c = color_to_gd(wrap->img, vcolor);
|
|
62
|
+
|
|
63
|
+
/* Fill */
|
|
64
|
+
gdImageFilledEllipse(wrap->img, cx, cy, w, h, c);
|
|
65
|
+
|
|
66
|
+
/* Stroke */
|
|
67
|
+
int t = NIL_P(thickness) ? 1 : NUM2INT(thickness);
|
|
68
|
+
int half = t / 2;
|
|
69
|
+
|
|
70
|
+
for (int i = -half; i <= half; i++) {
|
|
71
|
+
gdImageArc(wrap->img,
|
|
72
|
+
cx, cy,
|
|
73
|
+
w + i * 2, h + i * 2,
|
|
74
|
+
0, 360,
|
|
75
|
+
c);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return self;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void gd_define_ellipse(VALUE cGDImage) {
|
|
82
|
+
rb_define_method(cGDImage, "ellipse", gd_image_ellipse, -1);
|
|
83
|
+
rb_define_method(cGDImage, "filled_ellipse", gd_image_filled_ellipse, -1);
|
|
84
|
+
}
|
data/ext/gd/ellipse.o
CHANGED
|
Binary file
|
data/ext/gd/gd.c
CHANGED
|
@@ -72,8 +72,9 @@ void Init_gd(void) {
|
|
|
72
72
|
gd_define_pixel(cGDImage);
|
|
73
73
|
gd_define_line(cGDImage);
|
|
74
74
|
gd_define_arc(cGDImage);
|
|
75
|
-
|
|
75
|
+
gd_define_rectangle(cGDImage);
|
|
76
76
|
gd_define_circle(cGDImage);
|
|
77
|
+
gd_define_ellipse(cGDImage);
|
|
77
78
|
gd_define_polygon(cGDImage);
|
|
78
79
|
|
|
79
80
|
gd_define_text(cGDImage);
|
data/ext/gd/gd.o
CHANGED
|
Binary file
|
data/ext/gd/gd.so
CHANGED
|
Binary file
|
data/ext/gd/image.c
CHANGED
|
@@ -196,7 +196,7 @@ static VALUE gd_image_height(VALUE self) {
|
|
|
196
196
|
return INT2NUM(gdImageSY(wrap->img));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
static VALUE gd_image_copy(
|
|
199
|
+
static VALUE gd_image_copy (
|
|
200
200
|
VALUE self, VALUE src,
|
|
201
201
|
VALUE dx, VALUE dy,
|
|
202
202
|
VALUE sx, VALUE sy,
|
|
@@ -219,7 +219,6 @@ static VALUE gd_image_copy(
|
|
|
219
219
|
return Qnil;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
|
|
223
222
|
void gd_define_image(VALUE mGD) {
|
|
224
223
|
VALUE cGDImage = rb_define_class_under(mGD, "Image", rb_cObject);
|
|
225
224
|
|
data/ext/gd/image.o
CHANGED
|
Binary file
|
data/ext/gd/rectangle.c
CHANGED
|
@@ -3,31 +3,58 @@
|
|
|
3
3
|
- [ ] imagerectangle — Draw a rectangle
|
|
4
4
|
- [ ] imagefilledrectangle — Draw a filled rectangle
|
|
5
5
|
*/
|
|
6
|
-
static VALUE
|
|
6
|
+
static VALUE gd_image_rectangle(int argc, VALUE *argv, VALUE self) {
|
|
7
|
+
VALUE x1, y1, x2, y2, color, opts;
|
|
8
|
+
VALUE thickness = Qnil;
|
|
9
|
+
opts = Qnil;
|
|
10
|
+
|
|
11
|
+
rb_scan_args(argc, argv, "5:", &x1, &y1, &x2, &y2, &color, &opts);
|
|
12
|
+
if (!NIL_P(opts)) {
|
|
13
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
gd_image_wrapper *wrap;
|
|
8
17
|
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
9
18
|
|
|
10
19
|
int c = color_to_gd(wrap->img, color);
|
|
20
|
+
|
|
21
|
+
if (!NIL_P(thickness)) {
|
|
22
|
+
gdImageSetThickness(wrap->img, NUM2INT(thickness));
|
|
23
|
+
}
|
|
11
24
|
gdImageRectangle(wrap->img,
|
|
12
25
|
NUM2INT(x1), NUM2INT(y1),
|
|
13
26
|
NUM2INT(x2), NUM2INT(y2),
|
|
14
27
|
c);
|
|
28
|
+
gdImageSetThickness(wrap->img, 1);
|
|
15
29
|
return Qnil;
|
|
16
30
|
}
|
|
17
31
|
|
|
18
|
-
static VALUE
|
|
32
|
+
static VALUE gd_image_filled_rectangle(int argc, VALUE *argv, VALUE self) {
|
|
33
|
+
VALUE x1, y1, x2, y2, color, opts;
|
|
34
|
+
VALUE thickness = Qnil;
|
|
35
|
+
opts = Qnil;
|
|
36
|
+
|
|
37
|
+
rb_scan_args(argc, argv, "5:", &x1, &y1, &x2, &y2, &color, &opts);
|
|
38
|
+
if (!NIL_P(opts)) {
|
|
39
|
+
thickness = rb_hash_aref(opts, ID2SYM(rb_intern("thickness")));
|
|
40
|
+
}
|
|
41
|
+
|
|
19
42
|
gd_image_wrapper *wrap;
|
|
20
43
|
TypedData_Get_Struct(self, gd_image_wrapper, &gd_image_type, wrap);
|
|
21
44
|
|
|
22
45
|
int c = color_to_gd(wrap->img, color);
|
|
46
|
+
if (!NIL_P(thickness)) {
|
|
47
|
+
gdImageSetThickness(wrap->img, NUM2INT(thickness));
|
|
48
|
+
}
|
|
23
49
|
gdImageFilledRectangle(wrap->img,
|
|
24
50
|
NUM2INT(x1), NUM2INT(y1),
|
|
25
51
|
NUM2INT(x2), NUM2INT(y2),
|
|
26
52
|
c);
|
|
53
|
+
gdImageSetThickness(wrap->img, 1);
|
|
27
54
|
return Qnil;
|
|
28
55
|
}
|
|
29
56
|
|
|
30
|
-
void
|
|
31
|
-
rb_define_method(cGDImage, "
|
|
32
|
-
rb_define_method(cGDImage, "
|
|
57
|
+
void gd_define_rectangle(VALUE cGDImage) {
|
|
58
|
+
rb_define_method(cGDImage, "rectangle", gd_image_rectangle, -1);
|
|
59
|
+
rb_define_method(cGDImage, "filled_rectangle", gd_image_filled_rectangle, -1);
|
|
33
60
|
}
|
data/ext/gd/rectangle.o
CHANGED
|
Binary file
|
data/ext/gd/ruby_gd.h
CHANGED
|
@@ -21,8 +21,9 @@ void gd_define_fill(VALUE cGDImage);
|
|
|
21
21
|
void gd_define_pixel(VALUE cGDImage);
|
|
22
22
|
void gd_define_line(VALUE cGDImage);
|
|
23
23
|
void gd_define_arc(VALUE cGDImage);
|
|
24
|
-
void
|
|
24
|
+
void gd_define_rectangle(VALUE cGDImage);
|
|
25
25
|
void gd_define_circle(VALUE cGDImage);
|
|
26
|
+
void gd_define_ellipse(VALUE cGDImage);
|
|
26
27
|
void gd_define_polygon(VALUE cGDImage);
|
|
27
28
|
|
|
28
29
|
void gd_define_text(VALUE cGDImage);
|
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.1.5
|
|
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-05 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.
|
|
@@ -50,7 +50,6 @@ files:
|
|
|
50
50
|
- ext/gd/gd.so
|
|
51
51
|
- ext/gd/image.c
|
|
52
52
|
- ext/gd/image.o
|
|
53
|
-
- ext/gd/join.sh
|
|
54
53
|
- ext/gd/mkmf.log
|
|
55
54
|
- ext/gd/pixel.c
|
|
56
55
|
- ext/gd/pixel.o
|
|
@@ -66,7 +65,6 @@ files:
|
|
|
66
65
|
- ext/gd/version.c
|
|
67
66
|
- ext/gd/version.o
|
|
68
67
|
- lib/gd.rb
|
|
69
|
-
- lib/gd/gd.so
|
|
70
68
|
homepage: https://github.com/ggerman/ruby-libgd
|
|
71
69
|
licenses:
|
|
72
70
|
- MIT
|
|
@@ -75,6 +73,7 @@ post_install_message:
|
|
|
75
73
|
rdoc_options: []
|
|
76
74
|
require_paths:
|
|
77
75
|
- lib
|
|
76
|
+
- ext
|
|
78
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
79
|
- - ">="
|
data/ext/gd/join.sh
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
OUT="c_sources_dump.txt"
|
|
5
|
-
|
|
6
|
-
echo "Generating $OUT ..."
|
|
7
|
-
echo "======================" > "$OUT"
|
|
8
|
-
echo "Generated on $(date)" >> "$OUT"
|
|
9
|
-
echo "" >> "$OUT"
|
|
10
|
-
|
|
11
|
-
find . -name "*.c" -type f | sort | while read -r file; do
|
|
12
|
-
echo "----------------------------------------" >> "$OUT"
|
|
13
|
-
echo "FILE: $file" >> "$OUT"
|
|
14
|
-
echo "----------------------------------------" >> "$OUT"
|
|
15
|
-
echo "" >> "$OUT"
|
|
16
|
-
|
|
17
|
-
sed 's/\t/ /g' "$file" >> "$OUT"
|
|
18
|
-
|
|
19
|
-
echo "" >> "$OUT"
|
|
20
|
-
echo "" >> "$OUT"
|
|
21
|
-
done
|
|
22
|
-
|
|
23
|
-
echo "Done."
|
|
24
|
-
echo "Output written to: $OUT"
|
data/lib/gd/gd.so
DELETED
|
Binary file
|