rmagick 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- /* $Id: rmmain.c,v 1.120 2006/06/02 23:26:53 rmagick Exp $ */
1
+ /* $Id: rmmain.c,v 1.124 2006/06/26 23:32:37 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2006 by Timothy P. Hunter
4
4
  | Name: rmmain.c
@@ -710,7 +710,7 @@ Init_RMagick(void)
710
710
  DCL_ATTR_READER(Image, number_colors)
711
711
  DCL_ATTR_ACCESSOR(Image, offset)
712
712
  DCL_ATTR_WRITER(Image, opacity)
713
- DCL_ATTR_READER(Image, orientation)
713
+ DCL_ATTR_ACCESSOR(Image, orientation)
714
714
  DCL_ATTR_ACCESSOR(Image, page)
715
715
  #if defined(HAVE_IMAGE_QUALITY)
716
716
  DCL_ATTR_READER(Image, quality)
@@ -729,12 +729,16 @@ Init_RMagick(void)
729
729
  DCL_ATTR_ACCESSOR(Image, x_resolution)
730
730
  DCL_ATTR_ACCESSOR(Image, y_resolution)
731
731
 
732
+ rb_define_method(Class_Image, "adaptive_sharpen", Image_adaptive_sharpen, -1);
733
+ rb_define_method(Class_Image, "adaptive_sharpen_channel", Image_adaptive_sharpen_channel, -1);
732
734
  rb_define_method(Class_Image, "adaptive_threshold", Image_adaptive_threshold, -1);
733
735
  rb_define_method(Class_Image, "add_noise", Image_add_noise, 1);
734
736
  rb_define_method(Class_Image, "add_noise_channel", Image_add_noise_channel, -1);
735
737
  rb_define_method(Class_Image, "affine_transform", Image_affine_transform, 1);
736
738
  rb_define_method(Class_Image, "[]", Image_aref, 1);
737
739
  rb_define_method(Class_Image, "[]=", Image_aset, 2);
740
+ rb_define_method(Class_Image, "auto_orient", Image_auto_orient, 0);
741
+ rb_define_method(Class_Image, "auto_orient!", Image_auto_orient_bang, 0);
738
742
  rb_define_method(Class_Image, "properties", Image_properties, 0);
739
743
  rb_define_method(Class_Image, "bilevel_channel", Image_bilevel_channel, -1);
740
744
  rb_define_method(Class_Image, "black_threshold", Image_black_threshold, -1);
@@ -763,6 +767,8 @@ Init_RMagick(void)
763
767
  rb_define_method(Class_Image, "composite", Image_composite, -1);
764
768
  rb_define_method(Class_Image, "composite!", Image_composite_bang, -1);
765
769
  rb_define_method(Class_Image, "composite_affine", Image_composite_affine, 2);
770
+ rb_define_method(Class_Image, "composite_channel", Image_composite_channel, -1);
771
+ rb_define_method(Class_Image, "composite_channel!", Image_composite_channel_bang, -1);
766
772
  rb_define_method(Class_Image, "compress_colormap!", Image_compress_colormap_bang, 0);
767
773
  rb_define_method(Class_Image, "contrast", Image_contrast, -1);
768
774
  rb_define_method(Class_Image, "contrast_stretch_channel", Image_contrast_stretch_channel, -1);
@@ -833,6 +839,7 @@ Init_RMagick(void)
833
839
  rb_define_method(Class_Image, "quantize", Image_quantize, -1);
834
840
  rb_define_method(Class_Image, "quantum_operator", Image_quantum_operator, -1);
835
841
  rb_define_method(Class_Image, "radial_blur", Image_radial_blur, 1);
842
+ rb_define_method(Class_Image, "radial_blur_channel", Image_radial_blur_channel, -1);
836
843
  rb_define_method(Class_Image, "raise", Image_raise, -1);
837
844
  rb_define_method(Class_Image, "random_channel_threshold", Image_random_channel_threshold, 2);
838
845
  rb_define_method(Class_Image, "random_threshold_channel", Image_random_threshold_channel, -1);
@@ -876,6 +883,10 @@ Init_RMagick(void)
876
883
  rb_define_method(Class_Image, "to_color", Image_to_color, 1);
877
884
  rb_define_method(Class_Image, "to_blob", Image_to_blob, 0);
878
885
  rb_define_method(Class_Image, "transparent", Image_transparent, -1);
886
+ rb_define_method(Class_Image, "transpose", Image_transpose, 0);
887
+ rb_define_method(Class_Image, "transpose!", Image_transpose_bang, 0);
888
+ rb_define_method(Class_Image, "transverse", Image_transverse, 0);
889
+ rb_define_method(Class_Image, "transverse!", Image_transverse_bang, 0);
879
890
  rb_define_method(Class_Image, "trim", Image_trim, 0);
880
891
  rb_define_method(Class_Image, "trim!", Image_trim_bang, 0);
881
892
  rb_define_method(Class_Image, "unsharp_mask", Image_unsharp_mask, -1);
@@ -995,11 +1006,13 @@ Init_RMagick(void)
995
1006
  // Define the instance methods
996
1007
  rb_define_method(Class_Pixel, "<=>", Pixel_spaceship, 1);
997
1008
  rb_define_method(Class_Pixel, "===", Pixel_case_eq, 1);
1009
+ rb_define_method(Class_Pixel, "eql?", Pixel_eql_q, 1);
998
1010
  rb_define_method(Class_Pixel, "initialize", Pixel_initialize, -1);
999
1011
  rb_define_method(Class_Pixel, "initialize_copy", Pixel_init_copy, 1);
1000
1012
  rb_define_method(Class_Pixel, "clone", Pixel_clone, 0);
1001
1013
  rb_define_method(Class_Pixel, "dup", Pixel_dup, 0);
1002
1014
  rb_define_method(Class_Pixel, "fcmp", Pixel_fcmp, -1);
1015
+ rb_define_method(Class_Pixel, "hash", Pixel_hash, 0);
1003
1016
  rb_define_method(Class_Pixel, "intensity", Pixel_intensity, 0);
1004
1017
  rb_define_method(Class_Pixel, "to_color", Pixel_to_color, -1);
1005
1018
  rb_define_method(Class_Pixel, "to_HSL", Pixel_to_HSL, 0);
@@ -1786,7 +1799,7 @@ static void version_constants(void)
1786
1799
  rb_define_const(Module_Magick, "Version", str);
1787
1800
 
1788
1801
  sprintf(long_version,
1789
- "This is %s ($Date: 2006/06/02 23:26:53 $) Copyright (C) 2006 by Timothy P. Hunter\n"
1802
+ "This is %s ($Date: 2006/06/26 23:32:37 $) Copyright (C) 2006 by Timothy P. Hunter\n"
1790
1803
  "Built with %s\n"
1791
1804
  "Built for %s\n"
1792
1805
  "Web page: http://rmagick.rubyforge.org\n"
@@ -1,4 +1,4 @@
1
- /* $Id: rmutil.c,v 1.76 2006/05/27 21:05:59 rmagick Exp $ */
1
+ /* $Id: rmutil.c,v 1.78 2006/06/28 23:07:55 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2006 by Timothy P. Hunter
4
4
  | Name: rmutil.c
@@ -477,7 +477,7 @@ Pixel_from_color(VALUE class, VALUE name)
477
477
  {
478
478
  PixelPacket pp;
479
479
  ExceptionInfo exception;
480
- boolean okay;
480
+ MagickBooleanType okay;
481
481
 
482
482
  class = class; // defeat "never referenced" message from icc
483
483
 
@@ -611,6 +611,16 @@ Pixel_from_HSL(VALUE class, VALUE hsl)
611
611
  return Pixel_from_PixelPacket(&rgb);
612
612
  }
613
613
 
614
+ /*
615
+ Method: Pixel#eql?
616
+ Purpose: For use with Hash
617
+ */
618
+ VALUE
619
+ Pixel_eql_q(VALUE self, VALUE other)
620
+ {
621
+ return NUM2INT(Pixel_spaceship(self, other)) == 0 ? Qtrue : Qfalse;
622
+ }
623
+
614
624
  /*
615
625
  Method: Pixel#fcmp(other[, fuzz[, colorspace]])
616
626
  Purpose: Compare pixel values for equality
@@ -679,6 +689,30 @@ Pixel_fcmp(int argc, VALUE *argv, VALUE self)
679
689
  return equal ? Qtrue : Qfalse;
680
690
  }
681
691
 
692
+
693
+ /*
694
+ Method: Pixel#hash
695
+ Notes: INT2FIX left-shifts 1 bit. Sacrifice 1 bit
696
+ from the opacity attribute to the FIXNUM_FLAG.
697
+ */
698
+ VALUE
699
+ Pixel_hash(VALUE self)
700
+ {
701
+ Pixel *pixel;
702
+ unsigned int hash;
703
+
704
+ Data_Get_Struct(self, Pixel, pixel);
705
+
706
+ hash = ScaleQuantumToChar(pixel->red) << 24;
707
+ hash += ScaleQuantumToChar(pixel->green) << 16;
708
+ hash += ScaleQuantumToChar(pixel->blue) << 8;
709
+ hash += ScaleQuantumToChar(pixel->opacity);
710
+ hash >>= 1;
711
+
712
+ return INT2FIX(hash);
713
+
714
+ }
715
+
682
716
  /*
683
717
  Method: Pixel#intensity
684
718
  Purpose: Return the "intensity" of a pixel
@@ -1028,7 +1062,7 @@ PixelPacket_to_Color_Name_Info(Info *info, PixelPacket *color)
1028
1062
  static void
1029
1063
  Color_Name_to_PixelPacket(PixelPacket *color, VALUE name_arg)
1030
1064
  {
1031
- boolean okay;
1065
+ MagickBooleanType okay;
1032
1066
  char *name;
1033
1067
  ExceptionInfo exception;
1034
1068
 
File without changes
@@ -1,4 +1,4 @@
1
- # $Id: RMagick.rb,v 1.42 2006/06/03 22:56:40 rmagick Exp $
1
+ # $Id: RMagick.rb,v 1.43 2006/06/20 23:18:22 rmagick Exp $
2
2
  #==============================================================================
3
3
  # Copyright (C) 2006 by Timothy P. Hunter
4
4
  # Name: RMagick.rb
@@ -712,9 +712,14 @@ class Image
712
712
 
713
713
  # (Thanks to Al Evans for the suggestion.)
714
714
  def level(black_point=0.0, white_point=nil, gamma=nil)
715
+ black_point = Float(black_point)
716
+
715
717
  white_point ||= Magick::MaxRGB - black_point
718
+ white_point = Float(white_point)
719
+
716
720
  gamma_arg = gamma
717
721
  gamma ||= 1.0
722
+ gamma = Float(gamma)
718
723
 
719
724
  if gamma.abs > 10.0 || white_point.abs <= 10.0 || white_point.abs < gamma.abs
720
725
  gamma, white_point = white_point, gamma
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{rmagick}
4
- s.version = "1.12.0"
4
+ s.version = "1.13.0"
5
5
  s.date = Date.today.to_s
6
6
  s.summary = %q{RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.}
7
7
  s.description =<<DESCRIPTION
@@ -14,7 +14,7 @@ DESCRIPTION
14
14
  s.files = Dir.glob('**/*')
