psd_native 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/ext/psd_native/clipping_mask.c +4 -2
- data/lib/psd_native/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c97817e8dc5cc4bc5c152271dec5220be1c72733
|
4
|
+
data.tar.gz: 33ce557f4e155bcabd6e8b6bc33207799e7094a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8616aa6ff2eba454d41b0ea8311f7e815ddbda88bf9689f06a0ecf95a1d10c6f6acc7435bb2ba505c041108e33845aa5f978c350c4169e920856795f960ff1bb
|
7
|
+
data.tar.gz: 8f0ea25002ae6127a6ddc295e0cca45117061d89b82c226d6ed1952563a5a96baedaf97b2d4ca1c2fa3351bc8e251fda7480b5a25597ed6630f96f5633f89f94
|
@@ -11,7 +11,7 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
|
|
11
11
|
VALUE canvas = rb_iv_get(self, "@canvas");
|
12
12
|
VALUE canvas_pixels = psd_canvas_to_pixel_array(canvas);
|
13
13
|
VALUE mask = rb_iv_get(self, "@mask");
|
14
|
-
VALUE
|
14
|
+
VALUE mask_pixels = psd_canvas_to_pixel_array(mask);
|
15
15
|
|
16
16
|
uint32_t canvas_width = FIX2UINT(rb_funcall(canvas, rb_intern("width"), 0));
|
17
17
|
uint32_t canvas_height = FIX2UINT(rb_funcall(canvas, rb_intern("height"), 0));
|
@@ -26,6 +26,7 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
|
|
26
26
|
|
27
27
|
int x, y, doc_x, doc_y, mask_x, mask_y;
|
28
28
|
uint32_t alpha, color, loc;
|
29
|
+
VALUE pixel;
|
29
30
|
for (y = 0; y < canvas_height; y++) {
|
30
31
|
for (x = 0; x < canvas_width; x++) {
|
31
32
|
doc_x = canvas_left + x;
|
@@ -42,7 +43,8 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
|
|
42
43
|
if (loc > mask_pixel_length) {
|
43
44
|
alpha = 0;
|
44
45
|
} else {
|
45
|
-
|
46
|
+
pixel = rb_ary_entry(mask_pixels, loc);
|
47
|
+
alpha = pixel == Qnil ? 0 : A(FIX2UINT(pixel));
|
46
48
|
}
|
47
49
|
}
|
48
50
|
|
data/lib/psd_native/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psd_native
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan LeFevre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: psd
|