wavspa 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/wavspa/fb/rb_fb.c +14 -3
- data/lib/wavspa/common.rb +2 -2
- data/lib/wavspa/version.rb +1 -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: 3625b56c19b4e498a53f7315d2439d4c7f4f75c77b46c7d155b35f4e4cc792c4
|
4
|
+
data.tar.gz: c557a8053812bc666cd5d4a9345442ce297d5fb79b7e12aaf0e28af6aecd5a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c26524dacf4725c2032d5e4ce99eef6c24f52a0fc10416918524e7ace1393a53de44905763b51684c8675b7524e66e28a660c2e22669a36ef9b4ce78ed930467
|
7
|
+
data.tar.gz: fe5a7dbdebd6bf3f41a73f9f0076161794304567326592bcc67eabe4bc012f248edede2066ede39b954f7684304a8a99a6ba1d620b7afc567af526e354a633ce
|
data/ext/wavspa/fb/rb_fb.c
CHANGED
@@ -610,11 +610,14 @@ put_string(rb_fb_t* ptr, int row, int col,
|
|
610
610
|
uint8_t* p0;
|
611
611
|
char* str;
|
612
612
|
int len;
|
613
|
+
int w;
|
614
|
+
int h;
|
613
615
|
|
614
616
|
uint8_t* p;
|
615
617
|
const uint8_t* gl; // as Glyph
|
616
618
|
int i;
|
617
619
|
int j;
|
620
|
+
int k;
|
618
621
|
uint8_t m;
|
619
622
|
|
620
623
|
head = (uint8_t*)RSTRING_PTR(ptr->buf);
|
@@ -622,24 +625,32 @@ put_string(rb_fb_t* ptr, int row, int col,
|
|
622
625
|
p0 = head + ((row * ptr->stride) + (col * 3));
|
623
626
|
str = RSTRING_PTR(rstr);
|
624
627
|
len = RSTRING_LEN(rstr);
|
628
|
+
w = ptr->width + ptr->margin_x;
|
629
|
+
h = ptr->height + ptr->margin_y;
|
625
630
|
|
626
631
|
for (i = 0; i < len; i++) {
|
627
632
|
p = p0 + (i * 6 * 3);
|
628
633
|
gl = font + (str[i] * 10);
|
629
634
|
|
630
635
|
for (j = 0; j < 10; j++) {
|
631
|
-
for (
|
632
|
-
|
636
|
+
for (k = 0; k < 5; k++) {
|
637
|
+
do {
|
638
|
+
if ((col + k < 0) || (row + j < 0)) break;
|
639
|
+
if ((col + k >= w) || (row + j >= h)) break;
|
640
|
+
if (!(gl[j] & (0x80 >> k))) break;
|
641
|
+
|
633
642
|
p[0] = r;
|
634
643
|
p[1] = g;
|
635
644
|
p[2] = b;
|
636
|
-
}
|
645
|
+
} while (0);
|
637
646
|
|
638
647
|
p += 3;
|
639
648
|
}
|
640
649
|
|
641
650
|
p += (ptr->stride - (5 * 3));
|
642
651
|
}
|
652
|
+
|
653
|
+
col += 5;
|
643
654
|
}
|
644
655
|
}
|
645
656
|
|
data/lib/wavspa/common.rb
CHANGED
@@ -32,7 +32,7 @@ module WavSpectrumAnalyzer
|
|
32
32
|
pos = fpos(frq)
|
33
33
|
break if pos >= @output_width
|
34
34
|
|
35
|
-
fb.hline(pos, "#{frq.to_i}Hz")
|
35
|
+
fb.hline(pos, "#{frq.to_i}Hz") if pos >= 0
|
36
36
|
frq = down_step(frq)
|
37
37
|
}
|
38
38
|
|
@@ -44,7 +44,7 @@ module WavSpectrumAnalyzer
|
|
44
44
|
pos = fpos(frq)
|
45
45
|
break if pos <= 0
|
46
46
|
|
47
|
-
fb.hline(pos, "#{frq.to_i}Hz")
|
47
|
+
fb.hline(pos, "#{frq.to_i}Hz") if pos < @output_width
|
48
48
|
frq = up_step(frq)
|
49
49
|
}
|
50
50
|
end
|
data/lib/wavspa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavspa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hirosho Kuwagata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|