png2swf 0.0.5 → 0.0.6
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.
- data/ext/oily_png2swf/oily_png2swf_ext.c +8 -9
- data/lib/png2swf/version.rb +1 -1
- metadata +3 -3
@@ -26,18 +26,17 @@ VALUE bitmap_data(VALUE vself, VALUE vpixels) {
|
|
26
26
|
unsigned char data[pixel_size * 4]; // argb for swf bitmap data
|
27
27
|
int i;
|
28
28
|
int data_index = 0;
|
29
|
-
for (i=0; i<pixel_size; i
|
29
|
+
for (i=0; i<pixel_size; ++i) {
|
30
30
|
color = NUM2ULONG((RARRAY(vpixels)->ptr[i]));
|
31
31
|
a = alpha(color);
|
32
32
|
a_dash = a / 255.0;
|
33
|
-
r = (unsigned char)(red(color) *
|
34
|
-
g = (unsigned char)(green(color) *
|
35
|
-
b = (unsigned char)(blue(color) *
|
36
|
-
data[data_index] = a;
|
37
|
-
data[data_index
|
38
|
-
data[data_index
|
39
|
-
data[data_index
|
40
|
-
data_index+=4;
|
33
|
+
r = (unsigned char)(red(color) * a_dash);
|
34
|
+
g = (unsigned char)(green(color) * a_dash);
|
35
|
+
b = (unsigned char)(blue(color) * a_dash);
|
36
|
+
data[data_index] = a; ++data_index;
|
37
|
+
data[data_index] = r; ++data_index;
|
38
|
+
data[data_index] = g; ++data_index;
|
39
|
+
data[data_index] = b; ++data_index;
|
41
40
|
}
|
42
41
|
VALUE vdata = rb_str_new(0,0); // 戻り値用にrubyの空文字を作成 vdata = '' と同じ
|
43
42
|
rb_str_cat(vdata, data, (pixel_size * 4)); // rubyの文字列としてバイナリデータを連結
|
data/lib/png2swf/version.rb
CHANGED
metadata
CHANGED