From 4bf278aa9b57de1cab816bc96d007d0c57415ff2 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 28 Dec 2000 18:58:37 +0000
Subject: [PATCH] options + typos

---
 Common/Context.h   |  6 ++++--
 Common/Options.h   | 16 ++++++++++------
 DataStr/Malloc.cpp |  3 ++-
 Unix/CbFile.cpp    | 14 +++++++++++---
 www/gmsh.html      |  6 +++---
 5 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/Common/Context.h b/Common/Context.h
index 97b1cc26b6..a32ee1c9bc 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -1,4 +1,4 @@
-/* $Id: Context.h,v 1.24 2000-12-27 17:25:52 geuzaine Exp $ */
+/* $Id: Context.h,v 1.25 2000-12-28 18:58:37 geuzaine Exp $ */
 #ifndef _CONTEXT_H_
 #define _CONTEXT_H_
 
@@ -143,7 +143,9 @@ class Context_T {
   /* print options */
   struct{
     int format;
-    int eps_quality, jpeg_quality;
+    int eps_quality;
+    int jpeg_quality;
+    int gif_dither, gif_sort, gif_interlace, gif_transparent;
     char *font;
     int  font_size, gl_fonts;
   } print;
diff --git a/Common/Options.h b/Common/Options.h
index d60e256018..d4e274aa5f 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -1,4 +1,4 @@
-/* $Id: Options.h,v 1.13 2000-12-27 17:25:52 geuzaine Exp $ */
+/* $Id: Options.h,v 1.14 2000-12-28 18:58:37 geuzaine Exp $ */
 #ifndef _OPTIONS_H_
 #define _OPTIONS_H_
 
@@ -197,11 +197,15 @@ StringXNumber PostProcessingOptions_Number[] = {
 } ;
 
 StringXNumber PrintOptions_Number[] = {
-  { "Format"      , GMSH_INT,    (void*)&CTX.print.format       , FORMAT_AUTO }, 
-  { "EpsQuality"  , GMSH_INT,    (void*)&CTX.print.eps_quality  , 1 }, 
-  { "JpegQuality" , GMSH_INT,    (void*)&CTX.print.jpeg_quality , 100 }, 
-  { "FontSize"    , GMSH_INT,    (void*)&CTX.print.font_size    , 12. }, 
-  { NULL          , GMSH_DOUBLE, NULL , 0. }
+  { "Format"         , GMSH_INT,    (void*)&CTX.print.format         , FORMAT_AUTO }, 
+  { "EpsQuality"     , GMSH_INT,    (void*)&CTX.print.eps_quality    , 1 }, 
+  { "JpegQuality"    , GMSH_INT,    (void*)&CTX.print.jpeg_quality   , 100 }, 
+  { "GifDither"      , GMSH_INT,    (void*)&CTX.print.gif_dither     , 1 }, 
+  { "GifSort"        , GMSH_INT,    (void*)&CTX.print.gif_sort       , 1 }, 
+  { "GifInterlace"   , GMSH_INT,    (void*)&CTX.print.gif_interlace  , 0 }, 
+  { "GifTransparent" , GMSH_INT,    (void*)&CTX.print.gif_transparent, 0 }, 
+  { "FontSize"       , GMSH_INT,    (void*)&CTX.print.font_size      , 12. }, 
+  { NULL             , GMSH_DOUBLE, NULL , 0. }
 } ;
 
 // COLORS
diff --git a/DataStr/Malloc.cpp b/DataStr/Malloc.cpp
index b2db54f1f3..316b2d924e 100644
--- a/DataStr/Malloc.cpp
+++ b/DataStr/Malloc.cpp
@@ -1,4 +1,4 @@
-/* $Id: Malloc.cpp,v 1.4 2000-11-26 18:43:48 geuzaine Exp $ */
+/* $Id: Malloc.cpp,v 1.5 2000-12-28 18:58:37 geuzaine Exp $ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <malloc.h>
@@ -41,4 +41,5 @@ void Free(void *ptr)
 {
   if (ptr == NULL) return;
   free(ptr);
+  ptr = NULL;
 }
diff --git a/Unix/CbFile.cpp b/Unix/CbFile.cpp
index d3297a8a74..4f78febc0c 100644
--- a/Unix/CbFile.cpp
+++ b/Unix/CbFile.cpp
@@ -1,4 +1,4 @@
-/* $Id: CbFile.cpp,v 1.18 2000-12-27 10:07:23 geuzaine Exp $ */
+/* $Id: CbFile.cpp,v 1.19 2000-12-28 18:58:37 geuzaine Exp $ */
 
 #include <unistd.h>
 
@@ -124,7 +124,8 @@ void CreateFile (char *name, int format) {
     }
     Replot();
     create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0],
-		CTX.viewport[3]-CTX.viewport[1]);
+		CTX.viewport[3]-CTX.viewport[1],
+		CTX.print.jpeg_quality);
     Msg(INFOS, "JPEG Creation Complete '%s'", name);
     Msg (INFO, "Wrote File '%s'", name);
     fclose(fp);
@@ -137,7 +138,14 @@ void CreateFile (char *name, int format) {
     }
     Replot();
     create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
-               CTX.viewport[3]-CTX.viewport[1]);
+               CTX.viewport[3]-CTX.viewport[1], 
+	       CTX.print.gif_dither,
+	       CTX.print.gif_sort, 
+	       CTX.print.gif_interlace,
+	       CTX.print.gif_transparent,
+	       UNPACK_RED(CTX.color.bg),
+	       UNPACK_GREEN(CTX.color.bg),
+	       UNPACK_BLUE(CTX.color.bg));
     Msg(INFOS, "GIF Creation Complete '%s'", name);
     Msg (INFO, "Wrote File '%s'", name);
     fclose(fp);
diff --git a/www/gmsh.html b/www/gmsh.html
index 0bbb1f8a5d..cedce8a877 100644
--- a/www/gmsh.html
+++ b/www/gmsh.html
@@ -304,9 +304,9 @@ files.
   <td><font face="Helvetica, Arial" size=-1> 
 
 New in 1.00: Added PPM and YUV output; Corrected nested If/Endif;
-Corrected seg. fault on repeated saves; Slightly changed the
-post-processing file format to allow both single and double precision
-numbers.
+Corrected several bugs for pixel output and enhanced GIF output
+(dithering, transparency); Slightly changed the post-processing file
+format to allow both single and double precision numbers.
 <p>
 New in 0.999: Added JPEG output and easy MPEG generation (see t8.geo in the
 tutorial); Clean up of export functions; small fixes; Linux versions
-- 
GitLab