rmagick 1.9.2 → 1.9.3

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.

data/ChangeLog CHANGED
@@ -1,7 +1,13 @@
1
+ RMagick 1.9.3
2
+ o Feature #2521, add Image#distortion_channel method
3
+ o Fixed bug #2546, ImageList#to_blob builds multi-image blobs again. (ImageMagick 6.2.0
4
+ silently broke the ImageToBlob method.) Thanks to Tom Werner for reporting this bug.
5
+ o Test with GraphicsMagick 1.1.7
6
+
1
7
  RMagick 1.9.2
2
- o Feature 2412, add the virtual_pixel_method attribute and the VirtualPixelMethod
8
+ o Feature #2412, add the virtual_pixel_method attribute and the VirtualPixelMethod
3
9
  enumeration
4
- o Feature 2462, add the ticks_per_second attribute
10
+ o Feature #2462, add the ticks_per_second attribute
5
11
 
6
12
  RMagick 1.9.1
7
13
  o Fixed bug #2157, Image#total_colors is now an alias of Image#number_colors
@@ -1,14 +1,14 @@
1
1
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
2
  <html>
3
3
  <head>
4
- <title>RMagick 1.9.2 README</title>
4
+ <title>RMagick 1.9.3 README</title>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6
6
  <meta name="GENERATOR" content="BlueCloth">
7
7
  </head>
8
8
  <body>
9
- <h1>RMagick 1.9.2 README</h1>
9
+ <h1>RMagick 1.9.3 README</h1>
10
10
 
11
- <h2>09/15/05</h2>
11
+ <h2>10/17/05</h2>
12
12
 
13
13
  <h2>Table Of Contents</h2>
14
14
 
@@ -42,7 +42,7 @@ ImageMagick and GraphicsMagick image processing libraries.</p>
42
42
 
43
43
  <p><strong>Author:</strong> Tim Hunter</p>
44
44
 
45
- <p><strong>Email:</strong> <a href="&#x6D;a&#x69;&#x6C;&#x74;&#x6F;:&#x72;&#109;&#097;&#x67;&#105;&#x63;&#x6B;&#x40;&#x72;&#117;&#x62;&#121;&#102;&#111;&#114;&#x67;&#x65;&#046;&#x6F;&#x72;&#103;">&#x72;&#109;&#097;&#x67;&#105;&#x63;&#x6B;&#x40;&#x72;&#117;&#x62;&#121;&#102;&#111;&#114;&#x67;&#x65;&#046;&#x6F;&#x72;&#103;</a></p>
45
+ <p><strong>Email:</strong> <a href="&#109;&#097;&#x69;&#x6C;&#116;&#x6F;:&#x72;&#x6D;&#x61;&#103;&#105;&#099;&#107;&#064;&#114;&#117;&#098;&#121;&#x66;&#x6F;&#x72;&#x67;&#101;&#046;&#x6F;&#x72;&#x67;">&#x72;&#x6D;&#x61;&#103;&#105;&#099;&#107;&#064;&#114;&#117;&#098;&#121;&#x66;&#x6F;&#x72;&#x67;&#101;&#046;&#x6F;&#x72;&#x67;</a></p>
46
46
 
47
47
  <p><strong>RubyForge:</strong> <a href="http://rubyforge.org/projects/rmagick/">http://rubyforge.org/projects/rmagick/</a></p>
48
48
 
@@ -218,7 +218,7 @@ addition to the regular options, there are a few RMagick-specific options:</p>
218
218
 
219
219
  <h4 id="scripts">Running the <code>configure</code> and <code>make</code> scripts</h4>
220
220
 
221
- <p>De-compress the RMagick-1.9.2.tar.gz archive and enter the top
221
+ <p>De-compress the RMagick-1.9.3.tar.gz archive and enter the top
222
222
  directory. Then type:</p>
223
223
 
224
224
  <pre><code>$ ./configure &lt;configuration options&gt;
@@ -239,9 +239,9 @@ $ make clean
239
239
 
240
240
  <p>When make is running the examples, if you get a message like this:</p>
241
241
 
242
- <pre><code>/home/you/RMagick-1.9.2/lib/RMagick.rb:11:in `require': libMagick.so.0:
242
+ <pre><code>/home/you/RMagick-1.9.3/lib/RMagick.rb:11:in `require': libMagick.so.0:
243
243
  cannot open shared object file: No such file or directory -
244
- /home/you/RMagick-1.9.2/ext/RMagick/RMagick.so (LoadError)
244
+ /home/you/RMagick-1.9.3/ext/RMagick/RMagick.so (LoadError)
245
245
  </code></pre>
246
246
 
247
247
  <p>you probably do not have the directory in which the ImageMagick or GraphicsMagick
@@ -261,7 +261,7 @@ systems, see the documentation for the dynamic loading facility.</p>
261
261
 
262
262
  <p>When make is running the examples, if you get a message like this:</p>
263
263
 
264
- <pre><code>hook /home/me/src/RMagick-1.9.2/./post-setup.rb failed:
264
+ <pre><code>hook /home/me/src/RMagick-1.9.3/./post-setup.rb failed:
265
265
  No such file or directory - "/tmp/rmagick6872.6"
266
266
  </code></pre>
267
267
 
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
- RMagick 1.9.2 README
1
+ RMagick 1.9.3 README
2
2
  ================================
3
- 09/15/05
3
+ 10/17/05
4
4
  --------
5
5
 
6
6
  Table Of Contents
@@ -188,7 +188,7 @@ addition to the regular options, there are a few RMagick-specific options:
188
188
 
189
189
  <h4 id="scripts">Running the <code>configure</code> and <code>make</code> scripts</h4>
190
190
 
191
- De-compress the RMagick-1.9.2.tar.gz archive and enter the top
191
+ De-compress the RMagick-1.9.3.tar.gz archive and enter the top
192
192
  directory. Then type:
193
193
 
194
194
  $ ./configure <configuration options>
@@ -206,9 +206,9 @@ The message can also refer to "libGraphicsMagick". Typically this message means
206
206
  #### Cannot open shared object file
207
207
  When make is running the examples, if you get a message like this:
208
208
 
209
- /home/you/RMagick-1.9.2/lib/RMagick.rb:11:in `require': libMagick.so.0:
209
+ /home/you/RMagick-1.9.3/lib/RMagick.rb:11:in `require': libMagick.so.0:
210
210
  cannot open shared object file: No such file or directory -
211
- /home/you/RMagick-1.9.2/ext/RMagick/RMagick.so (LoadError)
211
+ /home/you/RMagick-1.9.3/ext/RMagick/RMagick.so (LoadError)
212
212
 
213
213
  you probably do not have the directory in which the ImageMagick or GraphicsMagick
214
214
  library is installed in your load path. An easy way to fix this is to define the
@@ -225,7 +225,7 @@ systems, see the documentation for the dynamic loading facility.
225
225
  #### No such file or directory - "/tmp/rmagick6872.6"
