rmagick 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

Files changed (55) hide show
  1. data/ChangeLog +17 -0
  2. data/README.html +21 -46
  3. data/README.txt +18 -40
  4. data/build_tarball.rake +11 -2
  5. data/doc/comtasks.html +5 -5
  6. data/doc/constants.html +272 -241
  7. data/doc/draw.html +5 -5
  8. data/doc/ex/mask.rb +2 -2
  9. data/doc/ilist.html +9 -9
  10. data/doc/image1.html +164 -16
  11. data/doc/image2.html +105 -8
  12. data/doc/image3.html +8 -8
  13. data/doc/imageattrs.html +4 -137
  14. data/doc/imusage.html +3 -3
  15. data/doc/index.html +9 -9
  16. data/doc/info.html +5 -5
  17. data/doc/magick.html +30 -70
  18. data/doc/optequiv.html +19 -39
  19. data/doc/rvg.html +5 -5
  20. data/doc/rvgclip.html +2 -2
  21. data/doc/rvggroup.html +2 -2
  22. data/doc/rvgimage.html +3 -3
  23. data/doc/rvgpattern.html +3 -3
  24. data/doc/rvgshape.html +2 -2
  25. data/doc/rvgstyle.html +2 -2
  26. data/doc/rvgtext.html +6 -6
  27. data/doc/rvgtspan.html +4 -4
  28. data/doc/rvgtut.html +9 -9
  29. data/doc/rvguse.html +3 -3
  30. data/doc/rvgxform.html +2 -2
  31. data/doc/struct.html +54 -19
  32. data/doc/usage.html +11 -3
  33. data/ext/RMagick/MANIFEST +1 -1
  34. data/ext/RMagick/extconf.rb +8 -23
  35. data/ext/RMagick/rmagick.h +10 -5
  36. data/ext/RMagick/rmdraw.c +7 -8
  37. data/ext/RMagick/rmimage.c +186 -20
  38. data/ext/RMagick/rmmain.c +32 -12
  39. data/ext/RMagick/rmutil.c +171 -28
  40. data/lib/RMagick.rb +7 -7
  41. data/lib/rvg/clippath.rb +2 -2
  42. data/lib/rvg/container.rb +2 -2
  43. data/lib/rvg/describable.rb +2 -2
  44. data/lib/rvg/embellishable.rb +2 -2
  45. data/lib/rvg/misc.rb +2 -2
  46. data/lib/rvg/paint.rb +7 -2
  47. data/lib/rvg/pathdata.rb +2 -2
  48. data/lib/rvg/rvg.rb +3 -3
  49. data/lib/rvg/stretchable.rb +15 -3
  50. data/lib/rvg/stylable.rb +2 -2
  51. data/lib/rvg/text.rb +2 -2
  52. data/lib/rvg/transformable.rb +2 -2
  53. data/lib/rvg/units.rb +2 -2
  54. data/rmagick.gemspec +1 -1
  55. metadata +3 -3
data/ext/RMagick/rmutil.c CHANGED
@@ -1,4 +1,4 @@
1
- /* $Id: rmutil.c,v 1.146 2008/01/20 17:29:42 rmagick Exp $ */
1
+ /* $Id: rmutil.c,v 1.153 2008/03/29 15:19:15 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2008 by Timothy P. Hunter
4
4
  | Name: rmutil.c
@@ -18,6 +18,7 @@ static VALUE Enum_type_inspect(VALUE);
18
18
  static void handle_exception(ExceptionInfo *, Image *, ErrorRetention);
19
19
  static VALUE Pixel_from_MagickPixelPacket(MagickPixelPacket *);
20
20
 
21
+ #define ENUMERATORS_CLASS_VAR "@@enumerators"
21
22
 
22
23
  /*
23
24
  Extern: magick_safe_malloc, magick_malloc, magick_free, magick_realloc
@@ -229,7 +230,7 @@ rm_no_freeze(VALUE obj)
229
230
 
230
231
  /*
231
232
  Extern: rm_str2cstr(str, &len);
232
- Purpose: Supply our own version of the "obsolete" rm_str2cstr.
233
+ Purpose: Supply our own version of the "obsolete" rb_str2cstr.
233
234
  */
234
235
  char *
235
236
  rm_str2cstr(VALUE str, long *len)
