about summary refs log tree commit diff
path: root/converter/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-04-16 19:30:48 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-04-16 19:30:48 +0000
commit647dc5f9e0d5e89dc6ec3f75a9b107da50156a1e (patch)
treef147cc68351b7edfce2eeb9b7fed28360e7c7126 /converter/other
parent971d2e55d00ab6e10d3fd496df30e0001a09b1e4 (diff)
downloadnetpbm-mirror-647dc5f9e0d5e89dc6ec3f75a9b107da50156a1e.tar.gz
netpbm-mirror-647dc5f9e0d5e89dc6ec3f75a9b107da50156a1e.tar.xz
netpbm-mirror-647dc5f9e0d5e89dc6ec3f75a9b107da50156a1e.zip
Add pngx_setText, pngx_setIhdr, pngx_writeInfo, pngx_writeEnd in preparation for ending direct access to private png_info members
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1473 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r--converter/other/pngx.c43
-rw-r--r--converter/other/pngx.h25
2 files changed, 67 insertions, 1 deletions
diff --git a/converter/other/pngx.c b/converter/other/pngx.c
index 22124b2a..f9d2491f 100644
--- a/converter/other/pngx.c
+++ b/converter/other/pngx.c
@@ -101,3 +101,46 @@ pngx_chunkIsPresent(struct pngx * const pngxP,
 
 
 
+void
+pngx_setText(struct pngx * const pngxP,
+             png_textp     const textP,
+             unsigned int  const count) {
+
+    png_set_text(pngxP->png_ptr, pngxP->info_ptr, textP, count);
+}
+
+
+
+void
+pngx_setIhdr(struct pngx * const pngxP,
+             unsigned int  const width,
+             unsigned int  const height,
+             unsigned int  const bitDepth,
+             int           const colorType,
+             int           const interlaceMethod,
+             int           const compressionMethod,
+             int           const filterMethod) {
+
+    png_set_IHDR(pngxP->png_ptr, pngxP->info_ptr, width, height,
+                 bitDepth, colorType, interlaceMethod, compressionMethod,
+                 filterMethod);
+}
+
+
+
+void
+pngx_writeInfo(struct pngx * const pngxP) {
+
+    png_write_info(pngxP->png_ptr, pngxP->info_ptr);
+}
+
+
+
+void
+pngx_writeEnd(struct pngx * const pngxP) {
+
+    png_write_end(pngxP->png_ptr, pngxP->info_ptr);
+}
+
+
+
diff --git a/converter/other/pngx.h b/converter/other/pngx.h
index 3ee8321a..f9658c58 100644
--- a/converter/other/pngx.h
+++ b/converter/other/pngx.h
@@ -1,6 +1,9 @@
 #ifndef PNGX_H_INCLUDED
 #define PNGX_H_INCLUDED
 
+#include <png.h>
+#include "pm_c_util.h"
+
 /* pngx is designed to be an extension of the PNG library to make using
    the PNG library easier and cleaner.
 */
@@ -22,9 +25,29 @@ pngx_create(struct pngx ** const pngxPP,
 void
 pngx_destroy(struct pngx * const pngxP);
 
-
 bool
 pngx_chunkIsPresent(struct pngx * const pngxP,
                     uint32_t      const chunkType);
 
+void
+pngx_setText(struct pngx * const pngxP,
+             png_textp     const textP,
+             unsigned int  const count);
+
+void
+pngx_setIhdr(struct pngx * const pngxP,
+             unsigned int  const width,
+             unsigned int  const height,
+             unsigned int  const bitDepth,
+             int           const colorType,
+             int           const interlaceMethod,
+             int           const compressionMethod,
+             int           const filterMethod);
+
+void
+pngx_writeInfo(struct pngx * const pngxP);
+
+void
+pngx_writeEnd(struct pngx * const pngxP);
+
 #endif