[前][次][番号順一覧][スレッド一覧]

ruby-changes:22565

From: drbrain <ko1@a...>
Date: Wed, 15 Feb 2012 10:28:15 +0900 (JST)
Subject: [ruby-changes:22565] drbrain:r34614 (trunk): * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE

drbrain	2012-02-15 10:28:05 +0900 (Wed, 15 Feb 2012)

  New Revision: 34614

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34614

  Log:
    * ext/zlib/zlib.c (Init_zlib):  Added Zlib::FIXED and Zlib::RLE
      strategies.
    * NEWS:  Add note about the new Zlib constants.

  Modified files:
    trunk/ChangeLog
    trunk/NEWS
    trunk/ext/zlib/zlib.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34613)
+++ ChangeLog	(revision 34614)
@@ -1,3 +1,9 @@
+Wed Feb 15 09:27:45 2012  Eric Hodel  <drbrain@s...>
+
+	* ext/zlib/zlib.c (Init_zlib):  Added Zlib::FIXED and Zlib::RLE
+	  strategies.
+	* NEWS:  Add note about the new Zlib constants.
+
 Wed Feb 15 09:11:36 2012  Eric Hodel  <drbrain@s...>
 
 	* ext/zlib/zlib.c:  Improve documentation.  [ruby-trunk - Bug #5948]
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 34613)
+++ ext/zlib/zlib.c	(revision 34614)
@@ -1329,13 +1329,21 @@
  *
  * Zlib::FILTERED::
  *   For data produced by a filter (or predictor). The effect of FILTERED is
- *   to force more Huffman coding and less string matching; it is somewhat
+ *   to force more Huffman codes and less string matching; it is somewhat
  *   intermediate between DEFAULT_STRATEGY and HUFFMAN_ONLY. Filtered data
  *   consists mostly of small values with a somewhat random distribution.
  *
+ * Zlib::FIXED::
+ *   Prevents the use of dynamic Huffman codes, allowing for a simpler decoder
+ *   for specialized applications.
+ *
  * Zlib::HUFFMAN_ONLY::
  *   Use Huffman encoding only (no string matching).
  *
+ * Zlib::RLE::
+ *   Designed to be almost as fast as HUFFMAN_ONLY, but give better
+ *   compression for PNG image data.
+ *
  * == Examples
  *
  * === Basic
@@ -4209,6 +4217,18 @@
      *
      * Which is an argument for Deflate.new and Deflate#params. */
     rb_define_const(mZlib, "HUFFMAN_ONLY", INT2FIX(Z_HUFFMAN_ONLY));
+#ifdef Z_RLE
+    /* compression method 3
+     *
+     * Which is an argument for Deflate.new and Deflate#params. */
+    rb_define_const(mZlib, "RLE", INT2FIX(Z_RLE));
+#endif
+#ifdef Z_FIXED
+    /* compression method 4
+     *
+     * Which is an argument for Deflate.new and Deflate#params. */
+    rb_define_const(mZlib, "FIXED", INT2FIX(Z_FIXED));
+#endif
     /* compression method 0
      *
      * Which is an argument for Deflate.new and Deflate#params. */
Index: NEWS
===================================================================
--- NEWS	(revision 34613)
+++ NEWS	(revision 34614)
@@ -62,6 +62,9 @@
     * Shellwords#shelljoin() accepts non-string objects in the given
       array, each of which is stringified using to_s.
 
+* zlib
+  * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
+
 === Language changes
 === Compatibility issues (excluding feature bug fixes)
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]