@@ -569,10 +570,27 @@ Pixel_from_color(VALUE class, VALUE name)
569
570
  return Pixel_from_PixelPacket(&pp);
570
571
  }
571
572
 
573
+
572
574
  /*
573
- Method: Magick::Pixel#to_color(compliance=Magick::???Compliance,
574
- matte=False
575
- depth=QuantumDepth)
575
+ Static: rm_set_magick_pixel_packet
576
+ Purpose: Convert a PixelPacket to a MagickPixelPacket
577
+ Notes: Same code as the private function SetMagickPixelPacket
578
+ in ImageMagick.
579
+ */
580
+ static void rm_set_magick_pixel_packet(Pixel *pixel, IndexPacket *index, MagickPixelPacket *pp)
581
+ {
582
+ pp->red = (MagickRealType) pixel->red;
583
+ pp->green = (MagickRealType) pixel->green;
584
+ pp->blue = (MagickRealType) pixel->blue;
585
+ pp->opacity = (MagickRealType) (pp->matte ? pixel->opacity : OpaqueOpacity);
586
+ pp->index = (MagickRealType) ((pp->colorspace == CMYKColorspace) && (index ? *index : 0));
587
+ }
588
+
589
+
590
+
591
+ /*
592
+ Method: Magick::Pixel#to_color(compliance=AllCompliance, matte=false,
593
+ depth=QuantumDepth, hex=false)
576
594
  Purpose: return the color name corresponding to the pixel values
577
595
  Notes: the conversion respects the value of the 'opacity' field
578
596
  in the Pixel.
@@ -583,6 +601,8 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
583
601
  Info *info;
584
602
  Image *image;
585
603
  Pixel *pixel;
604
+ MagickPixelPacket mpp;
605
+ MagickBooleanType hex = MagickFalse;
586
606
  char name[MaxTextExtent];
587
607
  ExceptionInfo exception;
588
608
  ComplianceType compliance = AllCompliance;
@@ -591,6 +611,8 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
591
611
 
592
612
  switch (argc)
593
613
  {
614
+ case 4:
615
+ hex = RTEST(argv[3]);
594
616
  case 3:
595
617
  depth = NUM2UINT(argv[2]);
596
618
 
@@ -626,8 +648,12 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
626
648
  image->depth = depth;
627
649
  image->matte = matte;
628
650
  (void) DestroyImageInfo(info);
651
+
652
+ GetMagickPixelPacket(image, &mpp);
653
+ rm_set_magick_pixel_packet(pixel, NULL, &mpp);
654
+
629
655
  GetExceptionInfo(&exception);
630
- (void) QueryColorname(image, pixel, compliance, name, &exception);
656
+ (void) QueryMagickColorname(image, &mpp, compliance, hex, name, &exception);
631
657
  (void) DestroyImage(image);
632
658
  CHECK_EXCEPTION()
633
659
  (void) DestroyExceptionInfo(&exception);
@@ -637,7 +663,7 @@ Pixel_to_color(int argc, VALUE *argv, VALUE self)
637
663
  }
638
664
 
639
665
  /*
640
- Method: Pixel#to_HSL
666
+ Method: Pixel#to_HSL *** DEPRECATED ***
641
667
  Purpose: Converts an RGB pixel to the array
642
668
  [hue, saturation, luminosity].
643
669
  */
@@ -650,6 +676,7 @@ Pixel_to_HSL(VALUE self)
650
676
 
651
677
  Data_Get_Struct(self, Pixel, pixel);
652
678
  #if defined(HAVE_CONVERTRGBTOHSL)
679
+ rb_warning("Pixel#to_HSL is deprecated; use to_hsla");
653
680
  ConvertRGBToHSL(pixel->red, pixel->green, pixel->blue, &hue, &saturation, &luminosity);
654
681
  #else
655
682
  TransformHSL(pixel->red, pixel->green, pixel->blue, &hue, &saturation, &luminosity);
@@ -662,7 +689,7 @@ Pixel_to_HSL(VALUE self)
662
689
  }
663
690
 
664
691
  /*
665
- Method: Pixel.from_HSL
692
+ Method: Pixel.from_HSL *** DEPRECATED ***
666
693
  Purpose: Constructs an RGB pixel from the array
667
694
  [hue, saturation, luminosity].
668
695
  */
