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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 016b7487caeb4a42705bb51e79db41769ba020fe43f7aca190c71f08333cda53
4
- data.tar.gz: 7fe6ee374e29d9b47c74944959ab4f0cd9a525821a1cb7e55bb1204de025c4f1
3
+ metadata.gz: 3625b56c19b4e498a53f7315d2439d4c7f4f75c77b46c7d155b35f4e4cc792c4
4
+ data.tar.gz: c557a8053812bc666cd5d4a9345442ce297d5fb79b7e12aaf0e28af6aecd5a38
5
5
  SHA512:
6
- metadata.gz: 44df366c15ba55ca2ec19c077d140cf3c1c85caa37d855d43b1c40ebfd515af0f910d1a46776f9d12f7ea99496ffcb1d854b85d8d6a0fc1726c7f63510793aec
7
- data.tar.gz: 3e2316a4d6c88748c25ea5e5635ad0f915f1dd716a9e8c701870a9945b3247fd0bdfdb3dceea0fbaac47f87ab669a5c91aa88184f7bfe750a992ddb2fcbd13ed
6
+ metadata.gz: c26524dacf4725c2032d5e4ce99eef6c24f52a0fc10416918524e7ace1393a53de44905763b51684c8675b7524e66e28a660c2e22669a36ef9b4ce78ed930467
7
+ data.tar.gz: fe5a7dbdebd6bf3f41a73f9f0076161794304567326592bcc67eabe4bc012f248edede2066ede39b954f7684304a8a99a6ba1d620b7afc567af526e354a633ce
@@ -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 (m = 0x80; m >= 0x08; m >>= 1) {
632
- if ((gl[j] & m) && (p + 0 >= head) && (p + 3 < tail)) {
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module WavSpectrumAnalyzer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2019-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler