png2swf 0.0.4 → 0.0.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.
@@ -21,6 +21,7 @@ VALUE bitmap_data(VALUE vself, VALUE vpixels) {
21
21
  int pixel_size = RARRAY(vpixels)->len;
22
22
  unsigned long color;
23
23
  int a; // alpha for swf bitmap data
24
+ float a_dash;
24
25
  unsigned char r, g, b; // red, green, blue for swf bitmap data
25
26
  unsigned char data[pixel_size * 4]; // argb for swf bitmap data
26
27
  int i;
@@ -28,9 +29,10 @@ VALUE bitmap_data(VALUE vself, VALUE vpixels) {
28
29
  for (i=0; i<pixel_size; i++) {
29
30
  color = NUM2ULONG((RARRAY(vpixels)->ptr[i]));
30
31
  a = alpha(color);
31
- r = (unsigned char)(red(color) * (a / 255));
32
- g = (unsigned char)(green(color) * (a / 255));
33
- b = (unsigned char)(blue(color) * (a / 255));
32
+ a_dash = a / 255.0;
33
+ r = (unsigned char)(red(color) * a);
34
+ g = (unsigned char)(green(color) * a);
35
+ b = (unsigned char)(blue(color) * a);
34
36
  data[data_index] = a;
35
37
  data[data_index+1] = r;
36
38
  data[data_index+2] = g;
@@ -1,3 +1,3 @@
1
1
  module Png2swf
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: png2swf
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Naoki Maeda