rfreeimage 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rfreeimage/rfi_main.c +16 -1
- data/lib/rfreeimage/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: a4b988773094fee17bb5d9dc7815ec8d2c44f053
|
4
|
+
data.tar.gz: 1fad08335ed9ba58ff109715254b73293d0e59bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3bd93eafac76ce447ae422ed096a4a9aa0b0922693cc59f9e7d7e96f15aa5cf902562dec048cd8e5c3703254373a42fc29d42c138e1f017c8ec6082f3e76651
|
7
|
+
data.tar.gz: 60ed61b07b748c07caa421861300cb5f4cf49768b8475fc42d380b183d9192a329c5b42d6948fbd01c9a85045469f35272a29f5658a0f13fcb66a54fc4a22564
|
data/ext/rfreeimage/rfi_main.c
CHANGED
@@ -16,6 +16,15 @@ static void __rfi_module_uninit() {
|
|
16
16
|
FreeImage_DeInitialise();
|
17
17
|
}
|
18
18
|
|
19
|
+
static void try_sort(int *x, int *y)
|
20
|
+
{
|
21
|
+
if(*y < *x ){
|
22
|
+
int tmp = *x;
|
23
|
+
*x = *y;
|
24
|
+
*y = tmp;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
19
28
|
static VALUE rb_rfi_version(VALUE self)
|
20
29
|
{
|
21
30
|
return rb_ary_new3(3, INT2NUM(FREEIMAGE_MAJOR_VERSION),
|
@@ -681,6 +690,9 @@ static VALUE Image_draw_rectangle(VALUE self, VALUE _x1, VALUE _y1,
|
|
681
690
|
Data_Get_Struct(self, struct native_image, img);
|
682
691
|
RFI_CHECK_IMG(img);
|
683
692
|
|
693
|
+
try_sort(&x1, &x2);
|
694
|
+
try_sort(&y1, &y2);
|
695
|
+
|
684
696
|
for(i = -hs; i <= hs; i++) {
|
685
697
|
for(j = x1; j <= x2; j++) {
|
686
698
|
FreeImage_SetPixelColor(img->handle, j, img->h - (y1 + i) - 1, (RGBQUAD*)&bgra);
|
@@ -708,11 +720,14 @@ static VALUE Image_fill_rectangle(VALUE self, VALUE _x1, VALUE _y1,
|
|
708
720
|
int x2 = NUM2INT(_x2);
|
709
721
|
int y2 = NUM2INT(_y2);
|
710
722
|
unsigned int bgra = NUM2UINT(color);
|
723
|
+
int i, j;
|
711
724
|
|
712
725
|
Data_Get_Struct(self, struct native_image, img);
|
713
726
|
RFI_CHECK_IMG(img);
|
714
727
|
|
715
|
-
|
728
|
+
try_sort(&x1, &x2);
|
729
|
+
try_sort(&y1, &y2);
|
730
|
+
|
716
731
|
for(i = x1; i <= x2; i++) {
|
717
732
|
for(j = y1; j <= y2; j++) {
|
718
733
|
FreeImage_SetPixelColor(img->handle, i, img->h - j, (RGBQUAD*)&bgra);
|
data/lib/rfreeimage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfreeimage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuheng Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|