15
15
  s.require_paths = %w{lib .}
16
16
  s.rubyforge_project = %q{rmagick}
17
- s.extensions = %w{gem_config.rb}
17
+ s.extensions = %w{gem_extconf.rb}
18
18
  s.has_rdoc = false
19
19
  s.required_ruby_version = '>= 1.6.7'
20
20
  s.requirements << 'ImageMagick 6.0.0 or later, or GraphicsMagick 1.0.0 or later'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.8.99.1
3
3
  specification_version: 1
4
4
  name: rmagick
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.12.0
7
- date: 2006-06-03 00:00:00 -04:00
6
+ version: 1.13.0
7
+ date: 2006-06-28 00:00:00 -04:00
8
8
  summary: RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.
9
9
  require_paths:
10
10
  - lib
@@ -26,6 +26,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
26
26
  platform: ruby
27
27
  signing_key:
28
28
  cert_chain:
29
+ post_install_message:
29
30
  authors:
30
31
  - Tim Hunter
31
32
  files:
@@ -36,7 +37,7 @@ files:
36
37
  - README-Mac-OSX.txt
37
38
  - README.txt
38
39
  - configure.ac
39
- - gem_config.rb
40
+ - gem_extconf.rb
40
41
  - metaconfig.in
41
42
  - post-clean.rb
42
43
  - post-install.rb
@@ -248,6 +249,8 @@ files:
248
249
  - doc/ex/to_blob.rb
249
250
  - doc/ex/translate.rb
250
251
  - doc/ex/transparent.rb
252
+ - doc/ex/transpose.rb
253
+ - doc/ex/transverse.rb
251
254
  - doc/ex/tref01.rb
252
255
  - doc/ex/triangle01.rb
253
256
  - doc/ex/trim.rb
@@ -382,7 +385,7 @@ extra_rdoc_files: []
382
385
  executables: []
383
386
 
384
387
  extensions:
385
- - gem_config.rb
388
+ - gem_extconf.rb
386
389
  requirements:
387
390
  - ImageMagick 6.0.0 or later, or GraphicsMagick 1.0.0 or later
388
391
  dependencies: []