226
226
  When make is running the examples, if you get a message like this:
227
227
 
228
- hook /home/me/src/RMagick-1.9.2/./post-setup.rb failed:
228
+ hook /home/me/src/RMagick-1.9.3/./post-setup.rb failed:
229
229
  No such file or directory - "/tmp/rmagick6872.6"
230
230
 
231
231
  you probably do not have a temporary directory environment variable set. Set
data/configure CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /bin/sh
2
2
  # Guess values for system-dependent variables and create Makefiles.
3
- # Generated by GNU Autoconf 2.59 for RMagick 1.9.2.
3
+ # Generated by GNU Autoconf 2.59 for RMagick 1.9.3.
4
4
  #
5
5
  # Report bugs to <rmagick@rubyforge.org>.
6
6
  #
@@ -268,9 +268,9 @@ SHELL=${CONFIG_SHELL-/bin/sh}
268
268
 
269
269
  # Identity of this package.
270
270
  PACKAGE_NAME='RMagick'
271
- PACKAGE_TARNAME='RMagick-1.9.2.tar.gz'
272
- PACKAGE_VERSION='1.9.2'
273
- PACKAGE_STRING='RMagick 1.9.2'
271
+ PACKAGE_TARNAME='RMagick-1.9.3.tar.gz'
272
+ PACKAGE_VERSION='1.9.3'
273
+ PACKAGE_STRING='RMagick 1.9.3'
274
274
  PACKAGE_BUGREPORT='rmagick@rubyforge.org'
275
275
 
276
276
  # Factoring default headers for most tests.
@@ -779,7 +779,7 @@ if test "$ac_init_help" = "long"; then
779
779
  # Omit some internal or obsolete options to make the list less imposing.
780
780
  # This message is too long to be a string in the A/UX 3.1 sh.
781
781
  cat <<_ACEOF
