IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1207


Ignore:
Timestamp:
Jul 12, 2004, 12:18:21 PM (22 years ago)
Author:
eugene
Message:

fixed various bugzilla entries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r1092 r1207  
    1 %%% $Id: psLibSDRS.tex,v 1.59 2004-06-25 03:10:26 eugene Exp $
    2 \documentclass[panstarrs]{panstarrs}
     1%%% $Id: psLibSDRS.tex,v 1.60 2004-07-12 22:18:21 eugene Exp $
     2\documentclass[panstarrs,spec]{panstarrs}
    33
    44% basic document variables
     
    1010\project{Pan-STARRS Image Processing Pipeline}
    1111\organization{Institute for Astronomy}
    12 \version{02}
     12\version{03}
    1313\docnumber{PSDC-430-007}
    1414% note the use of the docnumber & version number:
     
    132132star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html}
    133133
     134\item libTAI will be used for time-related functions:
     135
     136\href{http://cr.yp.to/libtai.html}{\tt http://cr.yp.to/libtai.html}
     137
    134138\end{itemize}
    135139
     
    215219special value, \code{P_PS_MEMMAGIC}.  The segment following the
    216220user-memory block consists of a single \code{void} pointer, and is
    217 also assigned the special value of \code{P_PS_MEMMAGIC}.  This address
    218 is pointed to by the structure element \code{endpost}.
     221also assigned the special value of \code{P_PS_MEMMAGIC}.  The element
     222\code{userMemorySize} specifies the number of bytes allocated in the
     223user block and allows the endpost to be found.
    219224
    220225In practice, these bounding memory blocks mean that when a user
     
    245250which is also easily recognized in a dump of the memory table.
    246251
    247 The PSLib memory management system must maintain a private table of
    248 the allocated memory blocks.  The table includes a list of pointers to
    249 structures of type \code{psMemBlock}, defined as follows:
     252The structure \code{psMemBlock} specifies additional information
     253maintained for each block of allocated memory, and is defined as
     254follows:
    250255%
    251256\begin{verbatim}
    252257typedef struct {
    253     const void *startblock;             ///< initialised to P_PS_MEMMAGIC
    254     const unsigned long id;             ///< a unique ID for this allocation
    255     const char *file;                   ///< set from __FILE__ in e.g. p_psAlloc
     258    const void* startblock;             ///< initialised to p_psMEMMAGIC
     259    struct psMemBlock* previousBlock;   ///< previous block in allocation list
     260    struct psMemBlock* nextBlock;       ///< next block allocation list
     261    psFreeFcn freeFcn;                  ///< deallocator.  If NULL, use generic deallocation.
     262    size_t  userMemorySize;             ///< the size of the user-portion of the memory block
     263    const psMemoryId id;                ///< a unique ID for this allocation
     264    const char* file;                   ///< set from __FILE__ in e.g. p_psAlloc
    256265    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
    257     int refCounter;                     ///< how many times pointer is referenced
    258     const void **endpost;               ///< initialised to P_PS_MEMMAGIC
    259     const void *endblock;               ///< initialised to P_PS_MEMMAGIC
     266    pthread_mutex_t   refCounterMutex;  ///< mutex to ensure exclusive access to reference counter
     267    psReferenceCount refCounter;        ///< how many times pointer is referenced
     268    const void* endblock;               ///< initialised to p_psMEMMAGIC
    260269} psMemBlock;
    261 \end{verbatim}
    262 %
    263 The second element in the structure is a sequential memory block ID.
    264 The memory management system must maintain an internal memory block ID
    265 counter from which a new ID may be supplied to each newly allocated
    266 block of memory and saved in the element \code{id}.  This ID should
    267 also be the key to the memory block in the memory block table.
     270
     271typedef void (*psFreeFcn)(void* ptr);
     272typedef unsigned long psMemoryId;
     273typedef unsigned long psReferenceCount;
     274\end{verbatim}
     275%
     276The PSLib memory management system must maintain the collection of
     277allocated memory blocks.  The entries \code{previousBlock} and
     278\code{nextBlock} point to the previous and next memory blocks
     279allocated by the memory management system (if they exist, or else
     280\code{NULL}) and are used to scan through memory blocks as a linked
     281list.
     282
     283The element \code{freeFcn} specifies the deallocator associated with a
     284specific block of memory.  If this element is \code{NULL}, the basic
     285deallocator is used and the memory block must not be a rich data
     286structure which requires additional freeing functionality.
     287
     288The element \code{id} in the structure is a sequential memory block
     289ID.  The memory management system must maintain an internal memory
     290block ID counter from which a new ID may be supplied to each newly
     291allocated block of memory and saved in the element \code{id}.  This ID
     292should also be the key to the memory block in the memory block table.
    268293
    269294The two entries \code{file} and \code{lineno} are set to the line
     
    273298below that the basic memory managment functions be implemented as
    274299preprocessor macros which wrap the intrinsic C level functions.
     300
     301The element \code{refCounterMutex} is a mutex used to limit access to
     302the reference counter (below) to a single thread at a time.
    275303
    276304The \code{psMemBlock} structure element \code{refCounter} is provided
     
    284312In order to trace double frees and other memory errors, the memory
    285313block reference is not automatically deleted when the assocated memory
    286 is deleted.  Rather, the \code{psMemBlock} data and the \code{endpost}
    287 data are left behind.  If endpost points to the memory location
    288 immediately following the \code{psMemBlock} data, then the memory
    289 block has been freed.  This state must be enforced by \code{psFree}.
     314is deleted.  Rather, the \code{psMemBlock} data and the endpost data
     315are left behind.  If \code{userMemorySize} is 0, then the memory block
     316has been freed.  This state must be enforced by \code{psFree}.  This
     317behavior, in which the associated \code{psMemBlock} is retained, is
     318only provided if the code is compiled with the preprocessor variable
     319\code{PS_MEM_DEBUG} defined.
    290320
    291321\subsubsection{APIs for Allocating and Freeing}
     
    334364\code{NULL} pointer. If they are unable to provide the requested
    335365memory they must attempt to obtain the desired memory by calling the
    336 routine registered by \code{psMemExhaustedSetCallback} (see
     366routine registered by \code{psMemExhaustedCallbackSet} (see
    337367\S\ref{secMemAdvanced}), and if still unsuccessful, call
    338368\code{psAbort()}.  The same behavior is true for constructors of rich
     
    346376define the initialization independently since a byte value of 0 is
    347377usually insufficient.
     378
     379\begin{verbatim}
     380  void p_psSetFreeFcn(void* ptr);     
     381  ///< sets the fcn pointer to the appropriate ps*Free function.  If NULL,
     382  ///< then a generic free functionality is used (i.e., the old psFree
     383  ///< functionality).
     384
     385  freeFcn p_psGetFreeFcn(void* ptr);
     386  ///< retrieves the function pointer to the higher-level free function to be
     387  ///< used.  If NULL, then the traditional psFree functionality shall be used.
     388\end{verbatim}
    348389
    349390\subsubsection{Callback Routines}
     
    457498%
    458499The callback functions are called with a pointer to the corresponding
    459 memory block.  The routines \code{psMemFreeIDSet} and
    460 \code{psMemAllocateIDSet} accept the desired ID value and return the
     500memory block.  The routines \code{psMemFreeCallbackIDSet} and
     501\code{psMemAllocateCallbackIDSet} accept the desired ID value and return the
    461502old value to the user.  The return values of the handlers installed by
    462503\code{psMemAllocateCallbackSet} and \code{psMemFreeCallbackSet} are
     
    481522\begin{verbatim}
    482523int psMemCheckLeaks(long id0, psMemBlock ***array, FILE *fd);
    483 int psMemCheckCorruption(int abort_on_error);
     524int psMemCheckCorruption(bool abort_on_error);
    484525\end{verbatim}
    485526%
     
    551592variety of rich data structures.  The IPP Software Requirements
    552593Specification states that structures should be defined with
    553 corresponding constructors and destructors.  Instances of, for
    554 example, \code{psMyType} should be constructed using
    555 \code{psMyTypeAlloc()} calls, and destroyed using
    556 \code{psMyTypeFree()} calls.  The allocator will allocate the required
     594corresponding constructors and destructors.  The destructors are
     595private functions used only by the memory management system.
     596Instances of, for example, \code{psMyType} should be constructed using
     597\code{psMyTypeAlloc()} calls, and are destroyed using the basic
     598\code{psFree} function, which calls \code{psMyTypeFree()} to free the
     599components of the structure, but leaves the task of freeing the
     600structure to \code{psFree}.  The allocator will allocate the required
    557601memory with \code{psAlloc} and increment the appropriate
    558602\code{refCounter}.
     
    888932that is passed to \code{psLogMsgV} with code \code{PS_LOG_ERROR}.  The
    889933result of a call to \code{psError} must be to push an error onto a
    890 stack; this stack is cleared if \code{psErrorStatus} is true, or by a
    891 call to \code{psErrorClear}.
     934stack; this stack is cleared if \code{new} is true, or by a call to
     935\code{psErrorClear}.
    892936
    893937The errors on the error stack are defined as the following:
     
    920964defined in the next section.  Note that these are also available in
    921965the \code{psErr} structure. The successive lines of the traceback
    922 should be indented by an additional space (see example).
    923 \code{psErrorStackPrintV} must not invoke \code{va_end}.
     966should be indented by an additional space.  \code{psErrorStackPrintV}
     967must not invoke \code{va_end}.
    924968%
    925969\begin{verbatim}
     
    11131157    PS_TYPE_F64,                        ///< Double-precision floating point
    11141158    PS_TYPE_C32,                        ///< Complex numbers consisting of floats
     1159    PS_TYPE_C64,                        ///< Complex numbers consisting of doubles
    11151160    PS_TYPE_OTHER,                      ///< Not supported for arithmetic
    11161161} psElemType;
     
    11191164section~\ref{sec:arithmetic}. 
    11201165
     1166\subsection{Simple Scalars}
     1167
     1168We define a basic scalar data type which includes the type
     1169information.  This structure allows scalars to be used in functions
     1170which interpret the data type from the structure when deciding how to
     1171perform an operation.  The basic scalar structure is:
     1172\begin{verbatim}
     1173typedef struct {
     1174    psType type;                        ///< data type information
     1175    union {                           
     1176        psS8   S8;                      ///< bye value entry
     1177        psS16 S16;                      ///< short int value entry
     1178        psU8   U8;                      ///< unsigned byte value entry
     1179        psU16 U16;                      ///< unsigned short int value entry
     1180        psF32 F32;                      ///< float value entry
     1181        psF64 F64;                      ///< double value entry
     1182        psC32 C32;                      ///< complex value entry
     1183        psC64 C64;                      ///< double complex value entry
     1184    } data;
     1185} p_psScalar;
     1186\end{verbatim}
     1187
     1188In addition, we specify two functions for working with \code{psScalar} data:
     1189\begin{verbatim}
     1190psScalar *psScalarAlloc (psC64 value, psElemType dataType);
     1191psScalar *psScalarCopy (psScalar *value);
     1192\end{verbatim}
     1193The first creates a \code{psType}-ed structure from a constant value,
     1194casting it as appropriate based on the \code{dataType}.  The second
     1195copies the provided \code{psScalar} value.  This latter function is
     1196necessary to keep a copy of an existing \code{psScalar} value, since
     1197\code{psBinaryOp} and \code{psUnaryOp} are required to free incoming
     1198\code{psScalar} data (see \S\ref{sec:arithmetic}).
     1199
    11211200\subsection{Simple Vectors}
    11221201
    11231202We require several related types of basic one-dimensional arrays:
    11241203arrays of values of type \code{int}, \code{float}, \code{double},
    1125 \code{complex float}, and \code{void *}.  We have defined a single
    1126 structure, \code{psVector} to represent these concepts:
     1204\code{complex float}, and \code{complex double}.  We have defined a
     1205single structure, \code{psVector} to represent these concepts:
    11271206%
    11281207\begin{verbatim}
     
    11321211    const int nalloc;                   ///< allocated data block
    11331212    union {
    1134         psS8  *S8;                      ///< Pointers to short-integer data
     1213        psS8  *S8;                      ///< Pointers to byte data
    11351214        psS16 *S16;                     ///< Pointers to short-integer data
    11361215        psS32 *S32;                     ///< Pointers to integer data
    11371216        psS64 *S64;                     ///< Pointers to long-integer data
    1138         psU8  *U18;                     ///< Pointers to unsigned-short-integer data
     1217        psU8  *U18;                     ///< Pointers to unsigned-byte data
    11391218        psU16 *U16;                     ///< Pointers to unsigned-short-integer data
    11401219        psU32 *U32;                     ///< Pointers to unsigned-integer data
     
    11421221        psF32 *F32;                     ///< Pointers to floating-point data
    11431222        psF64 *F64;                     ///< Pointers to double-precision data
    1144         psF32 *C32;                     ///< Pointers to complex floating-point data
    1145         void **void;
     1223        psC32 *C32;                     ///< Pointers to complex floating-point data
     1224        psC64 *C64;                     ///< Pointers to complex floating-point data
    11461225    } data;
    11471226} psVector;
     
    11611240psVector *psVectorAlloc(int nalloc, psElemType type);
    11621241psVector *psVectorRealloc(const psVector *vector, int nalloc);
    1163 void psVectorFree(psVector *restrict vector, void (*elemFree)(void *));
     1242void p_psVectorFree(psVector *restrict vector);
    11641243\end{verbatim}
    11651244%
     
    11731252and the extra elements are lost.  If \code{nalloc} is larger than the
    11741253current value of \code{psVector.n}, \code{psVector.n} is left intact.
    1175 If the value of \code{myArray} is \code{NULL}, then
    1176 \code{psVectorRealloc} must return an error.  In \code{psVectorFree},
    1177 the function \code{elemFree} is required for arrays of pointer types;
    1178 it is the destructor appropriate to the data pointed to by the
    1179 pointers.  This function, which may be \code{NULL}, is called for each
    1180 existing element of the array before the array itself is freed.  If
    1181 the function is \code{NULL}, the elements are are not freed.  This
    1182 function must not be defined for any data type except the \code{void}
    1183 pointer array.
     1254If the value of \code{vector} is \code{NULL}, then
     1255\code{psVectorRealloc} must return an error.
    11841256
    11851257\subsection{Simple Images}
     
    12061278        psF64 **F64;                    ///< Pointers to double-precision data
    12071279        psC32 **C32;                    ///< Pointers to complex floating-point data
     1280        psC64 **C64;                    ///< Pointers to complex floating-point data
    12081281    } data;
    12091282    const struct psImage *parent;       ///< parent, if a subimage
     
    12271300starting row number.  The structure may include references to
    12281301subrasters (\code{children, Nchildren}) and/or to a containing array
    1229 (\code{parent}).  Unless this is image is a child of another image
     1302(\code{parent}).  Unless this image is a child of another image
    12301303(represents a subset of the pixels of another image), the image data
    12311304is allocated in a contiguous block.  We define the following
    1232 supporting functions:
     1305supporting functions, which are valid for data types \code{psS8,
     1306psS16, psU8, psU16, psF32, psF64, psC32, psC64}.
    12331307
    12341308\begin{verbatim}
     
    12381312\code{type}.  This function must allow any of the valid image data
    12391313types and not restrict to the valid FITS BITPIX types.  The image
    1240 dimensionality must be 2.
    1241 
    1242 \begin{verbatim}
    1243 void psImageFree(psImage *image);
     1314dimensionality must be 2. 
     1315
     1316\begin{verbatim}
     1317void p_psImageFree(psImage *restrict image);
    12441318\end{verbatim}
    12451319Free the memory associated with a specific image, including the pixel
    12461320data. Free the children of the image if they exist.
    12471321
     1322\subsection{Simple Arrays}
     1323
     1324\tbd{fill out this section}
     1325
     1326We require an order collection of unspecified data elements.  We
     1327define \code{psArray} to carry such a collection:
     1328%
     1329\begin{verbatim}
     1330typedef struct {
     1331    const int n;                        ///< size of array
     1332    const int nalloc;                   ///< allocated data block
     1333    void **data;                        ///< pointer to data block
     1334} psArray;
     1335\end{verbatim}
     1336%
     1337In this structure, the argument \code{n} is the length of the array
     1338(the number of elements); \code{nalloc} is the number of elements
     1339allocated ($nalloc \ge n$).  The allocated memory is pointed to by
     1340\code{data}.  The structure is associated with a constructor and a
     1341destructor:
     1342%
     1343\begin{verbatim}
     1344psArray *psArrayAlloc(int nalloc, psElemType type);
     1345psArray *psArrayRealloc(const psArray *array, int nalloc);
     1346void p_psArrayFree(psArray *restrict array);
     1347\end{verbatim}
     1348%
     1349In these functions, \code{nalloc} is the number of elements to
     1350allocate.  For \code{psArrayAlloc}, the value of \code{psArray.n} is
     1351set to \code{nalloc}.  Users may choose to restrict the data range
     1352after the \code{psArrayAlloc} function is called.  For
     1353\code{psArrayRealloc}, if the value of \code{nalloc} is smaller than
     1354the current value of \code{psArray.n}, then \code{psArray.n} is set to
     1355\code{nalloc}, the array is adjusted down to match \code{nalloc}, and
     1356the extra elements are dropped and freed if necesitated by the
     1357reference counter.  If \code{nalloc} is larger than the current value
     1358of \code{psArray.n}, \code{psArray.n} is left intact.  If the value of
     1359\code{array} is \code{NULL}, then \code{psArrayRealloc} must return an
     1360error.
     1361
     1362\begin{verbatim}
     1363psArray *psArraySort(psArray *array, int (*compare)(const void **a, const void **b) );
     1364\end{verbatim}
     1365An array may be sorted using \code{psArraySort}, which requires the
     1366specification of a comparison function to specify how the objects on
     1367the list should be sorted.  The motivation is primarily to be able to
     1368iterate on a sorted list of keys from a hash.
     1369
    12481370\subsection{Doubly-linked lists}
    12491371\label{sec:psList}
     
    12531375\begin{verbatim}
    12541376typedef struct {
    1255    int n;                               ///< number of elements on list
     1377   unsigned int size;                  ///< number of elements on list
    12561378   psListElem *head;                   ///< first element on list (may be NULL)
    12571379   psListElem *tail;                   ///< last element on list (may be NULL)
    12581380   psListElem *iter;                   ///< iteration cursor
     1381   unsigned int iterIndex;             ///< the numeric position of the iteration cursor in the list
     1382   pthread_mutex_t lock;               ///< mutex to lock a node during changes
    12591383} psList;
    12601384\end{verbatim}
     
    13341458
    13351459\begin{verbatim}
    1336 void psListFree(psList *list, void (*elemFree)(void *));
    1337 \end{verbatim}
    1338 A complete list may be freed with this destructor.  If the element
    1339 destructor (\code{elemFree}) is \code{NULL}, the list should be
    1340 deleted, but not the elements, although their \code{refcounter}s
    1341 should be decremented.
    1342 
    1343 \begin{verbatim}
    1344 psVector *psListToVector(psList *list);
    1345 psList *psVectorToList(psVector *vector);
     1460void p_psListFree(psList *list);
     1461\end{verbatim}
     1462This function frees the data associated with the entire list.  This
     1463function is used by psFree to free a list with its associated data.
     1464
     1465\begin{verbatim}
     1466psArray *psListToArray(psList *list);
     1467psList  *psArrayToList(psArray *array);
    13461468\end{verbatim}
    13471469These two functions are available to convert between the
    1348 \code{psList} and \code{psVector} containers.  These functions do not
     1470\code{psList} and \code{psArray} containers.  These functions do not
    13491471free the elements or destroy the input collection.  Rather, they
    13501472increment the reference counter for each of the elements.
     
    13671489
    13681490\begin{verbatim}
    1369 psList *psListSort(psList *list, int (*compare)(const void *a, const void *b) );
     1491psList *psListSort(psList *list, int (*compare)(const void **a, const void **b) );
    13701492\end{verbatim}
    13711493A list may be sorted using \code{psListSort}, which requires the
     
    14451567a specific key may be removed (deleted) with the function:
    14461568\begin{verbatim}
    1447 void *psHashRemove(psHash *table, char *key);
     1569bool psHashRemove(psHash *table, char *key);
    14481570\end{verbatim}
    14491571The function returns a value of \code{true} if the operation was
    14501572successfull, and \code{false} otherwise.
    14511573
    1452 A complete hash table may be freed by calling:
    1453 \begin{verbatim}
    1454 void psHashFree(psHash *table, void (*itemFree)(void *item));
    1455 \end{verbatim}
    1456 where the function \code{itemFree} is provided to delete the
    1457 individual elements in the table.  If it is NULL it is the
    1458 responsibility of the caller to free the elements.
     1574The data associated with a complete hash table may be freed by calling:
     1575\begin{verbatim}
     1576void p_psHashFree(psHash *table);
     1577\end{verbatim}
    14591578
    14601579The function
    14611580\begin{verbatim}
    1462 psList *psHashKeylist(psHast *table);
     1581psList *psHashKeyList(psHash *table);
    14631582\end{verbatim}
    14641583returns the complete list of defined keys associated with the
     
    15041623\begin{verbatim}
    15051624psBitSet *psBitSetAlloc(int n);
    1506 void psBitSetFree(psBitSet *restrict myBits);
     1625void p_psBitSetFree(psBitSet *restrict myBits);
    15071626\end{verbatim}
    15081627where \code{n} is the requested number of bits.
     
    15531672value in the last element.  The input vector, \code{in}, may be sorted
    15541673in-place if it is also specified as the \code{out} vector. This
    1555 function is specified for input types \code{psU8, psU16, psF32,
     1674function is specified for input types \code{psS8, psU16, psF32,
    15561675psF64}.  The input and output vectors must have the same type.
    15571676
    15581677\begin{verbatim}
    1559 psVector *psSort(psVector *out, const psVector *restrict in);
     1678psVector *psVectorSort(psVector *out, const psVector *restrict in);
    15601679\end{verbatim}
    15611680
     
    15681687largest (i.e.\ most positive) value in the last element.  The output
    15691688vector must be of type \code{psU32}.  This function is specified for
    1570 input types \code{psU8, psU16, psF32, psF64}.
    1571 
    1572 \begin{verbatim}
    1573 psVector *psSortIndex(psVector *restrict out; const psVector *restrict in);
     1689input types \code{psS8, psU16, psF32, psF64}.
     1690
     1691\begin{verbatim}
     1692psVector *psVectorSortIndex(psVector *restrict out; const psVector *restrict in);
    15741693\end{verbatim}
    15751694
    15761695The sorted vectors may be accessed in the following manner:
    15771696\begin{verbatim}
    1578 indexVector = psSortIndex(NULL, x);
     1697indexVector = psVectorSortIndex(NULL, x);
    15791698for (int i = 0; i < indexVector.n; i++) {
    15801699    doMyFunc(x[indexVector.arr.arr_U32[i]], y[indexVector[i].arr.arr_U32]);
    15811700}
    15821701\end{verbatim}
     1702
    15831703
    15841704%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    16341754The defaults for these two numbers is both 3.  Since the sample
    16351755statistics scale like $N\log N$, for large numbers of input data
    1636 points, it is faster to use the robust statistics.  If the number of
    1637 data points is large, \code{psStats} must revert to the robust
    1638 calculation even if the user requested sample statistics.  The values
    1639 should be returned in the \code{sample} fields, but the bit
    1640 \code{PS_STAT_ROBUST_FOR_SAMPLE} in \code{options} must be set in this
    1641 case.  The cutoff for this decision must be made on the basis of the
    1642 value in \code{sampleLimit}, which should have a default of $3 \times
    1643 10^{5}$.  Default input field values must be set by the \code{psStats}
    1644 constructor.  The input vector may be of type \code{psU8},
    1645 \code{psU16}, \code{psF32}, \code{psF64}; the mask must be of type
    1646 \code{psU8}.
     1756points, it is faster to use the robust statistics.  Default input
     1757field values must be set by the \code{psStats} constructor.  The input
     1758vector may be of type \code{psU8}, \code{psU16}, \code{psF32},
     1759\code{psF64}; the mask must be of type \code{psU8}.
    16471760
    16481761The \code{psStats} structure is defined with entries for each of the
     
    16981811    PS_STAT_USE_RANGE             = 0x002000,
    16991812    PS_STAT_USE_BINSIZE           = 0x004000
    1700     PS_STAT_ROBUST_FOR_SAMPLE     = 0x008000
    17011813} psStatsOptions;                         
    17021814\end{verbatim}
     
    17061818\begin{verbatim}
    17071819psStats *psStatsAlloc(psStatsOptions options);
    1708 void psStatsFree(psStats *restrict stats);
     1820void p_psStatsFree(psStats *restrict stats);
    17091821\end{verbatim}
    17101822
     
    17201832    psVector *nums;                     ///< Number in each of the bins
    17211833    int minNum, maxNum;                 ///< Number below minimum / above maximum
    1722     int uniform;                        ///< Is it a uniform distribution?
     1834    bool uniform;                        ///< Is it a uniform distribution?
    17231835} psHistogram;
    17241836\end{verbatim}
     
    17551867A histogram is free with the destructor:
    17561868\begin{verbatim}
    1757 void psHistogramFree(psHistogram *restrict myHist);
     1869void p_psHistogramFree(psHistogram *restrict myHist);
    17581870\end{verbatim}
    17591871
     
    18331945\begin{verbatim}
    18341946psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY);
    1835 void psDPolynomial2DFree(psDPolynomial2D *restrict myPoly);
     1947void p_psDPolynomial2DFree(psDPolynomial2D *restrict myPoly);
    18361948\end{verbatim}
    18371949where \code{nX} and \code{nY} are the number of terms in x and y
     
    18531965The Gaussian evaluation is provide by:
    18541966\begin{verbatim}
    1855 float psGaussian(float x, float mean, float sigma, int normal);
     1967float psGaussian(float x, float mean, float sigma, bool normal);
    18561968\end{verbatim}
    18571969which evaluates a Gaussian with the given \code{mean} and \code{sigma}
     
    19062018Note that \code{paramMask} must be of type \code{psU8}, while
    19072019\code{params} must be of type \code{psF32}.  The optional function,
    1908 \code{myFuncDeriv} returns the derivative of the function.
     2020\code{myFuncDeriv} returns the derivative of the function.  This
     2021function must be valid only for types \code{psF32}, \code{psF64}.
    19092022
    19102023\begin{verbatim}
     
    19182031\end{verbatim}
    19192032\code{psMinimizeChi2} fits a model to observations by minimizing
    1920 $\chi^2$, returing the best-fit parameters.  The input parameters are
     2033$\chi^2$, returning the best-fit parameters.  The input parameters are
    19212034a function that evaluates the model for a specified domain, given the
    19222035parameters, \code{evalModel}; a list of observations, (\code{domain},
     
    19252038parameters, and an optional mask specifying which parameters are to be
    19262039fit, \code{paramMask}, which must be of type \code{psU8}.  All
    1927 parameters are fit if this vector is \code{NULL}.
     2040parameters are fit if this vector is \code{NULL}.  This
     2041function must be valid only for types \code{psF32}, \code{psF64}.
    19282042
    19292043\begin{verbatim}
     
    19332047                                     const psVector *restrict yErr);
    19342048\end{verbatim}
    1935 \code{psVectorFitPolynomial} returns the polynomial that best fits the
     2049\code{psVectorFitPolynomial1d} returns the polynomial that best fits the
    19362050observations.  The input parameters are a polynomial that specifies
    19372051the fit order, \code{myPoly}, which will be altered and returned with
     
    19412055variable error, \code{yErr} may be null, in which case the solution is
    19422056determined in the assumption that all data errors are equal.  This
    1943 function must be valid for types \code{psU8}, \code{psU16},
    1944 \code{psF32}, \code{psF64}.
     2057function must be valid only for types \code{psF32}, \code{psF64}.
    19452058
    19462059%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    19592072\end{verbatim}
    19602073Define a subimage of the specified area of the given image.  This
    1961 function must return an error if the requested subset area lies
    1962 outside of the parent image.  The argument \code{image} is the parent
    1963 image, \code{nx,ny} specify the dimensions of the desired subraster,
    1964 and \code{x0, y0} specify the starting pixel of the subraster.  The
    1965 entire subraster must be contained within the raster of the parent
    1966 image.  Note that the \code{refCounter} for the parent should be
    1967 incremented.  This function must be defined for the following types:
    1968 \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32},
    1969 \code{psF64}, \code{psC32}, \code{psC64}.
     2074function must raise an error if the requested subset area lies outside
     2075of the parent image and return \code{NULL}.  The argument \code{image}
     2076is the parent image, \code{nx,ny} specify the dimensions of the
     2077desired subraster, and \code{x0, y0} specify the starting pixel of the
     2078subraster.  The entire subraster must be contained within the raster
     2079of the parent image.  Note that the \code{refCounter} for the parent
     2080should be incremented.  This function must be defined for the
     2081following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16},
     2082\code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.
    19702083
    19712084\begin{verbatim}
     
    19732086\end{verbatim}
    19742087Create a copy of the specified image, converting the type in the
    1975 process.  If the output target pointer is not NULL, place the result
    1976 in the specified structure.  The output image data must be allocated
    1977 as a single, contiguous block of memory.  The output image may not be
    1978 the input image.  This function must be defined for the following
    1979 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16},
    1980 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.
     2088process.  If the output target pointer is not \code{NULL}, place the
     2089result in the specified structure.  If the output target pointer is
     2090\code{NULL}, the original data type must be maintained.  The output
     2091image data must be allocated as a single, contiguous block of memory.
     2092The output image may not be the input image.  This function must be
     2093defined for the following types: \code{psU8}, \code{psU16},
     2094\code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
     2095\code{psC64}.
    19812096
    19822097\subsubsection{Image Pixel Extractions}
    19832098
    19842099\begin{verbatim}
    1985 psVector *psImageSlice(psVector *out, const psImage *input,
    1986                        int x, int y, int nx, int ny,
    1987                        int direction, const psStats *stats);
    19882100typedef enum {
    19892101    PS_CUT_X_POS;
     
    19922104    PS_CUT_Y_NEG;
    19932105} psImageCutDirection;
     2106
     2107psVector *psImageSlice(psVector *out, const psImage *input,
     2108                       const psImage *restrict mask,
     2109                       unsigned int maskVal,
     2110                       int x, int y, int nx, int ny,
     2111                       psImageCutDirection direction, const psStats *stats);
    19942112\end{verbatim}
    19952113Extract pixels from rectlinear region to a vector (array of floats).
     
    20022120value is specified by \code{stats}.  Only one of the statistics
    20032121choices may be specified, otherwise the function must return an error.
    2004 This function must be defined for the following types: \code{psU8},
     2122This function must be defined for the following types: \code{psS8},
    20052123\code{psU16}, \code{psF32}, \code{psF64}.
    20062124
    20072125\begin{verbatim}
    20082126psVector *psImageCut(psVector *out, const psImage *input,
     2127                     const psImage *restrict mask,
     2128                     unsigned int maskVal,
    20092129                     float xs, float ys, float xe, float ye,
    20102130                     float dw, const psStats *stats);
     
    20212141vector value is specified by \code{stats}.  Only one of the statistics
    20222142choices may be specified, otherwise the function must return an error.
    2023 This function must be defined for the following types: \code{psU8},
     2143This function must be defined for the following types: \code{psS8},
    20242144\code{psU16}, \code{psF32}, \code{psF64}
    20252145
    20262146\begin{verbatim}
    2027 psVector *psImageRadialCut(psVector *out, const psImage *input, float x, float y,
     2147psVector *psImageRadialCut(psVector *out, const psImage *input,
     2148                           const psImage *restrict mask,
     2149                           unsigned int maskVal,
     2150                           float x, float y,
    20282151                           const psVector *radii, const psStats *stats);
    20292152\end{verbatim}
     
    20372160\code{stats}.  Only one of the statistics choices may be specified,
    20382161otherwise the function must return an error.  This function must be
    2039 defined for the following types: \code{psU8}, \code{psU16},
     2162defined for the following types: \code{psS8}, \code{psU16},
    20402163\code{psF32}, \code{psF64}.
    20412164
     
    20442167\begin{verbatim}
    20452168psImage *psImageRebin(psImage *out, const psImage *in,
    2046                       float scale, const psStats *stats);
     2169                      const psImage *restrict mask,
     2170                      unsigned int maskVal,
     2171                      int scale, const psStats *stats);
    20472172\end{verbatim}
    20482173Rebin image to new scale.  A new image is constructed in which the
    2049 dimensions are reduced by a factor of \code{scale} $\le 1$ (it is an
    2050 error for \code{scale} $> 1$).  The \code{scale} is equal in each
    2051 dimension.  The output image is generated from all input image pixels.
     2174dimensions are reduced by a factor of \code{1 / scale}.  The
     2175\code{scale}, always a positive number, is equal in each dimension and
     2176specified the number of pixels used to define a new pixel in the
     2177output image.  The output image is generated from all input image
     2178pixels.  Care must be taken on the image boundary if the image
     2179dimensions are not divisible by the scaling factor.  In those regions,
     2180the output pixel must be constructed from the available input pixels.
    20522181Each pixel in the output image is derived from the statistics of the
    20532182corresponding set of input image pixels based on the statistics
    20542183specified by \code{stats}.  Only one of the statistics choices may be
    20552184specified, otherwise the function must return an error.  This function
    2056 must be defined for the following types: \code{psU8}, \code{psU16},
     2185must be defined for the following types: \code{psS8}, \code{psU16},
    20572186\code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
    20582187\code{psC64}.
    20592188
    20602189\begin{verbatim}
    2061 psImage *psImageRotate(psImage *out, const psImage *input, float
    2062 angle, float exposed);
     2190psImage *psImageResample(psImage *out, const psImage *in,
     2191                         int scale, psImageResampleMode mode);
     2192typedef enum {
     2193    PS_RESAMPLE_FLAT,
     2194    PS_RESAMPLE_BILINEAR,
     2195    PS_RESAMPLE_BICUBIC,
     2196    PS_RESAMPLE_SINC
     2197} psImageResampleMode mode;
     2198\end{verbatim}
     2199Resample image to new scale.  A new image is constructed in which the
     2200dimensions are increased by a factor of \code{scale}.  The
     2201\code{scale}, always a positive number, is equal in each dimension.
     2202The output image is generated from all input image pixels.  Each pixel
     2203in the output image is derived by interpolating between neighboring
     2204pixels using the specified interpolation method (\code{mode}).
     2205
     2206\begin{verbatim}
     2207psImage *psImageRotate(psImage *out, const psImage *input, float angle, float exposed);
    20632208\end{verbatim}
    20642209Rotate the input image by given angle, specified in degrees.  The
     
    21082253pixels to be excluded if their corresponding mask pixel value matches
    21092254the value of \code{maskVal}.  This function must be defined for the
    2110 following types: \code{psU8}, \code{psU16}, \code{psF32},
     2255following types: \code{psS8}, \code{psU16}, \code{psF32},
    21112256\code{psF64}.
    21122257
     
    21202265generate is specified by \code{psHistogram hist} (see
    21212266section~\ref{sec:histograms}).  This function must be defined for the
    2122 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}.
     2267following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}.
    21232268
    21242269\begin{verbatim}
     
    21282273structure \code{coeffs} contains the desired order and terms of
    21292274interest.  This function must be defined for the
    2130 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}.
     2275following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}.
    21312276
    21322277\begin{verbatim}
     
    21362281input polynomial coefficients, set the image pixel values on the basis
    21372282of the polynomial function.  This function must be defined for the
    2138 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}.
     2283following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}.
    21392284
    21402285\subsubsection{Image I/O Functions}
     
    21582303slice of the image.  The data is read from the extension specified by
    21592304extname (matching the EXTNAME keyword) or by the extnum value (with 0
    2160 representing the PHU, 1 the first extension, etc).  This function must
    2161 call \code{psError} and return \code{NULL} if any of the specified
    2162 parameters are out of range for the data in the image file, if the
    2163 specified image file does not exist, or the image on disk is zero- or
    2164 one-dimensional.
     2305representing the primary header unit (PHU), 1 the first extension,
     2306etc).  This function must call \code{psError} and return \code{NULL}
     2307if any of the specified parameters are out of range for the data in
     2308the image file, if the specified image file does not exist, or the
     2309image on disk is zero- or one-dimensional.  This function will only
     2310read images of the native FITS image types (\code{psU8}, \code{psU16},
     2311\code{psU32}, \code{psF32}, \code{psF64}).  The user is expected to
     2312convert the data type as needed with \code{psImageCopy}.  The return
     2313value must be 0 for a successful operation and 1 for an error.
    21652314 
    21662315\begin{verbatim}
     
    21802329the image, return an error (ie, if x + image.nx >= NAXIS1, y +
    21812330image.ny >= NAXIS2, or z >= NAXIS3).  If the image does not exist,
    2182 require x,y,z to be zero.
     2331require x,y,z to be zero.  This function will only write images of the
     2332native FITS image types (\code{psU8}, \code{psU16}, \code{psU32},
     2333\code{psF32}, \code{psF64}).  The user is expected to convert the data
     2334type as needed with \code{psImageCopy}.  The return value must be 0
     2335for a successful operation and 1 for an error.
    21832336
    21842337\subsubsection{Image Pixel Manipulations}
    21852338
    21862339\begin{verbatim}
    2187 int psImageClip(psImage *input, float min, float vmin, float max, float vmax);
     2340int psImageClip(psImage *input, double min, double vmin, double max, double vmax);
    21882341\end{verbatim}
    21892342Clip image values outside of range to given values.  All pixels with
     
    22042357
    22052358\begin{verbatim}
     2359int psImageClipComplexRegion(psImage *input, complex double min, complex double vmin, complex double max, complex double vmax);
     2360\end{verbatim}
     2361Clip image values outside of range to given values.  All pixels with
     2362values \code{< min} are set to the value \code{vmin}. All pixels with
     2363values \code{> max} are set to the value \code{vmax}. Returns the
     2364number of clipped pixels.  This function must be defined for the
     2365following types: \code{psC32}, \code{psC64}.  The arguments
     2366(\code{min}, \code{max}, etc) define a rectangular region in complex
     2367space; data values inside this regions are unchanged while those
     2368outside are set to either \code{vmax} (if either their real or
     2369imaginary portions are greater than the corresponding values of
     2370\code{max}) or \code{vmin} (in all other cases).  If the input
     2371parameters \code{vmin} or \code{vmax} are out of bounds for the image
     2372pixel type, the function must raise an error.  It is not an error for
     2373\code{min} or \code{max} to be out of range.
     2374
     2375\begin{verbatim}
    22062376int psImageClipNaN(psImage *input, float value);
    22072377\end{verbatim}
     
    22492419their \code{psType} elements, which always are the first elements.
    22502420Note that these functions return a pointer to the appropriate type for
    2251 the operation.  Since the result may is cast to \code{psType}, the
     2421the operation.  Since the result may be cast to \code{psType}, the
    22522422resulting type may be determined by examining the return value.  It is
    22532423expected that the implementation of these functions will employ
     
    22602430Operations between data structures with incompatible sizes are not
    22612431allowed.  However, operations between data elements of different rank
    2262 (scalar, vector, image) are allowed, and defined below.
     2432(scalar, vector, image) are allowed, and defined below.  These
     2433functions are valid for all data types \code{psU8}, \code{psU16},
     2434\code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
     2435\code{psC64}.
    22632436
    22642437Binary operations between an image and a vector have a potential
     
    22702443a ``transposed vector'' in the same context acts on all columns.
    22712444Vectors, when created, will be created as ``vectors'', but may be
    2272 converted to ``transposed vectors'' using the following function:
    2273 \begin{verbatim}
    2274 psVector *psVectorTranspose(psVector *out, psVector *myVector);
    2275 \end{verbatim}
     2445converted to ``transposed vectors'' by setting
     2446\code{vector->type.dimen = PS_DIMEN_TRANSV}.
    22762447
    22772448It is further desirable to allow scalar values to be used within these
    2278 functions, which requires the following additions:
    2279 \begin{verbatim}
    2280 p_ps_Scalar *psScalar (double value);
    2281 p_ps_Scalar *psScalarType (char *mode, ...);
    2282 \end{verbatim}
    2283 The first creates a psType-ed structure from a constant value, while
    2284 the second creates a psType-ed structure for a specified type.  The
    2285 structure which carries a scalar value is specified as the following
    2286 private type, and is analogous to the \code{psVector} and
    2287 \code{psImage} structures:
    2288 \begin{verbatim}
    2289 typedef struct {
    2290     psType type;                        ///< data type information
    2291     union {                           
    2292         psS32 S32;                      ///< integer value entry
    2293         psF32 F32;                      ///< float value entry
    2294         psF64 F64;                      ///< double value entry
    2295         psC32 C32;                      ///< complex value entry
    2296     } data;
    2297 } p_psScalar;
    2298 \end{verbatim}
    2299 
    2300 This allows one to write the following to take the sine of the square
    2301 of all pixels in an image:
     2449functions.  These functions may take a pointer to type
     2450\code{psScalar}, which is freed by the function. This allows one to
     2451write the following lines to take the sine of the square of all pixels
     2452in an image:
    23022453\begin{verbatim}
    23032454psImage A,B;
    23042455
    2305 B = psBinaryOp (NULL, A, "^", psScalar(2));
    2306 (void) psUnaryOp(B, B, "sin");
     2456B = psBinaryOp (NULL, A, "^", psScalarAlloc(2));
     2457psUnaryOp(B, B, "sin");
    23072458\end{verbatim}
    23082459
     
    26772828being represented, given by the enumerated type \code{psMetadataType}:
    26782829\begin{verbatim}
    2679 typedef enum {                          ///< type of val is:
     2830typedef enum {                          ///< type of data.item is:
    26802831    PS_META_ITEM_SET = 0,               ///< NULL; metadata is in psMetadataType.items
    26812832    PS_META_S32,                        ///< int (.S32)
     
    27492900The \code{psMetadataItem} destructor is specified below.  Note that
    27502901the destructor for \code{psMetadataItem} must call the appropriate
    2751 destructor for the \code{val} (recall that it is the duty of the
     2902destructor for the \code{data.item} (recall that it is the duty of the
    27522903\code{psMyTypeFree}s to decrement the \code{refCounter} and free the
    27532904memory if and only if the \code{refCounter == 1} --- see
    27542905\S\ref{sec:free}).
    27552906\begin{verbatim}
    2756 void psMetadataItemFree(psMetadataItem *item);
     2907void p_psMetadataItemFree(psMetadataItem *item);
    27572908\end{verbatim}
    27582909
     
    27632914\begin{verbatim}
    27642915psMetadata *psMetadataAlloc(void);
    2765 void psMetadataFree(psMetadata *md);
     2916void p_psMetadataFree(psMetadata *md);
    27662917\end{verbatim}
    27672918
     
    27712922be appended.  In both cases, the return value defines the success
    27722923(\code{true}) or failure of the operation.  The second function,
    2773 \code{psMetadataAdd} takes a pointer or value which is interpretted
    2774 by the \code{va_list} operators in the function.  Both functions take
    2775 an parameter \code{where} which specifies where in the list to place
    2776 the element, following the conventions for the \code{psList}.  Care
    2777 should be taken not to leak memory when appending an item for which
    2778 the key already exists in the metadata (and is not
     2924\code{psMetadataAdd} takes a pointer or value which is interpreted by
     2925the function using variadic argument interpretation.  Both functions
     2926take an parameter \code{where} which specifies where in the list to
     2927place the element, following the conventions for the \code{psList}.
     2928Care should be taken not to leak memory when appending an item for
     2929which the key already exists in the metadata (and is not
    27792930\code{PS_META_NON_UNIQUE}).
    27802931%
    27812932\begin{verbatim}
    27822933bool psMetadataAddItem(psMetadata *restrict md, int where,
    2783                                      psMetadataItem *restrict item);
     2934                       psMetadataItem *restrict item);
    27842935bool psMetadataAdd(psMetadata *restrict md, int where,
    2785                                  const char *name, int format, const char *comment, ...);
     2936                   const char *name, int format, const char *comment, ...);
    27862937\end{verbatim}
    27872938
     
    28292980\end{verbatim}
    28302981
    2831 Metadata items may be printed to an open file descriptor, optionally
    2832 pre-pending a specified string.
    2833 \begin{verbatim}
    2834 void psMetadataItemPrint(FILE *fd, const psMetadataItem *restrict md,
    2835                          const char *prefix);
     2982Metadata items may be printed to an open file descriptor based on a
     2983provided format.  The format string is an sprintf format statement
     2984with exactly one \% formatting command.  If the metadata item type is
     2985a numeric type, this formatting command must also be numeric, and type
     2986conversion performed to the value to match the format type.  If the
     2987metadata item type is a string, the formatting command must also be
     2988for a string (\%s type of command).  If the metadata type is any other
     2989data type, printing is not allowed.
     2990\begin{verbatim}
     2991void psMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *restrict md);
    28362992\end{verbatim}
    28372993
     
    29373093the mask: \code{T.x->mask[1][1] = 0; T.y->mask[1][1] = 0;}
    29383094
    2939 The \code{psPlaneDistortion} represents an optical distortion.  The
     3095The \code{psPlaneDistort} represents an optical distortion.  The
    29403096lowest two terms are the $x$ and $y$ axis of the target system.  The
    29413097higher two terms may represent magnitude and color terms.
     
    29563112CCD, of an object with magnitude and color ($m,c$) to a second frame
    29573113($p,q$), e.g., the focal plane. If we have only first order terms in
    2958 the transformation \code{psPlaneTransform T}, the new coordinates
     3114the transformation \code{psPlaneDistort T}, the new coordinates
    29593115would be represented by the terms:
    29603116%
     
    30133169\begin{verbatim}
    30143170psSphereTransform *psSphereTransformAlloc(double NPlon, double NPlat, double ZP);
    3015 void psSphereTransformFree(psSphereTransform *trans);
     3171void p_psSphereTransformFree(psSphereTransform *trans);
    30163172\end{verbatim}
    30173173where \code{NPlon} and \code{NPlat} define the coordinates in the
     
    30193175defines the longitude in the input system of the equatorial
    30203176intersection between the two systems (e.g, the first point of Ares).
     3177The constructor must calculate the sines and cosines above.
    30213178
    30223179Spherical coordinates may be transformed by providing the
     
    30313188The following functions simply return the appropriate
    30323189\code{psSphereTransform} to convert between predefined spherical
    3033 coordinate systems (i.e., ICRS, Ecliptic and Galactic).
     3190coordinate systems (i.e., ICRS, Ecliptic and Galactic).  These are
     3191constructors as well as the above \code{psSphereTransformAlloc}.
    30343192%
    30353193\begin{verbatim}
     
    30873245the sky, as well as a function to apply an offset to a position.  The
    30883246first determines the offset (RA,Dec) on the sky between two positions.
    3089 The second applies the given offset to the coordinate. The offsets may
    3090 be of type: \tbd{Linear, Spherical/Arcsec, Spherical/Degreees, etc.}
     3247The second applies the given offset to the coordinate.  Both an offset
     3248mode and an offset unit may be defined.  The mode may be either
     3249\code{PS_SPHERICAL}, in which case the specified offset corresponds to
     3250an offset in angles, or it may be \code{PS_LINEAR}, in which case the
     3251offset corresponds to a linear offset in a local projection.  The
     3252offset unit may be in one of \code{PS_ARCSEC}, \code{PS_ARCMIN},
     3253\code{PS_DEGREE}, and \code{PS_RADIAN}, which specifies the units of
     3254the offset only.
    30913255
    30923256\begin{verbatim}
    30933257psSphere *psSphereGetOffset(const psSphere *restrict position1,
    30943258                            const psSphere *restrict position2,
    3095                             const char *type);
     3259                            psSphereOffsetMode mode,
     3260                            psSphereOffsetUnit unit);
     3261
    30963262psSphere *psSphereSetOffset(const psSphere *restrict position,
    30973263                            const psSphere *restrict offset,
    3098                             const char *type);
     3264                            psSphereOffsetMode mode,
     3265                            psSphereOffsetUnit unit);
     3266
     3267typedef enum {
     3268 PS_SPHERICAL;
     3269 PS_LINEAR;
     3270} psSphereOffsetMode;
     3271
     3272typedef enum {
     3273 PS_ARCSEC;
     3274 PS_ARCMIN;
     3275 PS_DEGREE;
     3276 PS_RADIAN;
     3277} psSphereOffsetUnit;
    30993278\end{verbatim}
    31003279Note that these should propagate the errors appropriately.
     
    34123591\begin{verbatim}
    34133592psGrommit *psGrommitAlloc(const psExposure *exp);
    3414 void psGrommitFree(psGrommit *grommit);
     3593void p_psGrommitFree(psGrommit *grommit);
    34153594\end{verbatim}
    34163595
Note: See TracChangeset for help on using the changeset viewer.