about summary refs log tree commit diff
path: root/lib/pam.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pam.h')
-rw-r--r--lib/pam.h75
1 files changed, 48 insertions, 27 deletions
diff --git a/lib/pam.h b/lib/pam.h
index 0055858b..94c85b4e 100644
--- a/lib/pam.h
+++ b/lib/pam.h
@@ -136,6 +136,18 @@ struct pam {
         /* The plane number of the opacity plane;  meaningless if
            'haveOpacity' is false or 'visual' is false.
         */
+    int is_seekable;  /* boolean */
+        /* The file 'file' is seekable -- you can set the position of next
+           reading or writing to anything and any time.
+
+           If libnetpbm cannot tell if it is seekable or not, this is false.
+        */
+    pm_filepos raster_pos;
+        /* The file position of the raster (which is also the end of the
+           header).
+
+           Meaningless if 'is_seekable' is false.
+        */
 };
 
 #define PAM_HAVE_ALLOCATION_DEPTH 1
@@ -220,33 +232,6 @@ struct pamtuples {
 };
 
 
-typedef float * pnm_transformMap;
-    /* This is an array of transform maps.  transform[N] is the
-       array that is the map for Plane N.
-
-       Transform maps define a transformation between PAM sample value
-       to normalized libnetpbm "samplen" value, i.e. what you get back
-       from pnm_readpamrown() or pass to pnm_writepamrown().
-       Typically, it's a gamma transfer function generated by
-       pnm_creategammatransform() or pnm_createungammatransform().
-
-       NULL for any transform means just plain normalization -- divide
-       the PAM sample value by the maxval to get the samplen, multiply
-       samplen by the maxval and round to get PAM sample value.
-
-       NULL for map table, or 'transform' member not present (pam
-       structure is too small to contain it) means ALL transforms
-       are plain normalization.
-
-       Each transform map is an array indexed by a PAM sample
-       value, containing 'float' values.  So it must have 'maxval'
-       entries.  The sample -> samplen tranformation is just the
-       obvious table lookup.  The samplen -> sample transformation is
-       more complicated -- if the samplen value is between map[N]
-       and map[N+1], then the sample value is N.  And only transforms
-       where map[N+1] > map[N] are allowed.
-    */
-
 /* Declarations of library functions. */
 
 /* We don't have a specific PAM function for init and nextimage, because
@@ -320,6 +305,9 @@ pnm_getopacity(const struct pam * const pamP,
 void
 pnm_createBlackTuple(const struct pam * const pamP, tuple * const blackTupleP);
 
+void
+pnm_createWhiteTuple(const struct pam * const pamP, tuple * const whiteTupleP);
+
 tuple
 pnm_allocpamtuple(const struct pam * const pamP);
 
@@ -368,6 +356,12 @@ void
 pnm_writepaminit(struct pam * const pamP);
 
 void
+pnm_formatpamtuples(const struct pam * const pamP,
+                    const tuple *      const tuplerow,
+                    unsigned char *    const outbuf,
+                    unsigned int       const nTuple,
+                    unsigned int *     const rowSizeP);
+void
 pnm_formatpamrow(const struct pam * const pamP,
                  const tuple *      const tuplerow,
                  unsigned char *    const outbuf,
@@ -382,6 +376,14 @@ pnm_writepamrowmult(const struct pam * const pamP,
                     unsigned int       const rptcnt);
 
 void
+pnm_writepamrowpart(const struct pam * const pamP,
+                    const tuple *      const tuplerow,
+                    unsigned int       const firstRow,
+                    unsigned int       const firstCol,
+                    unsigned int       const rowCt,
+                    unsigned int       const colCt);
+
+void
 pnm_writepam(struct pam * const pamP, tuple ** const tuplearray);
 
 void
@@ -438,6 +440,21 @@ void
 pnm_writepamn(struct pam * const pamP,
               tuplen **    const tuplenarray);
 
+typedef samplen * pnm_transformMap;
+    /* This defines a transformation between PAM sample value
+       to normalized libnetpbm "samplen" value, i.e. what you get back
+       from pnm_readpamrown() or pass to pnm_writepamrown().
+       Typically, it's a gamma transfer function generated by
+       pnm_creategammatransform() or pnm_createungammatransform().
+
+       It is an array indexed by a PAM sample value, containing 'float'
+       values.  So it must have 'maxval' entries.  The sample -> samplen
+       transformation is just the obvious table lookup.  The samplen -> sample
+       transformation is more complicated -- if the samplen value is between
+       map[N] and map[N+1], then the sample value is N.  And only transforms
+       where map[N+1] > map[N] are allowed.
+    */
+
 samplen
 pnm_normalized_sample(struct pam * const pamP,
                       sample       const sample);
@@ -576,6 +593,10 @@ tuple
 pnm_backgroundtuple(struct pam *  const pamP,
                     tuple      ** const tuples);
 
+tuple
+pnm_backgroundtuplerow(const struct pam * const pamP,
+                       tuple      *       const tuplerow);
+
 /*----------------------------------------------------------------------------
    These are meant for passing to pm_system() as Standard Input feeder
    and Standard Output accepter.