@@ -686,6 +713,7 @@ Pixel_from_HSL(VALUE class, VALUE hsl)
686
713
  luminosity = NUM2DBL(rb_ary_entry(hsl, 2));
687
714
 
688
715
  #if defined(HAVE_CONVERTHSLTORGB)
716
+ rb_warning("Pixel#from_HSL is deprecated; use from_hsla");
689
717
  ConvertHSLToRGB(hue, saturation, luminosity,
690
718
  &rgb.red, &rgb.green, &rgb.blue);
691
719
  #else
@@ -695,6 +723,119 @@ Pixel_from_HSL(VALUE class, VALUE hsl)
695
723
  return Pixel_from_PixelPacket(&rgb);
696
724
  }
697
725
 
726
+
727
+
728
+ /*
729
+ Method: Pixel#from_hsla(hue, saturation, lightness, alpha=1)
730
+ Purpose: Replace brain-dead from_HSL, above.
731
+ Notes: 0 <= hue < 360, 0 <= saturation <= 1, 0 <= lightness <= 1
732
+ 0 <= alpha <= 1 (0 is transparent, 1 is opaque)
733
+ */
734
+ VALUE
735
+ Pixel_from_hsla(int argc, VALUE *argv, VALUE class)
736
+ {
737
+ double h, s, l, a = 1.0;
738
+ MagickPixelPacket pp;
739
+ ExceptionInfo exception;
740
+ char name[50];
741
+ MagickBooleanType alpha = MagickFalse;
742
+
743
+ class = class; // defeat "unused parameter" message.
744
+
745
+ switch (argc)
746
+ {
747
+ case 4:
748
+ a = NUM2DBL(argv[3]);
749
+ alpha = MagickTrue;
750
+ case 3:
751
+ l = NUM2DBL(argv[2]);
752
+ s = NUM2DBL(argv[1]);
753
+ h = NUM2DBL(argv[0]);
754
+ break;
755
+ default:
756
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 3 or 4)", argc);
757
+ break;
758
+ }
759
+
760
+ if (alpha && (a < 0.0 || a > 1.0))
761
+ {
762
+ rb_raise(rb_eRangeError, "alpha %g out of range [0.0, 1.0]", a);
763
+ }
764
+ if (l < 0.0 || l > 100.0)
765
+ {
766
+ rb_raise(rb_eRangeError, "lightness %g out of range [0.0, 100.0]", l);
767
+ }
768
+ if (s < 0.0 || s > 100.0)
769
+ {
770
+ rb_raise(rb_eRangeError, "saturation %g out of range [0.0, 100.0]", s);
771
+ }
772
+ if (h < 0.0 || h >= 360.0)
773
+ {
774
+ rb_raise(rb_eRangeError, "hue %g out of range [0.0, 360.0)", h);
775
+ }
776
+
777
+ memset(name, 0, sizeof(name));
778
+ if (alpha)
779
+ {
780
+ sprintf(name, "hsla(%-2.1f,%-2.1f,%-2.1f,%-2.1f)", h, s, l, a);
781
+ }
782
+ else
783
+ {
784
+ sprintf(name, "hsl(%-2.1f,%-2.1f,%-2.1f)", h, s, l);
785
+ }
786
+
787
+ GetExceptionInfo(&exception);
788
+
789
+ (void) QueryMagickColor(name, &pp, &exception);
790
+ CHECK_EXCEPTION()
791
+
792
+ (void) DestroyExceptionInfo(&exception);
793
+
794
+ return Pixel_from_MagickPixelPacket(&pp);
795
+ }
796
+
797
+
798
+ /*
799
+ Method: Pixel#to_hsla()
800
+ Purpose: Replace brain-dead to_HSL, above.
801
+ Notes: Returns [hue, saturation, lightness, alpha] in the same ranges as from_hsla()
802
+ */
803
+ VALUE
804
+ Pixel_to_hsla(VALUE self)
805
+ {
806
+ double hue, sat, lum, alpha;
807
+ Pixel *pixel;
808
+ volatile VALUE hsla;
809
+
810
+ Data_Get_Struct(self, Pixel, pixel);
811
+
812
+ #if defined(HAVE_CONVERTRGBTOHSL)
813
+ ConvertRGBToHSL(pixel->red, pixel->green, pixel->blue, &hue, &sat, &lum);
814
+ #else
815
+ TransformHSL(pixel->red, pixel->green, pixel->blue, &hue, &sat, &lum);
816
+ #endif
817
+ hue *= 360.0;
818
+ sat *= 100.0;
819
+ lum *= 100.0;
820
+
821
+ if (pixel->opacity == OpaqueOpacity)
822
+ {
823
+ alpha = 1.0;
824
+ }
825
+ else if (pixel->opacity == TransparentOpacity)
826
+ {
827
+ alpha = 0.0;
828
+ }
829
+ else
830
+ {
831
+ alpha = ROUND_TO_QUANTUM(QuantumRange - (pixel->opacity / QuantumRange));
832
+ }
833
+
834
+ hsla = rb_ary_new3(4, rb_float_new(hue), rb_float_new(sat), rb_float_new(lum), rb_float_new(alpha));
835
+ return hsla;
836
+ }
837
+
838
+
698
839
  /*
699
840
  Method: Pixel#eql?
700
841
  Purpose: For use with Hash
@@ -1395,6 +1536,15 @@ CompressionType_name(CompressionType ct)
1395
1536
  ENUM_TO_NAME(UndefinedCompression)
1396
1537
  ENUM_TO_NAME(NoCompression)
1397
1538
  ENUM_TO_NAME(BZipCompression)
1539
+ #if defined(HAVE_ENUM_DXT1COMPRESSION)
1540
+ ENUM_TO_NAME(DXT1Compression)
1541
+ #endif
1542
+ #if defined(HAVE_ENUM_DXT3COMPRESSION)
1543
+ ENUM_TO_NAME(DXT3Compression)
1544
+ #endif
1545
+ #if defined(HAVE_ENUM_DXT5COMPRESSION)
1546
+ ENUM_TO_NAME(DXT5Compression)
1547
+ #endif
1398
1548
  ENUM_TO_NAME(FaxCompression)
1399
1549
  ENUM_TO_NAME(Group4Compression)
1400
1550
  ENUM_TO_NAME(JPEGCompression)
@@ -2627,7 +2777,7 @@ VALUE rm_enum_new(VALUE class, VALUE sym, VALUE val)
2627
2777
 
2628
2778
  argv[0] = sym;
2629
2779
  argv[1] = val;
2630
- return rb_class_new_instance(2, argv, class);
2780
+ return rb_obj_freeze(rb_class_new_instance(2, argv, class));
2631
2781
  }
2632
2782
 
2633
2783
  /*
@@ -2640,7 +2790,7 @@ VALUE Enum_alloc(VALUE class)
2640
2790
  volatile VALUE enumr;
2641
2791
 
2642
2792
  enumr = Data_Make_Struct(class, MagickEnum, NULL, NULL, magick_enum);
2643
- OBJ_FREEZE(enumr);
2793
+ rb_obj_freeze(enumr);
2644
2794
  return enumr;
2645
2795
  }
2646
2796
 
@@ -2749,16 +2899,12 @@ VALUE Enum_type_initialize(VALUE self, VALUE sym, VALUE val)
2749
2899
  super_argv[1] = val;
2750
2900
  (void) rb_call_super(2, (VALUE *)super_argv);
2751
2901
 
2752
- if (rb_cvar_defined(CLASS_OF(self), rm_ID_enumerators) != Qtrue)
2902
+ if (rb_cvar_defined(CLASS_OF(self), rb_intern(ENUMERATORS_CLASS_VAR)) != Qtrue)
2753
2903
  {
2754
- #if defined(HAVE_NEW_RB_CVAR_SET)
2755
- rb_cvar_set(CLASS_OF(self), rm_ID_enumerators, rb_ary_new());
2756
- #else
2757
- rb_cvar_set(CLASS_OF(self), rm_ID_enumerators, rb_ary_new(), 0);
2758
- #endif
2904
+ rb_cv_set(CLASS_OF(self), ENUMERATORS_CLASS_VAR, rb_ary_new());
2759
2905
  }
2760
2906
 
2761
- enumerators = rb_cvar_get(CLASS_OF(self), rm_ID_enumerators);
2907
+ enumerators = rb_cv_get(CLASS_OF(self), ENUMERATORS_CLASS_VAR);
2762
2908
  (void) rb_ary_push(enumerators, self);
2763
2909
 
2764
2910
  return self;
@@ -2792,7 +2938,7 @@ static VALUE Enum_type_values(VALUE class)
2792
2938
  volatile VALUE rv;
2793
2939
  int x;
2794
2940
 
2795
- enumerators = rb_cvar_get(class, rm_ID_enumerators);
2941
+ enumerators = rb_cv_get(class, ENUMERATORS_CLASS_VAR);
2796
2942
 
2797
2943
  if (rb_block_given_p())
2798
2944
  {
@@ -2809,7 +2955,7 @@ static VALUE Enum_type_values(VALUE class)
2809
2955
  {
2810
2956
  (void) rb_ary_push(copy, rb_ary_entry(enumerators, x));
2811
2957
  }
2812
- OBJ_FREEZE(copy);
2958
+ rb_obj_freeze(copy);
2813
2959
  rv = copy;
2814
2960
  }
2815
2961
 
@@ -2940,6 +3086,8 @@ rm_write_temp_image(Image *image, char *tmpnam)
2940
3086
  {
2941
3087
 
2942
3088
  #if defined(HAVE_SETIMAGEREGISTRY)
3089
+ #define TMPNAM_CLASS_VAR "@@_tmpnam_"
3090
+
2943
3091
  MagickBooleanType okay;
2944
3092
  ExceptionInfo exception;
2945
3093
  volatile VALUE id_value;
@@ -2949,24 +3097,19 @@ rm_write_temp_image(Image *image, char *tmpnam)
2949
3097
 
2950
3098
 
2951
3099
  // 'id' is always the value of its previous use
2952
- if (rb_cvar_defined(Module_Magick, rm_ID__tmpnam_) == Qtrue)
3100
+ if (rb_cvar_defined(Module_Magick, rb_intern(TMPNAM_CLASS_VAR)) == Qtrue)
2953
3101
  {
2954
- id_value = rb_cvar_get(Module_Magick, rm_ID__tmpnam_);
3102
+ id_value = rb_cv_get(Module_Magick, TMPNAM_CLASS_VAR);
2955
3103
  id = FIX2INT(id_value);
2956
3104
  }
2957
3105
  else
2958
3106
  {
2959
3107
  id = 0;
2960
- rb_define_class_variable(Module_Magick, "@@__tmpnam__", INT2FIX(id));
3108
+ rb_cv_set(Module_Magick, TMPNAM_CLASS_VAR, INT2FIX(id));
2961
3109
  }
2962
3110
 
2963
3111
  id += 1;
2964
- #if defined(HAVE_NEW_RB_CVAR_SET)
2965
- rb_cvar_set(Module_Magick, rm_ID__tmpnam_, INT2FIX(id));
2966
- #else
2967
- rb_cvar_set(Module_Magick, rm_ID__tmpnam_, INT2FIX(id), 0);
2968
- #endif
2969
-
3112
+ rb_cv_set(Module_Magick, TMPNAM_CLASS_VAR, INT2FIX(id));
2970
3113
  sprintf(tmpnam, "mpri:%d", id);
2971
3114
 
2972
3115
  // Omit "mpri:" from filename to form the key
data/lib/RMagick.rb CHANGED
@@ -1,6 +1,6 @@
1
- # $Id: RMagick.rb,v 1.65 2008/01/25 00:43:01 rmagick Exp $
1
+ # $Id: RMagick.rb,v 1.67 2008/03/14 23:02:02 rmagick Exp $
2
2
  #==============================================================================
3
- # Copyright (C) 2007 by Timothy P. Hunter
3
+ # Copyright (C) 2008 by Timothy P. Hunter
4
4
  # Name: RMagick.rb
5
5
  # Author: Tim Hunter
6
6
  # Purpose: Extend Ruby to interface with ImageMagick.
@@ -32,11 +32,11 @@ class GeometryValue < Enum
32
32
  # no methods
33
33
  end
34
34
 
35
- PercentGeometry = GeometryValue.new(:PercentGeometry, 1)
36
- AspectGeometry = GeometryValue.new(:AspectGeometry, 2)
37
- LessGeometry = GeometryValue.new(:LessGeometry, 3)
38
- GreaterGeometry = GeometryValue.new(:GreaterGeometry, 4)
39
- AreaGeometry = GeometryValue.new(:AreaGeometry, 5)
35
+ PercentGeometry = GeometryValue.new(:PercentGeometry, 1).freeze
36
+ AspectGeometry = GeometryValue.new(:AspectGeometry, 2).freeze
37
+ LessGeometry = GeometryValue.new(:LessGeometry, 3).freeze
38
+ GreaterGeometry = GeometryValue.new(:GreaterGeometry, 4).freeze
39
+ AreaGeometry = GeometryValue.new(:AreaGeometry, 5).freeze
40
40
 
41
41
  class Geometry
42
42
  FLAGS = ['', '%', '!', '<', '>', '@']
data/lib/rvg/clippath.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: clippath.rb,v 1.3 2007/01/20 17:39:48 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: clippath.rb,v 1.4 2008/02/24 18:26:36 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
  module Magick
6
6
  class RVG
data/lib/rvg/container.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: container.rb,v 1.3 2007/01/20 17:39:49 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: container.rb,v 1.4 2008/02/24 18:26:36 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
 
6
6
  module Magick
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: describable.rb,v 1.3 2007/01/20 17:39:49 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: describable.rb,v 1.4 2008/02/24 18:26:36 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
 
6
6
  module Magick
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: embellishable.rb,v 1.7 2007/01/20 17:39:49 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: embellishable.rb,v 1.8 2008/02/24 18:26:36 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
 
6
6
  module Magick
data/lib/rvg/misc.rb CHANGED
@@ -1,5 +1,5 @@
1
- # $Id: misc.rb,v 1.11 2007/09/30 22:22:17 rmagick Exp $
2
- # Copyright (C) 2007 Timothy P. Hunter
1
+ # $Id: misc.rb,v 1.12 2008/02/24 18:26:36 rmagick Exp $
2
+ # Copyright (C) 2008 Timothy P. Hunter
3
3
  module Magick
4
4
  class RVG
5
5
 
data/lib/rvg/paint.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: paint.rb,v 1.4 2007/01/20 17:39:49 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: paint.rb,v 1.5 2008/02/24 18:26:36 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
  # Defines paint server classes.
6
6
  # Eventually this will include gradients.
@@ -18,6 +18,11 @@ module Magick
18
18
  include Duplicatable
19
19
  include Stylable
20
20
 
21
+ # Return upper-left corner, width, height of viewport in user coordinates.
22
+ # Usually these are the values specified when the Pattern object is
23
+ # created, but they can be changed by a call to the viewbox method.
24
+ attr_reader :x, :y, :width, :height
25
+
21
26
  # Create a pattern that can be used with the :fill or :stroke styles.
22
27
  # The +width+ and +height+ arguments define the viewport.
23
28
  # The pattern will be repeated at <tt>x+m*width</tt> and <tt>y+n*height</tt>
data/lib/rvg/pathdata.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #--
2
- # $Id: pathdata.rb,v 1.3 2007/01/20 17:39:49 rmagick Exp $
3
- # Copyright (C) 2007 Timothy P. Hunter
2
+ # $Id: pathdata.rb,v 1.4 2008/02/24 18:26:37 rmagick Exp $
3
+ # Copyright (C) 2008 Timothy P. Hunter
4
4
  #++
5
5
 
6
6
  module Magick
data/lib/rvg/rvg.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #--############################################################################
2
- # $Id: rvg.rb,v 1.8 2007/01/20 17:39:50 rmagick Exp $
2
+ # $Id: rvg.rb,v 1.9 2008/02/24 21:15:24 rmagick Exp $
3
3
  #
4
- # Copyright (C) 2007 by Timothy P. Hunter
4
+ # Copyright (C) 2008 by Timothy P. Hunter
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a
7
7
  # copy of this software and associated documentation files (the
@@ -222,7 +222,7 @@ module Magick
222
222
  @background_fill_opacity = 1.0 # applies only if background_fill= is used
223
223
  @background_position = :scaled
224
224
  @background_pattern, @background_image, @desc, @title, @metadata = nil
225
- @x, @y = 0.0
225
+ @x, @y = 0.0, 0.0
226
226
  @nested = false
227
227
  yield(self) if block_given?
228
228
  end