rfreeimage 0.1.8 → 0.1.9
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 +26 -0
- data/lib/rfreeimage/version.rb +1 -1
- data/rfreeimage.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84b5172bcb2b6651e8e95ebb759ed91475061b74
|
4
|
+
data.tar.gz: 9c4a685dcff1e6bf453428fc55c60842a37b268f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71acc380cf753d4b53b99ecba6cf37d0e3a9f76a94ef2610115cb97b9574771fe047536d173b38d1605b08f9a03cbc7e4f8d60b9e2bf79b22eefb443e01db09b
|
7
|
+
data.tar.gz: a1842a2c99e8d9d19025e2535047809d2693797fab2d35f58c9382265e88e4ff65b2fd4d992d7692f6f826d5d542b48ec8a47b1a8021378f4452a5f176c07906
|
data/ext/rfreeimage/rfi_main.c
CHANGED
@@ -501,6 +501,30 @@ static VALUE Image_downscale(VALUE self, VALUE max_size) {
|
|
501
501
|
return rfi_get_image(nh);
|
502
502
|
}
|
503
503
|
|
504
|
+
static VALUE Image_flip_horizontal(VALUE self) {
|
505
|
+
struct native_image *img;
|
506
|
+
FIBITMAP *nh;
|
507
|
+
|
508
|
+
Data_Get_Struct(self, struct native_image, img);
|
509
|
+
RFI_CHECK_IMG(img);
|
510
|
+
nh = FreeImage_Clone(img->handle);
|
511
|
+
if(FreeImage_FlipHorizontal(nh) == FALSE)
|
512
|
+
rb_raise(Class_RFIError, "Malloc Failed");
|
513
|
+
return rfi_get_image(nh);
|
514
|
+
}
|
515
|
+
|
516
|
+
static VALUE Image_flip_vertical(VALUE self) {
|
517
|
+
struct native_image *img;
|
518
|
+
FIBITMAP *nh;
|
519
|
+
|
520
|
+
Data_Get_Struct(self, struct native_image, img);
|
521
|
+
RFI_CHECK_IMG(img);
|
522
|
+
nh = FreeImage_Clone(img->handle);
|
523
|
+
if(FreeImage_FlipVertical(nh) == FALSE)
|
524
|
+
rb_raise(Class_RFIError, "Malloc Failed");
|
525
|
+
return rfi_get_image(nh);
|
526
|
+
}
|
527
|
+
|
504
528
|
static VALUE Image_crop(VALUE self, VALUE _left, VALUE _top, VALUE _right, VALUE _bottom)
|
505
529
|
{
|
506
530
|
struct native_image *img;
|
@@ -705,6 +729,8 @@ void Init_rfreeimage(void)
|
|
705
729
|
rb_define_method(Class_Image, "downscale", Image_downscale, 1);
|
706
730
|
rb_define_method(Class_Image, "crop", Image_crop, 4);
|
707
731
|
rb_define_method(Class_Image, "to_blob", Image_to_blob, 1);
|
732
|
+
rb_define_method(Class_Image, "flip_horizontal", Image_flip_horizontal, 0);
|
733
|
+
rb_define_method(Class_Image, "flip_vertical", Image_flip_vertical, 0);
|
708
734
|
|
709
735
|
/* draw */
|
710
736
|
rb_define_method(Class_Image, "draw_point", Image_draw_point, 4);
|
data/lib/rfreeimage/version.rb
CHANGED
data/rfreeimage.gemspec
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.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuheng Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: |2
|
42
56
|
RFreeImage is the ruby binding for FreeImage library.
|
43
57
|
email: chyh1990@gmail.com
|