rays 0.1.39 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.doc/ext/rays/bitmap.cpp +7 -7
- data/ChangeLog.md +5 -0
- data/VERSION +1 -1
- data/ext/rays/bitmap.cpp +7 -7
- data/test/test_bitmap.rb +14 -1
- 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: f28cc1bd39b3a7b5a6e801693d0642fbd3e3a4af7871a800c8d7378f5ef9427d
|
4
|
+
data.tar.gz: ad0decfd29260689a65b38c12ca6fc4897730a79660865ab9fcf15d0458305ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2412027656abd1d92fc21acd7197a7c3c4469248806e174f4b76bd9befe5cf5247f09a6539a2aababe72ff556700c93047dc46344f2a06d079137f07949de7c
|
7
|
+
data.tar.gz: b0355b91a402279278b4c892df9bd2c6312f46f3f536974e076c89bea940096d48ad9d14f6ee9fd37dfe274293e6d8c4fc3f1bfb9221abfafce03d7cc3a44015
|
data/.doc/ext/rays/bitmap.cpp
CHANGED
@@ -67,17 +67,17 @@ VALUE color_space(VALUE self)
|
|
67
67
|
}
|
68
68
|
|
69
69
|
static
|
70
|
-
VALUE set_at(VALUE self)
|
70
|
+
VALUE set_at(VALUE self, VALUE x, VALUE y, VALUE color)
|
71
71
|
{
|
72
72
|
CHECK;
|
73
|
-
check_arg_count(__FILE__, __LINE__, "Bitmap#set_at", argc, 3, 4, 5, 6);
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
bool is_array = color.is_array();
|
75
|
+
size_t argc = is_array ? color.size() : 1;
|
76
|
+
const Value* argv = is_array ? color.as_array() : &color;
|
77
|
+
to<Rays::Color>(argc, argv)
|
78
|
+
.get(THIS->at<void>(to<int>(x), to<int>(y)), THIS->color_space());
|
78
79
|
|
79
|
-
color
|
80
|
-
return value(color);
|
80
|
+
return color;
|
81
81
|
}
|
82
82
|
|
83
83
|
static
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.40
|
data/ext/rays/bitmap.cpp
CHANGED
@@ -73,17 +73,17 @@ RUCY_DEF0(color_space)
|
|
73
73
|
RUCY_END
|
74
74
|
|
75
75
|
static
|
76
|
-
|
76
|
+
RUCY_DEF3(set_at, x, y, color)
|
77
77
|
{
|
78
78
|
CHECK;
|
79
|
-
check_arg_count(__FILE__, __LINE__, "Bitmap#set_at", argc, 3, 4, 5, 6);
|
80
79
|
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
bool is_array = color.is_array();
|
81
|
+
size_t argc = is_array ? color.size() : 1;
|
82
|
+
const Value* argv = is_array ? color.as_array() : &color;
|
83
|
+
to<Rays::Color>(argc, argv)
|
84
|
+
.get(THIS->at<void>(to<int>(x), to<int>(y)), THIS->color_space());
|
84
85
|
|
85
|
-
color
|
86
|
-
return value(color);
|
86
|
+
return color;
|
87
87
|
}
|
88
88
|
RUCY_END
|
89
89
|
|
data/test/test_bitmap.rb
CHANGED
@@ -34,8 +34,21 @@ class TestBitmap < Test::Unit::TestCase
|
|
34
34
|
def test_at()
|
35
35
|
o = bitmap
|
36
36
|
assert_equal color(0, 0, 0, 0), o[0, 0]
|
37
|
-
|
37
|
+
|
38
|
+
o[0, 0] = 1
|
38
39
|
assert_equal color(1, 1, 1, 1), o[0, 0]
|
40
|
+
|
41
|
+
o[0, 0] = [0, 1, 0]
|
42
|
+
assert_equal color(0, 1, 0, 1), o[0, 0]
|
43
|
+
|
44
|
+
o[0, 0] = [0, 1, 0, 0]
|
45
|
+
assert_equal color(0, 1, 0, 0), o[0, 0]
|
46
|
+
|
47
|
+
o[0, 0] = color(0, 0, 1)
|
48
|
+
assert_equal color(0, 0, 1, 1), o[0, 0]
|
49
|
+
|
50
|
+
o[0, 0] = color(0, 0, 1, 0)
|
51
|
+
assert_equal color(0, 0, 1, 0), o[0, 0]
|
39
52
|
end
|
40
53
|
|
41
54
|
def test_to_a()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rays
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xot
|