782
- \`configure' configures RMagick 1.9.2 to adapt to many kinds of systems.
782
+ \`configure' configures RMagick 1.9.3 to adapt to many kinds of systems.
783
783
 
784
784
  Usage: $0 [OPTION]... [VAR=VALUE]...
785
785
 
@@ -836,7 +836,7 @@ fi
836
836
 
837
837
  if test -n "$ac_init_help"; then
838
838
  case $ac_init_help in
839
- short | recursive ) echo "Configuration of RMagick 1.9.2:";;
839
+ short | recursive ) echo "Configuration of RMagick 1.9.3:";;
840
840
  esac
841
841
  cat <<\_ACEOF
842
842
 
@@ -981,7 +981,7 @@ fi
981
981
  test -n "$ac_init_help" && exit 0
982
982
  if $ac_init_version; then
983
983
  cat <<\_ACEOF
984
- RMagick configure 1.9.2
984
+ RMagick configure 1.9.3
985
985
  generated by GNU Autoconf 2.59
986
986
 
987
987
  Copyright (C) 2003 Free Software Foundation, Inc.
@@ -995,7 +995,7 @@ cat >&5 <<_ACEOF
995
995
  This file contains any messages produced by compilers while
996
996
  running configure, to aid debugging if configure makes a mistake.
997
997
 
998
- It was created by RMagick $as_me 1.9.2, which was
998
+ It was created by RMagick $as_me 1.9.3, which was
999
999
  generated by GNU Autoconf 2.59. Invocation command line was
1000
1000
 
1001
1001
  $ $0 $@
@@ -5794,6 +5794,109 @@ fi
5794
5794
  done
5795
5795
 
5796
5796
 
5797
+
5798
+ for ac_func in GetImageChannelDistortion ImagesToBlob
5799
+ do
5800
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
5801
+ echo "$as_me:$LINENO: checking for $ac_func" >&5
5802
+ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
5803
+ if eval "test \"\${$as_ac_var+set}\" = set"; then
5804
+ echo $ECHO_N "(cached) $ECHO_C" >&6
5805
+ else
5806
+ cat >conftest.$ac_ext <<_ACEOF
5807
+ /* confdefs.h. */
5808
+ _ACEOF
5809
+ cat confdefs.h >>conftest.$ac_ext
5810
+ cat >>conftest.$ac_ext <<_ACEOF
5811
+ /* end confdefs.h. */
5812
+ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
5813
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
5814
+ #define $ac_func innocuous_$ac_func
5815
+
5816
+ /* System header to define __stub macros and hopefully few prototypes,
5817
+ which can conflict with char $ac_func (); below.
5818
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5819
+ <limits.h> exists even on freestanding compilers. */
5820
+
5821
+ #ifdef __STDC__
5822
+ # include <limits.h>
5823
+ #else
5824
+ # include <assert.h>
5825
+ #endif
5826
+
5827
+ #undef $ac_func
5828
+
5829
+ /* Override any gcc2 internal prototype to avoid an error. */
5830
+ #ifdef __cplusplus
5831
+ extern "C"
5832
+ {
5833
+ #endif
5834
+ /* We use char because int might match the return type of a gcc2
5835
+ builtin and then its argument prototype would still apply. */
5836
+ char $ac_func ();
5837
+ /* The GNU C library defines this for functions which it implements
5838
+ to always fail with ENOSYS. Some functions are actually named
5839
+ something starting with __ and the normal name is an alias. */
5840
+ #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5841
+ choke me
5842
+ #else
5843
+ char (*f) () = $ac_func;
5844
+ #endif
5845
+ #ifdef __cplusplus
5846
+ }
5847
+ #endif
5848
+
5849
+ int
5850
+ main ()
5851
+ {
5852
+ return f != $ac_func;
5853
+ ;
5854
+ return 0;
5855
+ }
5856
+ _ACEOF
5857
+ rm -f conftest.$ac_objext conftest$ac_exeext
5858
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
5859
+ (eval $ac_link) 2>conftest.er1
5860
+ ac_status=$?
5861
+ grep -v '^ *+' conftest.er1 >conftest.err
5862
+ rm -f conftest.er1
5863
+ cat conftest.err >&5
5864
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
5865
+ (exit $ac_status); } &&
5866
+ { ac_try='test -z "$ac_c_werror_flag"
5867
+ || test ! -s conftest.err'
5868
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5869
+ (eval $ac_try) 2>&5
5870
+ ac_status=$?
5871
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
5872
+ (exit $ac_status); }; } &&
5873
+ { ac_try='test -s conftest$ac_exeext'
5874
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5875
+ (eval $ac_try) 2>&5
5876
+ ac_status=$?
5877
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
5878
+ (exit $ac_status); }; }; then
5879
+ eval "$as_ac_var=yes"
5880
+ else
5881
+ echo "$as_me: failed program was:" >&5
5882
+ sed 's/^/| /' conftest.$ac_ext >&5
5883
+
5884
+ eval "$as_ac_var=no"
5885
+ fi
5886
+ rm -f conftest.err conftest.$ac_objext \
5887
+ conftest$ac_exeext conftest.$ac_ext
5888
+ fi
5889
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
5890
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
5891
+ if test `eval echo '${'$as_ac_var'}'` = yes; then
5892
+ cat >>confdefs.h <<_ACEOF
5893
+ #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
5894
+ _ACEOF
5895
+
5896
+ fi
5897
+ done
5898
+
5899
+
5797
5900
  # What typedefs?
5798
5901
 
5799
5902
  # Need a separate test for this so we can set an env. variable to test below.
@@ -7877,13 +7980,6 @@ fi
7877
7980
  echo "$as_me:$LINENO: result: $rm_cv_enum_quantumpixel" >&5
7878
7981
  echo "${ECHO_T}$rm_cv_enum_quantumpixel" >&6
7879
7982
 
7880
- if test "$rm_cv_enum_quantumpixel" = yes; then
7881
- cat >>confdefs.h <<\_ACEOF
7882
- #define HAVE_QUANTUMPIXEL 1
7883
- _ACEOF
7884
-
7885
- fi
7886
-
7887
7983
  echo "$as_me:$LINENO: checking for TransparentVirtualPixelMethod enum value" >&5
7888
7984
  echo $ECHO_N "checking for TransparentVirtualPixelMethod enum value... $ECHO_C" >&6
7889
7985
  if test "${rm_cv_enum_transparentvirtualpixelmethod+set}" = set; then
@@ -8772,7 +8868,7 @@ _ASBOX
8772
8868
  } >&5
8773
8869
  cat >&5 <<_CSEOF
8774
8870
 
8775
- This file was extended by RMagick $as_me 1.9.2, which was
8871
+ This file was extended by RMagick $as_me 1.9.3, which was
8776
8872
  generated by GNU Autoconf 2.59. Invocation command line was
8777
8873
 
8778
8874
  CONFIG_FILES = $CONFIG_FILES
@@ -8832,7 +8928,7 @@ _ACEOF
8832
8928
 
8833
8929
  cat >>$CONFIG_STATUS <<_ACEOF
8834
8930
  ac_cs_version="\\
8835
- RMagick config.status 1.9.2
8931
+ RMagick config.status 1.9.3
8836
8932
  configured by $0, generated by GNU Autoconf 2.59,
8837
8933
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
8838
8934
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  # RMagick configure.ac
3
3
 
4
- AC_INIT(RMagick, 1.9.2, rmagick@rubyforge.org, RMagick-1.9.2.tar.gz)
4
+ AC_INIT(RMagick, 1.9.3, rmagick@rubyforge.org, RMagick-1.9.3.tar.gz)
5
5
  echo "Configuring ${PACKAGE_STRING}"
6
6
 
7
7
  AC_CONFIG_HEADER([ext/RMagick/rmagick_config.h])
@@ -144,6 +144,7 @@ AC_CHECK_FUNCS([ConvolveImageChannel SpliceImage SharpenImageChannel])
144
144
  AC_CHECK_FUNCS([SetImageChannelDepth BlurImageChannel GetMultilineTypeMetrics])
145
145
  AC_CHECK_FUNCS([NormalizeImageChannel UnsharpMaskImageChannel ShadowImage])
146
146
  AC_CHECK_FUNCS([SepiaToneImage SigmoidalContrastImageChannel SetImageProgressMonitor])
147
+ AC_CHECK_FUNCS([GetImageChannelDistortion ImagesToBlob])
147
148
 
148
149
  # What typedefs?
149
150
 
@@ -440,10 +441,6 @@ AC_CACHE_CHECK(for QuantumPixel enum value, rm_cv_enum_quantumpixel,
440
441
  rm_cv_enum_quantumpixel='yes',
441
442
  rm_cv_enum_quantumpixel='no')])
442
443
 
443
- if test "$rm_cv_enum_quantumpixel" = yes; then
444
- AC_DEFINE(HAVE_QUANTUMPIXEL)
445
- fi
446
-
447
444
  AC_CACHE_CHECK(for TransparentVirtualPixelMethod enum value, rm_cv_enum_transparentvirtualpixelmethod,
448
445
  [AC_TRY_COMPILE(
449
446
  [#include <stdio.h>
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
6
  <meta name="generator" content=
7
- "HTML Tidy for Linux/x86 (vers 1st July 2004), see www.w3.org" />
7
+ "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
8
8
 
9
9
  <title>RMagick: Common Tasks</title>
10
10
  <meta http-equiv="Content-Type" content=
@@ -44,7 +44,7 @@
44
44
  <div id="toc">
45
45
  <h2>Table of Contents</h2>
46
46
 
47
- <ul style="margin-left: 15px; padding-top: 1em">
47
+ <ul style="margin-left: 15px; padding-top: 1em;">
48
48
  <li><a href="#info">Getting information about an
49
49
  image</a></li>
50
50
 
@@ -56,13 +56,15 @@
56
56
  <li><a href="#resizing">Resizing to a maximum (or minimum)
57
57
  size</a></li>
58
58
 
59
+ <li><a href="#blob">Writing to or reading from a string
60
+ instead of a file</a></li>
61
+
59
62
  <li><a href="#gray">Converting a color image to
60
63
  grayscale</a></li>
61
64
 
62
65
  <li><a href="#compressing">Compressing image files</a></li>
63
66
 
64
67
  <li><a href="#shadow">Making a drop shadow</a></li>
65
-
66
68
  </ul>
67
69
  </div>
68
70
 
@@ -175,6 +177,23 @@ thumb.write "thumb.gif"
175
177
  value from the block. The <code>change_geometry</code> method
176
178
  then returns that value to its caller.</p>
177
179
 
180
+ <h2><a id="blob" name="blob">Writing to or reading from a string
181
+ instead of a file</a></h2>
182
+
183
+ <p>Use the <a href="image1.html#from_blob">Image.from_blob</a>
184
+ method to construct an Image object from a string. Use the
185
+ <a href="image3.html#to_blob">Image#to_blob</a> method to convert
186
+ an image to a string. A blob is simply an in-memory version of an
187
+ image file. That is, you could use <code>File.read</code> to read
188
+ an JPEG file into a string, then create an image by using that
189
+ string as an argument to <code>from_blob</code>. Similarly, if
190
+ you create a string version of an image with
191
+ <code>to_blob</code>, then write the string to a file, any image
192
+ viewer will be able to display it just as if you had written the
193
+ image directly to a file. Blobs are very useful in web
194
+ applications when you want to modify an image and then stream it
195
+ back to the client.</p>
196
+
178
197
  <h2 id="gray">Converting a color image to grayscale</h2>
179
198
 
180
199
  <p>Use the <a href=
@@ -227,10 +246,9 @@ img.write("myimage.jpg") { self.quality = 50 }
227
246
  "ex/drop_shadow.gif" title="Click to see the example script"
228
247
  alt="drop shadow example" /></a>
229
248
  </div>
230
-
231
249
  <hr />
232
250
 
233
- <p class="spacer"> </p>
251
+ <p class="spacer">&nbsp;</p>
234
252
 
235
253
  <div class="nav">
236
254
  &laquo; <a href="imusage.html">Prev</a> | <a href=
@@ -113,13 +113,13 @@
113
113
 
114
114
  <li><a href="#InterlaceType">InterlaceType</a></li>
115
115
 
116
- <li><a href="#NoiseType">NoiseType</a></li>
116
+ <li><a href="#MetricType">MetricType</a></li>
117
117
  </ul>
118
118
  </div>
119
119
 
120
120
  <div class="toccol">
121
121
  <ul>
122
- <li>&nbsp;</li>
122
+ <li><a href="#NoiseType">NoiseType</a></li>
123
123
 
124
124
  <li><a href="#Opacity">Opacity</a></li>
125
125
 
@@ -148,7 +148,7 @@
148
148
 
149
149
  <dd>An extended form of the <code>Version</code> constant with
150
150
  the format shown here:<br />
151
- <code>This is RMagick 1.4.0 ($Date: 2005/07/31 14:57:29 $)
151
+ <code>This is RMagick 1.4.0 ($Date: 2005/09/26 23:35:06 $)
152
152
  Copyright (C) 2005 by Timothy P. Hunter<br />
153
153
  Built with ImageMagick 6.0.0 02/25/04 Q8
154
154
  http://www.imagemagick.org<br />
@@ -995,6 +995,24 @@
995
995
  image.R, image.G, and image.B)</dd>
996
996
  </dl>
997
997
 
998
+ <h3 class="const" id="MetricType">MetricType</h3>
999
+
1000
+ <p>The distortion metric type. See <a href=
1001
+ "image1.html#compare_channel">compare_channel</a>, <a href=
1002
+ "image1.html#distortion_channel">distortion_channel</a>.</p>
1003
+
1004
+ <dl>
1005
+ <dt>MeanAbsoluteErrorMetric</dt>
1006
+
1007
+ <dt>MeanSquaredErrorMetric</dt>
1008
+
1009
+ <dt>PeakAbsoluteErrorMetric</dt>
1010
+
1011
+ <dt>PeakSignalToNoiseRatioMetric</dt>
1012
+
1013
+ <dt>RootMeanSquaredErrorMetric</dt>
1014
+ </dl>
1015
+
998
1016
  <h3 class="const" id="NoiseType">NoiseType</h3>
999
1017
 
1000
1018
  <p><span class="imquote">Select the type of noise to be added to
@@ -155,13 +155,13 @@ float: left;
155
155
  <li><a href="#composite">composite</a></li>
156
156
 
157
157
  <li><a href="#composite_bang">composite!</a></li>
158
+
159
+ <li><a href="#composite_affine">composite_affine</a></li>
158
160
  </ul>
159
161
  </div>
160
162
 
161
163
  <div class="toccol">
162
164
  <ul>
163
- <li><a href="#composite_affine">composite_affine</a></li>
164
-
165
165
  <li><a href=
166
166
  "#compress_colormap_bang">compress_colormap!</a></li>
167
167
 
@@ -187,6 +187,8 @@ float: left;
187
187
 
188
188
  <li><a href="#display">display</a></li>
189
189
 
190
+ <li><a href="#distortion_channel">distortion_channel</a></li>
191
+
190
192
  <li><a href="#dup">dup</a></li>
191
193
 
192
194
  <li><a href="#each_profile">each_profile</a></li>
@@ -903,8 +905,7 @@ img = Magick::Image.read_inline(content)
903
905
  <h3 id="bilevel_channel">bilevel_channel</h3>
904
906
 
905
907
  <p><span class="arg">image</span>.bilevel_channel(<span class=
906
- "arg">threshold</span>, [<span class="arg">channel</span>[,
907
- <span class="arg">channel</span>...]] = <em>aNewImage</em></p>
908
+ "arg">threshold</span> [,<span class="arg">channel...</span>]) = <em>aNewImage</em></p>
908
909
  </div>
909
910
 
910
911
  <div class="desc">
@@ -963,8 +964,7 @@ img = Magick::Image.read_inline(content)
963
964
 
964
965
  <p><span class="arg">image</span>.blur_channel(<span class=
965
966
  "arg">radius=0.0</span>, <span class=
966
- "arg">sigma=1.0</span><span class="arg">[, channel[,
967
- channel...]]</span>) -&gt; <em>anImage</em></p>
967
+ "arg">sigma=1.0</span><span class="arg">[, channel...]]</span>) -&gt; <em>anImage</em></p>
968
968
  </div>
969
969
 
970
970
  <div class="desc">
@@ -1294,7 +1294,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1294
1294
  <h3 id="channel_depth">channel_depth</h3>
1295
1295
 
1296
1296
  <p><span class="arg">image</span>.channel_depth([<span class=
1297
- "arg">channel</span> [, <span class="arg">channel</span>]...])
1297
+ "arg">channel</span>...])
1298
1298
  -&gt; <em>aNumeric</em></p>
1299
1299
  </div>
1300
1300
 
@@ -1307,7 +1307,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1307
1307
  <h4>Arguments</h4>
1308
1308
 
1309
1309
  <dl>
1310
- <dt>[channel [, channel...]]</dt>
1310
+ <dt>channel...</dt>
1311
1311
 
1312
1312
  <dd>Zero or more <a href=
1313
1313
  "constants.html#ChannelType">ChannelType</a> constants. If no
@@ -1332,7 +1332,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1332
1332
  <h3 id="channel_extrema">channel_extrema</h3>
1333
1333
 
1334
1334
  <p><span class="arg">image</span>.channel_extrema([<span class=
1335
- "arg">channel</span> [, <span class="arg">channel</span>]...])
1335
+ "arg">channel</span>...])
1336
1336
  -&gt; <em>[aNumeric, aNumeric]</em></p>
1337
1337
  </div>
1338
1338
 
@@ -1345,7 +1345,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1345
1345
  <h4>Arguments</h4>
1346
1346
 
1347
1347
  <dl>
1348
- <dt>[channel [, channel...]]</dt>
1348
+ <dt>channel...</dt>
1349
1349
 
1350
1350
  <dd>Zero or more <a href=
1351
1351
  "constants.html#ChannelType">ChannelType</a> values. If no
@@ -1375,7 +1375,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1375
1375
  <h3 id="channel_mean">channel_mean</h3>
1376
1376
 
1377
1377
  <p><span class="arg">image</span>.channel_mean([<span class=
1378
- "arg">channel</span> [, <span class="arg">channel</span>]...])
1378
+ "arg">channel</span>...])
1379
1379
  -&gt; <em>[aNumeric, aNumeric]</em></p>
1380
1380
  </div>
1381
1381
 
@@ -1388,7 +1388,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1388
1388
  <h4>Arguments</h4>
1389
1389
 
1390
1390
  <dl>
1391
- <dt>[channel [, channel...]]</dt>
1391
+ <dt>channel...</dt>
1392
1392
 
1393
1393
  <dd>Zero or more <a href=
1394
1394
  "constants.html#ChannelType">ChannelType</a> values. If no
@@ -1914,24 +1914,10 @@ f.color_reset!(red)
1914
1914
  <dt>metric</dt>
1915
1915
 
1916
1916
  <dd>
1917
- The desired distortion metric. One of the following
1918
- constants:
1919
-
1920
- <ul style=
1921
- "list-style-type: none; list-style-image: none; list-style-position: outside;">
1922
- <li>MeanAbsoluteErrorMetric</li>
1923
-
1924
- <li>MeanSquaredErrorMetric</li>
1925
-
1926
- <li>PeakAbsoluteErrorMetric</li>
1927
-
1928
- <li>PeakSignalToNoiseRatioMetric</li>
1929
-
1930
- <li>RootMeanSquaredErrorMetric</li>
1931
- </ul>
1917
+ The desired distortion metric. A <a href="constants.html#MetricType">MetricType</a> value.
1932
1918
  </dd>
1933
1919
 
1934
- <dt>[channel [, channel...]]</dt>
1920
+ <dt>channel...</dt>
1935
1921
 
1936
1922
  <dd>Zero or more <a href=
1937
1923
  "constants.html##ChannelType">ChannelType</a> values. All the
@@ -1949,7 +1935,8 @@ f.color_reset!(red)
1949
1935
  <h4>See also</h4>
1950
1936
 
1951
1937
  <p><a href="#difference">difference</a>, <a href=
1952
- "#spaceship">&lt;=&gt;</a></p>
1938
+ "#spaceship">&lt;=&gt;</a>,
1939
+ <a href="#distortion_channel">distortion_channel</a></p>
1953
1940
 
1954
1941
  <h4>Magick API</h4>
1955
1942
 
@@ -2342,9 +2329,8 @@ f.colors &raquo; 108
2342
2329
  <h3 id="convolve_channel">convolve_channel</h3>
2343
2330
 
2344
2331
  <p><span class="arg">image</span>.convolve_channel(<span class=
2345
- "arg">order</span>, <span class="arg">kernel</span>[,
2346
- <span class="arg">channel</span>[, <span class=
2347
- "arg">channel</span>...]]) -&gt; <em>anImage</em></p>
2332
+ "arg">order</span>, <span class="arg">kernel</span> [,
2333
+ <span class="arg">channel</span>...]) -&gt; <em>anImage</em></p>
2348
2334
  </div>
2349
2335
 
2350
2336
  <div class="desc">
@@ -2873,6 +2859,42 @@ exit
2873
2859
  <p>DisplayImages</p>
2874
2860
  </div>
2875
2861
 
2862
+ <div class="sig">
2863
+ <h3 id="distortion_channel">distortion_channel</h3>
2864
+ <p><span class="arg">image</span>.distortion_channel(<span class="arg">reconstructed_image</span>, <span class="arg">metric</span>[, <span class="arg">channel</span>...]) -&gt; <em>aFloat</em></p>
2865
+ </div>
2866
+
2867
+ <div class="desc">
2868
+ <h4>Description</h4>
2869
+ <p class="imquote">(C)ompares one or more image channels of an image to a reconstructed image and returns the specified distortion metric.</p>
2870
+ <h4>Arguments</h4>
2871
+ <dl>
2872
+ <dt>reconstructed_image</dt>
2873
+ <dd>Either an imagelist or an image. If an imagelist, uses
2874
+ the current image.</dd>
2875
+
2876
+ <dt>metric</dt>
2877
+
2878
+ <dd>
2879
+ The desired distortion metric. A <a href="constants.html#MetricType">MetricType</a> value.
2880
+ </dd>
2881
+
2882
+ <dt>channel...</dt>
2883
+
2884
+ <dd>Zero or more <a href=
2885
+ "constants.html##ChannelType">ChannelType</a> values. All the
2886
+ specified channels contribute to the comparison and the
2887
+ distortion value. If no channels are specified, compares all
2888
+ channels.</dd>
2889
+ </dl>
2890
+ <h4>Returns</h4>
2891
+ <h4>Magick API</h4>
2892
+ <p>GetImageChannelDistortion (available in ImageMagick 6.2.0)</p>
2893
+ <h4>See also</h4>
2894
+ <p><a href="#compare_channel">compare_channel</a>,
2895
+ <a href="#difference">difference</a></p>
2896
+ </div>
2897
+
2876
2898
  <div class="sig">
2877
2899
  <h3 id="dup">dup</h3>
2878
2900
 
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
6
  <meta name="generator" content=
7
- "HTML Tidy for Mac OS X (vers 1st September 2004), see www.w3.org" />
7
+ "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
8
8
 
9
9
  <title>RMagick: class Image (instance methods, part 2)</title>
10
10
  <meta http-equiv="Content-Type" content=
@@ -493,9 +493,8 @@ scanline = img.export_pixels(0, r, img.columns, 1, "RGB");
493
493
  --><img class="hide"
494
494
  id="framed" onmouseover=
495
495
  "this.style.display='none';frameless.style.display='';" src=
496
- "ex/frame.jpg" alt="frame example" /></a>
497
- <img src="ex/images/spin.gif" alt="" style=
498
- "margin-bottom: 280px" title=
496
+ "ex/frame.jpg" alt="frame example" /></a> <img src=
497
+ "ex/images/spin.gif" alt="" style="margin-bottom: 280px" title=
499
498
  "Mouse over the example to see the original image" /></p>
500
499
 
501
500
  <h4>See also</h4>
@@ -511,8 +510,8 @@ scanline = img.export_pixels(0, r, img.columns, 1, "RGB");
511
510
  <h3 id="gamma_channel">gamma_channel</h3>
512
511
 
513
512
  <p><span class="arg">image</span>.gamma_channel(<span class=
514
- "arg">gamma</span>, [<span class="arg">channel</span>[,
515
- <span class="arg">channel</span>...]] = <em>anImage</em></p>
513
+ "arg">gamma</span>, [<span class="arg">channel</span>...]) =
514
+ <em>anImage</em></p>
516
515
  </div>
517
516
 
518
517
  <div class="desc">
@@ -655,8 +654,8 @@ scanline = img.export_pixels(0, r, img.columns, 1, "RGB");
655
654
  <p><span class=
656
655
  "arg">image</span>.gaussian_blur_channel(<span class=
657
656
  "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0[,
658
- <span class="arg">channel</span>[, <span class=
659
- "arg">channel</span>...]) -&gt; <em>anImage</em></p>
657
+ <span class="arg">channel</span>...]) -&gt;
658
+ <em>anImage</em></p>
660
659
  </div>
661
660
 
662
661
  <div class="desc">
@@ -1870,8 +1869,7 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1870
1869
 
1871
1870
  <p><span class="arg">image</span>.negate_channel(<span class=
1872
1871
  "arg">grayscale</span>=<code>false</code>, [<span class=
1873
- "arg">channel</span>[, <span class="arg">channel</span>...]] =
1874
- <em>anImage</em></p>
1872
+ "arg">channel</span>...]) = <em>anImage</em></p>
1875
1873
  </div>
1876
1874
 
1877
1875
  <div class="desc">
@@ -1965,8 +1963,7 @@ f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"
1965
1963
 
1966
1964
  <p><span class=
1967
1965
  "arg">image</span>.normalize_channel([<span class=
1968
- "arg">channel</span>[, <span class="arg">channel</span>...]]) =
1969
- <em>anImage</em></p>
1966
+ "arg">channel</span>...]) = <em>anImage</em></p>
1970
1967
  </div>
1971
1968
 
1972
1969
  <div class="desc">
@@ -667,8 +667,7 @@ img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
667
667
 
668
668
  <p><span class="arg">image</span>.random_threshold_channel(
669
669
  <span class="arg">thresholds</span>, [<span class=
670
- "arg">channel</span>, <span class="arg">channel</span>...] )
671
- -&gt; <em>anImage</em></p>
670
+ "arg">channel</span>...] ) -&gt; <em>anImage</em></p>
672
671
  </div>
673
672
 
674
673
  <div class="desc">
@@ -1475,8 +1474,8 @@ random_threshold_channel(geom, RedChannel)
1475
1474
 
1476
1475
  <p><span class="arg">image</span>.sharpen_channel( <span class=
1477
1476
  "arg">radius</span>, <span class="arg">sigma</span>
1478
- [,<span class="arg">channel</span>, <span class=
1479
- "arg">channel</span>...] ) -&gt; <em>anImage</em></p>
1477
+ [,<span class="arg">channel</span>...] ) -&gt;
1478
+ <em>anImage</em></p>
1480
1479
  </div>
1481
1480
 
1482
1481
  <div class="desc">
@@ -1658,9 +1657,8 @@ random_threshold_channel(geom, RedChannel)
1658
1657
  "arg">image</span>.sigmoidal_contrast_channel(<span class=
1659
1658
  "arg">contrast</span>=3.0, <span class=
1660
1659
  "arg">midpoint</span>=50.0, <span class=
1661
- "arg">sharpen</span>=false[,<span class="arg"><span class=
1662
- "arg">channel</span></span>, <span class="arg"><span class=
1663
- "arg">channel</span></span>...]) -&gt; <em>anImage</em></p>
1660
+ "arg">sharpen</span>=false[,<span class=
1661
+ "arg">channel</span>...]) -&gt; <em>anImage</em></p>
1664
1662
  </div>
1665
1663
 
1666
1664
  <div class="desc">
@@ -2723,9 +2721,8 @@ img.to_color(pixel)
2723
2721
  "arg">image</span>.unsharp_mask_channel(<span class=
2724
2722
  "arg">radius=0.0</span>, <span class="arg">sigma=1.0</span>,
2725
2723
  <span class="arg">amount=1.0</span>, <span class=
2726
- "arg">threshold=0.05</span> [,<span class="arg">channel</span>,
2727
- <span class="arg">channel</span>...]) -&gt;
2728
- <em>anImage</em></p>
2724
+ "arg">threshold=0.05</span> [,<span class=
2725
+ "arg">channel</span>...]) -&gt; <em>anImage</em></p>
2729
2726
  </div>
2730
2727
 
2731
2728
  <div class="desc">
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
6
  <meta name="generator" content=
7
- "HTML Tidy for Mac OS X (vers 1st September 2004), see www.w3.org" />
7
+ "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
8
8
 
9
9
  <title>RMagick: How to use RMagick</title>
10
10
  <meta http-equiv="Content-Type" content=
@@ -447,6 +447,12 @@ exit
447
447
 
448
448
  <dd>Compute the difference between two images</dd>
449
449
 
450
+ <dt><a href=
451
+ "image1.html#distortion_channel">distortion_channel</a></dt>
452
+
453
+ <dd>Compare one or more channels to a reconstructed
454
+ image</dd>
455
+
450
456
  <dt><a href="image1.html#dup">dup</a></dt>
451
457
 
452
458
  <dd>Return a shallow copy of the image</dd>
@@ -927,10 +933,10 @@ exit
927
933
  <dd>Segment an image by analyzing the histograms of the color
928
934
  components and identifying units that are homogeneous with
929
935
  the fuzzy c-means technique</dd>
930
-
931
- <dt><a href="image3.html#random_threshold_channel">
932
- random_threshold_channel</a></dt>
933
-
936
+
937
+ <dt><a href=
938
+ "image3.html#random_threshold_channel">random_threshold_channel</a></dt>
939
+
934
940
  <dd>Change the value of individual pixels based on the
935
941
  intensity of each pixel compared to a random threshold.</dd>
936
942
 
@@ -1333,7 +1339,7 @@ exit
1333
1339
  use radians instead of degrees.</p>
1334
1340
  </div>
1335
1341
 
1336
- <p class="spacer"> </p>
1342
+ <p class="spacer">&nbsp;</p>
1337
1343
 
1338
1344
  <div class="nav">
1339
1345
  &laquo; <a href="index.html">Prev</a> | <a href=
@@ -1,4 +1,4 @@
1
- MANIFEST for RMagick-1.9.2 - 17:43:02 09/15/05
1
+ MANIFEST for RMagick-1.9.3 - 18:59:35 10/17/05
2
2
 
3
3
  configure
4
4
  README.html
@@ -1,4 +1,4 @@
1
- /* $Id: rmagick.h,v 1.94 2005/09/13 23:37:21 rmagick Exp $ */
1
+ /* $Id: rmagick.h,v 1.95 2005/09/26 23:37:04 rmagick Exp $ */
2
2
  /*=============================================================================
3
3
  | Copyright (C) 2005 by Timothy P. Hunter
4
4
  | Name: rmagick.h
@@ -756,6 +756,7 @@ extern VALUE Image_despeckle(VALUE);
756
756
  extern VALUE Image_difference(VALUE, VALUE);
757
757
  extern VALUE Image_dispatch(int, VALUE *, VALUE);
758
758
  extern VALUE Image_display(VALUE);
759
+ extern VALUE Image_distortion_channel(int, VALUE *, VALUE);
759
760
  extern VALUE Image__dump(VALUE, VALUE);
760
761
  extern VALUE Image_dup(VALUE);
761
762
  extern VALUE Image_each_profile(VALUE);
@@ -59,8 +59,12 @@
59
59
  #undef HAVE_GETIMAGECHANNELEXTREMA
60
60
  /* Introduced in IM 6.0.0, GM 1.1 */
61
61
  #undef HAVE_GETIMAGECHANNELMEAN
62
+ /* Introduced in IM 6.2.0 */
63
+ #undef HAVE_GETIMAGECHANNELDISTORTION
62
64
  /* Introduced in IM 6.0.0, GM 1.1 */
63
65
  #undef HAVE_GETIMAGEHISTOGRAM
66
+ /* Introduced in IM 6.1.5 */
67
+ #undef HAVE_IMAGESTOBLOB
64
68
  /* Introduced in IM 6.0.0, GM 1.1 */
65
69
  #undef HAVE_GETIMAGEPROFILE
66
70
  /* Introduced in IM 6.0.0 */
@@ -1,4 +1,4 @@
1
- /* $Id: rmilist.c,v 1.25 2005/08/07 21:21:08 rmagick Exp $ */
1
+ /* $Id: rmilist.c,v 1.27 2005/10/13 23:01:29 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2005 by Timothy P. Hunter
4
4
  | Name: rmilist.c
@@ -584,7 +584,11 @@ ImageList_to_blob(VALUE self)
584
584
  // doesn't support multi-image files.
585
585
  info->adjoin = True;
586
586
  GetExceptionInfo(&exception);
587
+ #if defined(HAVE_IMAGESTOBLOB)
588
+ blob = ImagesToBlob(info, images, &length, &exception);
589
+ #else
587
590
  blob = ImageToBlob(info, images, &length, &exception);
591
+ #endif
588
592
  rm_split(images);
589
593
  HANDLE_ERROR
590
594
 
@@ -1,4 +1,4 @@
1
- /* $Id: rmimage.c,v 1.121 2005/09/13 23:37:21 rmagick Exp $ */
1
+ /* $Id: rmimage.c,v 1.123 2005/09/26 23:37:04 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2005 by Timothy P. Hunter
4
4
  | Name: rmimage.c
@@ -1142,7 +1142,7 @@ Image_color_histogram(VALUE self)
1142
1142
  for (x = 0; x < colors; x++)
1143
1143
  {
1144
1144
  pixel = Pixel_from_PixelPacket(&histogram[x].pixel);
1145
- rb_hash_aset(hash, pixel, INT2NUM(histogram[x].count));
1145
+ rb_hash_aset(hash, pixel, ULONG2NUM(histogram[x].count));
1146
1146
  }
1147
1147
 
1148
1148
  /*
@@ -1155,7 +1155,7 @@ Image_color_histogram(VALUE self)
1155
1155
 
1156
1156
 
1157
1157
  #elif defined(HAVE_GETIMAGEHISTOGRAM)
1158
- Image *image;
1158
+ Image *image, *dc_copy = NULL;
1159
1159
  volatile VALUE hash, pixel;
1160
1160
  unsigned long x, colors;
1161
1161
  ColorPacket *histogram;
@@ -1164,14 +1164,34 @@ Image_color_histogram(VALUE self)
1164
1164
  Data_Get_Struct(self, Image, image);
1165
1165
  GetExceptionInfo(&exception);
1166
1166
 
1167
+ // If image not DirectClass make a DirectClass copy.
1168
+ if (image->storage_class != DirectClass)
1169
+ {
1170
+ dc_copy = CloneImage(image, 0, 0, True, &exception);
1171
+ HANDLE_ERROR
1172
+ SyncImage(dc_copy);
1173
+ magick_free(dc_copy->colormap);
1174
+ dc_copy->colormap = NULL;
1175
+ dc_copy->storage_class = DirectClass;
1176
+ image = dc_copy;
1177
+ }
1178
+
1167
1179
  histogram = GetImageHistogram(image, &colors, &exception);
1180
+ if (dc_copy && (!histogram || exception.severity >= ErrorException))
1181
+ {
1182
+ DestroyImage(dc_copy);
1183
+ }
1184
+ if (!histogram)
1185
+ {
1186
+ rb_raise(rb_eNoMemError, "not enough memory to continue");
1187
+ }
1168
1188
  HANDLE_ERROR
1169
1189
 
1170
1190
  hash = rb_hash_new();
1171
1191
  for (x = 0; x < colors; x++)
1172
1192
  {
1173
1193
  pixel = Pixel_from_PixelPacket(&histogram[x].pixel);
1174
- rb_hash_aset(hash, pixel, INT2NUM(histogram[x].count));
1194
+ rb_hash_aset(hash, pixel, ULONG2NUM((unsigned long)histogram[x].count));
1175
1195
  }
1176
1196
 
1177
1197
  /*
@@ -1179,6 +1199,11 @@ Image_color_histogram(VALUE self)
1179
1199
  */
1180
1200
  RelinquishMagickMemory(histogram);
1181
1201
 
1202
+ if (dc_copy)
1203
+ {
1204
+ DestroyImage(dc_copy);
1205
+ }
1206
+
1182
1207
  return hash;
1183
1208
  #else
1184
1209
  rm_not_implemented();
@@ -2631,6 +2656,48 @@ Image_dispose_eq(VALUE self, VALUE dispose)
2631
2656
  return self;
2632
2657
  }
2633
2658
 
2659
+
2660
+ /*
2661
+ * Method: Image#distortion_channel(reconstructed_image, metric[, channel...])
2662
+ * Purpose: Call GetImageChannelDistortion
2663
+ */
2664
+ VALUE
2665
+ Image_distortion_channel(int argc, VALUE *argv, VALUE self)
2666
+ {
2667
+ #if defined(HAVE_GETIMAGECHANNELDISTORTION)
2668
+ Image *image, *reconstruct;
2669
+ ChannelType channels;
2670
+ ExceptionInfo exception;
2671
+ MetricType metric;
2672
+ double distortion;
2673
+
2674
+ Data_Get_Struct(self, Image, image);
2675
+
2676
+ channels = extract_channels(&argc, argv);
2677
+ if (argc > 2)
2678
+ {
2679
+ raise_ChannelType_error(argv[argc-1]);
2680
+ }
2681
+ if (argc < 2)
2682
+ {
2683
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2 or more)", argc);
2684
+ }
2685
+
2686
+ Data_Get_Struct(ImageList_cur_image(argv[0]), Image, reconstruct);
2687
+ VALUE_TO_ENUM(argv[1], metric, MetricType);
2688
+ GetExceptionInfo(&exception);
2689
+ (void) GetImageChannelDistortion(image, reconstruct, channels
2690
+ , metric, &distortion, &exception);
2691
+ HANDLE_ERROR_IMG(image)
2692
+ HANDLE_ERROR
2693
+
2694
+ return rb_float_new(distortion);
2695
+ #else
2696
+ rm_not_implemented();
2697
+ return (VALUE)0;
2698
+ #endif
2699
+ }
2700
+
2634
2701
  /*
2635
2702
  Method: Image#_dump(aDepth)
2636
2703
  Purpose: implement marshalling
@@ -3652,6 +3719,7 @@ Image_grayscale_pseudo_class(int argc, VALUE *argv, VALUE self)
3652
3719
 
3653
3720
  }
3654
3721
 
3722
+
3655
3723
  /*
3656
3724
  Method: Image#implode(amount=0.50)
3657
3725
  Purpose: implode the image by the specified percentage
@@ -3838,7 +3906,7 @@ Image_import_pixels(int argc, VALUE *argv, VALUE self)
3838
3906
 
3839
3907
  // Everything worked. Replace the image with the clone and destroy the original.
3840
3908
  DATA_PTR(self) = clone_image;
3841
- DestroyImage(image);
3909
+ DestroyImage(image);
3842
3910
 
3843
3911
  return self;
3844
3912
 
@@ -1,4 +1,4 @@
1
- /* $Id: rmmain.c,v 1.97 2005/09/13 23:37:21 rmagick Exp $ */
1
+ /* $Id: rmmain.c,v 1.99 2005/10/13 23:01:29 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2005 by Timothy P. Hunter
4
4
  | Name: rmmain.c
@@ -670,6 +670,7 @@ Init_RMagick(void)
670
670
  rb_define_method(Class_Image, "difference", Image_difference, 1);
671
671
  rb_define_method(Class_Image, "dispatch", Image_dispatch, -1);
672
672
  rb_define_method(Class_Image, "display", Image_display, 0);
673
+ rb_define_method(Class_Image, "distortion_channel", Image_distortion_channel, -1);
673
674
  rb_define_method(Class_Image, "_dump", Image__dump, 1);
674
675
  rb_define_method(Class_Image, "dup", Image_dup, 0);
675
676
  rb_define_method(Class_Image, "each_profile", Image_each_profile, 0);
@@ -1429,7 +1430,9 @@ Init_RMagick(void)
1429
1430
 
1430
1431
  // StorageType
1431
1432
  DEF_ENUM(StorageType)
1433
+ #if defined(HAVE_UNDEFINEDGRAVITY) // UndefinedGravity & UndefinedPixel were both introduced in IM 6.0.0
1432
1434
  ENUMERATOR(UndefinedPixel)
1435
+ #endif
1433
1436
  ENUMERATOR(CharPixel)
1434
1437
  ENUMERATOR(DoublePixel)
1435
1438
  ENUMERATOR(FloatPixel)
@@ -1572,7 +1575,7 @@ static void version_constants(void)
1572
1575
 
1573
1576
  rb_define_const(Module_Magick, "Version", rb_str_new2(PACKAGE_STRING));
1574
1577
  sprintf(long_version,
1575
- "This is %s ($Date: 2005/09/13 23:37:21 $) Copyright (C) 2005 by Timothy P. Hunter\n"
1578
+ "This is %s ($Date: 2005/10/13 23:01:29 $) Copyright (C) 2005 by Timothy P. Hunter\n"
1576
1579
  "Built with %s\n"
1577
1580
  "Built for %s\n"
1578
1581
  "Web page: http://rmagick.rubyforge.org\n"
@@ -1,4 +1,4 @@
1
- /* $Id: rmutil.c,v 1.59 2005/09/11 16:41:40 rmagick Exp $ */
1
+ /* $Id: rmutil.c,v 1.60 2005/10/13 23:01:29 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2005 by Timothy P. Hunter
4
4
  | Name: rmutil.c
@@ -2504,8 +2504,6 @@ StorageType_name(StorageType type)
2504
2504
  {
2505
2505
  switch (type)
2506
2506
  {
2507
- default:
2508
- ENUM_TO_NAME(UndefinedPixel)
2509
2507
  ENUM_TO_NAME(CharPixel)
2510
2508
  ENUM_TO_NAME(DoublePixel)
2511
2509
  ENUM_TO_NAME(FloatPixel)
@@ -2515,6 +2513,12 @@ StorageType_name(StorageType type)
2515
2513
  ENUM_TO_NAME(QuantumPixel)
2516
2514
  #endif
2517
2515
  ENUM_TO_NAME(ShortPixel)
2516
+ default:
2517
+ #if defined(HAVE_UNDEFINEDGRAVITY) // UndefinedGravity & UndefinedPixel were both introduced in IM 6.0.0
2518
+ ENUM_TO_NAME(UndefinedPixel)
2519
+ #else
2520
+ return "UndefinedPixel";
2521
+ #endif
2518
2522
  }
2519
2523
  }
2520
2524
 
@@ -2527,8 +2531,6 @@ StretchType_name(StretchType stretch)
2527
2531
  {
2528
2532
  switch (stretch)
2529
2533
  {
2530
- default:
2531
- ENUM_TO_NAME(UndefinedStretch)
2532
2534
  ENUM_TO_NAME(NormalStretch)
2533
2535
  ENUM_TO_NAME(UltraCondensedStretch)
2534
2536
  ENUM_TO_NAME(ExtraCondensedStretch)
@@ -2539,6 +2541,12 @@ StretchType_name(StretchType stretch)
2539
2541
  ENUM_TO_NAME(ExtraExpandedStretch)
2540
2542
  ENUM_TO_NAME(UltraExpandedStretch)
2541
2543
  ENUM_TO_NAME(AnyStretch)
2544
+ default:
2545
+ #if defined(HAVE_UNDEFINEDGRAVITY) // UndefinedGravity & UndefinedStretch were both introduced in IM 6.0.0
2546
+ ENUM_TO_NAME(UndefinedStretch)
2547
+ #else
2548
+ return "UndefinedStretch";
2549
+ #endif
2542
2550
  }
2543
2551
  }
2544
2552
 
@@ -2557,7 +2565,11 @@ StyleType_name(StyleType style)
2557
2565
  ENUM_TO_NAME(ObliqueStyle)
2558
2566
  ENUM_TO_NAME(AnyStyle)
2559
2567
  default:
2568
+ #if defined(HAVE_UNDEFINEDGRAVITY) // UndefinedGravity & UndefinedStyle were both introduced in IM 6.0.0
2560
2569
  ENUM_TO_NAME(UndefinedStyle)
2570
+ #else
2571
+ return "UndefinedStyle";
2572
+ #endif
2561
2573
  }
2562
2574
  }
2563
2575
 
@@ -1,4 +1,4 @@
1
- # $Id: RMagick.rb,v 1.33 2005/09/13 23:37:21 rmagick Exp $
1
+ # $Id: RMagick.rb,v 1.34 2005/10/17 22:17:38 rmagick Exp $
2
2
  #==============================================================================
3
3
  # Copyright (C) 2005 by Timothy P. Hunter
4
4
  # Name: RMagick.rb
@@ -1225,7 +1225,7 @@ public
1225
1225
  return a
1226
1226
  end
1227
1227
 
1228
- if self.superclass.instance_methods.include? 'insert' then
1228
+ if self.superclass.instance_methods(true).include? 'insert' then
1229
1229
  def insert(*args)
1230
1230
  raise(ArgumentError, "can't insert nil") unless args.length > 1
1231
1231
  is_a_image_array args[1,args.length-1]
@@ -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.9.2"
4
+ s.version = "1.9.3"
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
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.3
3
3
  specification_version: 1
4
4
  name: rmagick
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.9.2
7
- date: 2005-09-15
6
+ version: 1.9.3
7
+ date: 2005-10-17
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