chunky_png_subimage 0.1.0 → 0.1.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/chunky_png_subimage/chunky_png_subimage.c +11 -11
- data/lib/chunky_png_subimage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da20549fc9b756eb7840dfc2bdfdb60b02e943bd
|
4
|
+
data.tar.gz: c05cdb097824ed921eaf11265da07c2873d984e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b9dda54cf3c83b7de078603c3ee938ea278219eab6e77a1aae2a31cb218f5bc0e46d357849ad6b11b606221a91e2c22bb1bf4086b27ab9adc5c087dc3bb41d2
|
7
|
+
data.tar.gz: 14b5c17e1b9daf916d3ac1e8224a0745538784773c72773db159eb2318e39a54acee9ee41ef06fdd25fbe74853285b5861602828fb00d5bd3a3fef9895e374e1
|
@@ -83,7 +83,7 @@ static unsigned int *convert_image(const VALUE *imgPixels, const int imgWidth, c
|
|
83
83
|
int i;
|
84
84
|
for(i = 0; i < imgHeight * imgWidth; i++)
|
85
85
|
{
|
86
|
-
imgReady[i] =
|
86
|
+
imgReady[i] = NUM2UINT(imgPixels[i]);
|
87
87
|
}
|
88
88
|
|
89
89
|
return imgReady;
|
@@ -118,14 +118,14 @@ VALUE search_subimages(int argc, VALUE *argv, VALUE self)
|
|
118
118
|
rb_raise(rb_eArgError, "wrong number of arguments");
|
119
119
|
|
120
120
|
imgPixels = RARRAY_PTR(argv[0]);
|
121
|
-
imgWidth =
|
122
|
-
imgHeight =
|
123
|
-
searchX =
|
124
|
-
searchY =
|
125
|
-
searchWidth =
|
126
|
-
searchHeight =
|
127
|
-
singleMode =
|
128
|
-
amountSubimages =
|
121
|
+
imgWidth = NUM2INT(argv[1]);
|
122
|
+
imgHeight = NUM2INT(argv[2]);
|
123
|
+
searchX = NUM2INT(argv[3]);
|
124
|
+
searchY = NUM2INT(argv[4]);
|
125
|
+
searchWidth = NUM2INT(argv[5]);
|
126
|
+
searchHeight = NUM2INT(argv[6]);
|
127
|
+
singleMode = NUM2INT(argv[7]);
|
128
|
+
amountSubimages = NUM2INT(argv[8]);
|
129
129
|
|
130
130
|
/* some parameters checks */
|
131
131
|
if (searchX < 0)
|
@@ -152,8 +152,8 @@ VALUE search_subimages(int argc, VALUE *argv, VALUE self)
|
|
152
152
|
{
|
153
153
|
/* cur++ inside RARRAY_PTR might not be used as it is used in the macro multiple times */
|
154
154
|
const VALUE *subPixels = RARRAY_PTR(argv[cur]);
|
155
|
-
int subWidth =
|
156
|
-
int subHeight =
|
155
|
+
int subWidth = NUM2INT(argv[cur + 1]);
|
156
|
+
int subHeight = NUM2INT(argv[cur + 2]);
|
157
157
|
const unsigned int *subReady = convert_image(subPixels, subWidth, subHeight);
|
158
158
|
|
159
159
|
VALUE r = search_single_subimage(imgReady, imgWidth, imgHeight,
|