src/lib/vPng.c 1.2

1.2 2009/08/20 21:36:17 angie
Corrected terminology: PNG palette images do not have an alpha channel, just a parallel map of opacity values. So useAlpha-->useTransparency.
Index: src/lib/vPng.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/vPng.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/lib/vPng.c	5 Aug 2009 23:34:31 -0000	1.1
+++ src/lib/vPng.c	20 Aug 2009 21:36:17 -0000	1.2
@@ -13,9 +13,9 @@
 /* Something that handles a PNG. */
     {
     struct memGfx mg;	/* Memory form.  This needs to be first field. */
     char *fileName;	/* PNG file name. */
-    boolean useAlpha;   /* Do we use alpha channel for transparency of background color? */
+    boolean useTransparency;   /* Make background color transparent if TRUE. */
     };
 
 void memPngClose(struct memPng **pG)
 /* Write out and close and free. */
@@ -23,18 +23,18 @@
 struct memPng *g = *pG;
 if (g != NULL)
     {
     struct memGfx *mg = (struct memGfx *)g;
-    mgSavePng(mg, g->fileName, g->useAlpha);
+    mgSavePng(mg, g->fileName, g->useTransparency);
     freez(&g->fileName);
     mgFree(&mg);
     *pG = NULL;
     }
 }
 
-struct vGfx *vgOpenPng(int width, int height, char *fileName, boolean useAlpha)
+struct vGfx *vgOpenPng(int width, int height, char *fileName, boolean useTransparency)
 /* Open up something that will write out a PNG file upon vgClose.  
- * If useAlpha, then the first color in memgfx's colormap/palette is
+ * If useTransparency, then the first color in memgfx's colormap/palette is
  * assumed to be the image background color, and pixels of that color
  * are made transparent. */
 {
 struct memPng *png;
@@ -49,9 +49,9 @@
 /* Get our mg + fileName structure.  We're forcing
  * inheritence from mg essentially. */
 AllocVar(png);
 png->fileName = cloneString(fileName);
-png->useAlpha = useAlpha;
+png->useTransparency = useTransparency;
 
 /* Fill in the mg part of this structure with normal memGfx. */
 mg = mgNew(width, height);
 mgClearPixels(mg);