rfreeimage 0.1.9 → 0.2.0

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: 84b5172bcb2b6651e8e95ebb759ed91475061b74
4
- data.tar.gz: 9c4a685dcff1e6bf453428fc55c60842a37b268f
3
+ metadata.gz: 5cb4d72821a2692757ac7884a3c3e1d5648aec1a
4
+ data.tar.gz: 8600d968acee4d6e23e2869a5bc9a46d635dc674
5
5
  SHA512:
6
- metadata.gz: 71acc380cf753d4b53b99ecba6cf37d0e3a9f76a94ef2610115cb97b9574771fe047536d173b38d1605b08f9a03cbc7e4f8d60b9e2bf79b22eefb443e01db09b
7
- data.tar.gz: a1842a2c99e8d9d19025e2535047809d2693797fab2d35f58c9382265e88e4ff65b2fd4d992d7692f6f826d5d542b48ec8a47b1a8021378f4452a5f176c07906
6
+ metadata.gz: 881f6afa3eaf93e049d5be9b19c48dd3007b65dfbc06f6d276697f1c812e1bbd4689152959193208211243f80f41f27ed444e50547b1cef4db740265532a12ce
7
+ data.tar.gz: '09baa889f097f74cba721dba6ba3ad8fda1c52ec7b91df41eecfc6db6af7a952509bf4acce371b52dcfece12e1b107edad2c461199b4002fd0542db5b9b3f36c'
@@ -698,6 +698,29 @@ static VALUE Image_draw_rectangle(VALUE self, VALUE _x1, VALUE _y1,
698
698
  return self;
699
699
  }
700
700
 
701
+ static VALUE Image_fill_rectangle(VALUE self, VALUE _x1, VALUE _y1,
702
+ VALUE _x2, VALUE _y2,
703
+ VALUE color)
704
+ {
705
+ struct native_image* img;
706
+ int x1 = NUM2INT(_x1);
707
+ int y1 = NUM2INT(_y1);
708
+ int x2 = NUM2INT(_x2);
709
+ int y2 = NUM2INT(_y2);
710
+ unsigned int bgra = NUM2UINT(color);
711
+
712
+ Data_Get_Struct(self, struct native_image, img);
713
+ RFI_CHECK_IMG(img);
714
+
715
+ int i, j;
716
+ for(i = x1; i <= x2; i++) {
717
+ for(j = y1; j <= y2; j++) {
718
+ FreeImage_SetPixelColor(img->handle, i, img->h - j, (RGBQUAD*)&bgra);
719
+ }
720
+ }
721
+
722
+ return self;
723
+ }
701
724
 
702
725
 
703
726
  void Init_rfreeimage(void)
@@ -735,6 +758,7 @@ void Init_rfreeimage(void)
735
758
  /* draw */
736
759
  rb_define_method(Class_Image, "draw_point", Image_draw_point, 4);
737
760
  rb_define_method(Class_Image, "draw_rectangle", Image_draw_rectangle, 4 + 2);
761
+ rb_define_method(Class_Image, "fill_rectangle", Image_fill_rectangle, 4 + 1);
738
762
 
739
763
  rb_define_singleton_method(Class_Image, "ping", Image_ping, 1);
740
764
  rb_define_singleton_method(Class_Image, "from_blob", Image_from_blob, -1);
@@ -1,3 +1,3 @@
1
1
  module RFreeImage
2
- VERSION = '0.1.9'
2
+ VERSION = '0.2.0'
3
3
  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.9
4
+ version: 0.2.0
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-15 00:00:00.000000000 Z
11
+ date: 2018-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -52,8 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: |2
56
- RFreeImage is the ruby binding for FreeImage library.
55
+ description: " RFreeImage is the ruby binding for FreeImage library.\n"
57
56
  email: chyh1990@gmail.com
58
57
  executables: []
59
58
  extensions:
@@ -938,7 +937,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
938
937
  version: '0'
939
938
  requirements: []
940
939
  rubyforge_project:
941
- rubygems_version: 2.4.8
940
+ rubygems_version: 2.6.8
942
941
  signing_key:
943
942
  specification_version: 4
944
943
  summary: Ruby extension for FreeImage library.