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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05d71b62d0c2ac693fd0eee63afddcb633fdf5a9
4
- data.tar.gz: 437d56c3a25f98974331d2c52856e8072c1e50e2
3
+ metadata.gz: 84b5172bcb2b6651e8e95ebb759ed91475061b74
4
+ data.tar.gz: 9c4a685dcff1e6bf453428fc55c60842a37b268f
5
5
  SHA512:
6
- metadata.gz: 4db7b86426f3642f5ea7cd6ec8f894c57649674a6137b60f7e44c981407020ad14c33a9ae4ab76bcd09ded57c022715ff8d772c4b55f3420f32158434b1f9786
7
- data.tar.gz: 0e382c04c69f405939c9ff729b86ac181b3fd36e071a602599cc169f5b53daf76854dce9aa59d86f2cd944b0199bb8c78106d8b0b8f2af303960750d4cc4bb43
6
+ metadata.gz: 71acc380cf753d4b53b99ecba6cf37d0e3a9f76a94ef2610115cb97b9574771fe047536d173b38d1605b08f9a03cbc7e4f8d60b9e2bf79b22eefb443e01db09b
7
+ data.tar.gz: a1842a2c99e8d9d19025e2535047809d2693797fab2d35f58c9382265e88e4ff65b2fd4d992d7692f6f826d5d542b48ec8a47b1a8021378f4452a5f176c07906
@@ -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);
@@ -1,3 +1,3 @@
1
1
  module RFreeImage
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
data/rfreeimage.gemspec CHANGED
@@ -29,4 +29,5 @@ Gem::Specification.new do |s|
29
29
  desc
30
30
  s.add_development_dependency "rake-compiler", ">= 0.9.0"
31
31
  s.add_development_dependency "minitest", "~> 3.0.0"
32
+ s.add_development_dependency "test-unit"
32
33
  end
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.8
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-06-01 00:00:00.000000000 Z
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