Changeset 1207
- Timestamp:
- Jul 12, 2004, 12:18:21 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (71 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r1092 r1207 1 %%% $Id: psLibSDRS.tex,v 1. 59 2004-06-25 03:10:26eugene 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} 3 3 4 4 % basic document variables … … 10 10 \project{Pan-STARRS Image Processing Pipeline} 11 11 \organization{Institute for Astronomy} 12 \version{0 2}12 \version{03} 13 13 \docnumber{PSDC-430-007} 14 14 % note the use of the docnumber & version number: … … 132 132 star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html} 133 133 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 134 138 \end{itemize} 135 139 … … 215 219 special value, \code{P_PS_MEMMAGIC}. The segment following the 216 220 user-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}. 221 also assigned the special value of \code{P_PS_MEMMAGIC}. The element 222 \code{userMemorySize} specifies the number of bytes allocated in the 223 user block and allows the endpost to be found. 219 224 220 225 In practice, these bounding memory blocks mean that when a user … … 245 250 which is also easily recognized in a dump of the memory table. 246 251 247 The PSLib memory management system must maintain a private table of248 the allocated memory blocks. The table includes a list of pointers to 249 structures of type \code{psMemBlock}, defined asfollows:252 The structure \code{psMemBlock} specifies additional information 253 maintained for each block of allocated memory, and is defined as 254 follows: 250 255 % 251 256 \begin{verbatim} 252 257 typedef 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 256 265 const int lineno; ///< set from __LINE__ in e.g. p_psAlloc 257 int refCounter; ///< how many times pointer is referenced258 const void **endpost; ///< initialised to P_PS_MEMMAGIC259 const void *endblock; ///< initialised to P_PS_MEMMAGIC266 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 260 269 } 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 271 typedef void (*psFreeFcn)(void* ptr); 272 typedef unsigned long psMemoryId; 273 typedef unsigned long psReferenceCount; 274 \end{verbatim} 275 % 276 The PSLib memory management system must maintain the collection of 277 allocated memory blocks. The entries \code{previousBlock} and 278 \code{nextBlock} point to the previous and next memory blocks 279 allocated by the memory management system (if they exist, or else 280 \code{NULL}) and are used to scan through memory blocks as a linked 281 list. 282 283 The element \code{freeFcn} specifies the deallocator associated with a 284 specific block of memory. If this element is \code{NULL}, the basic 285 deallocator is used and the memory block must not be a rich data 286 structure which requires additional freeing functionality. 287 288 The element \code{id} in the structure is a sequential memory block 289 ID. The memory management system must maintain an internal memory 290 block ID counter from which a new ID may be supplied to each newly 291 allocated block of memory and saved in the element \code{id}. This ID 292 should also be the key to the memory block in the memory block table. 268 293 269 294 The two entries \code{file} and \code{lineno} are set to the line … … 273 298 below that the basic memory managment functions be implemented as 274 299 preprocessor macros which wrap the intrinsic C level functions. 300 301 The element \code{refCounterMutex} is a mutex used to limit access to 302 the reference counter (below) to a single thread at a time. 275 303 276 304 The \code{psMemBlock} structure element \code{refCounter} is provided … … 284 312 In order to trace double frees and other memory errors, the memory 285 313 block 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}. 314 is deleted. Rather, the \code{psMemBlock} data and the endpost data 315 are left behind. If \code{userMemorySize} is 0, then the memory block 316 has been freed. This state must be enforced by \code{psFree}. This 317 behavior, in which the associated \code{psMemBlock} is retained, is 318 only provided if the code is compiled with the preprocessor variable 319 \code{PS_MEM_DEBUG} defined. 290 320 291 321 \subsubsection{APIs for Allocating and Freeing} … … 334 364 \code{NULL} pointer. If they are unable to provide the requested 335 365 memory they must attempt to obtain the desired memory by calling the 336 routine registered by \code{psMemExhausted SetCallback} (see366 routine registered by \code{psMemExhaustedCallbackSet} (see 337 367 \S\ref{secMemAdvanced}), and if still unsuccessful, call 338 368 \code{psAbort()}. The same behavior is true for constructors of rich … … 346 376 define the initialization independently since a byte value of 0 is 347 377 usually 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} 348 389 349 390 \subsubsection{Callback Routines} … … 457 498 % 458 499 The callback functions are called with a pointer to the corresponding 459 memory block. The routines \code{psMemFree IDSet} and460 \code{psMemAllocate IDSet} accept the desired ID value and return the500 memory block. The routines \code{psMemFreeCallbackIDSet} and 501 \code{psMemAllocateCallbackIDSet} accept the desired ID value and return the 461 502 old value to the user. The return values of the handlers installed by 462 503 \code{psMemAllocateCallbackSet} and \code{psMemFreeCallbackSet} are … … 481 522 \begin{verbatim} 482 523 int psMemCheckLeaks(long id0, psMemBlock ***array, FILE *fd); 483 int psMemCheckCorruption( intabort_on_error);524 int psMemCheckCorruption(bool abort_on_error); 484 525 \end{verbatim} 485 526 % … … 551 592 variety of rich data structures. The IPP Software Requirements 552 593 Specification 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 594 corresponding constructors and destructors. The destructors are 595 private functions used only by the memory management system. 596 Instances 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 599 components of the structure, but leaves the task of freeing the 600 structure to \code{psFree}. The allocator will allocate the required 557 601 memory with \code{psAlloc} and increment the appropriate 558 602 \code{refCounter}. … … 888 932 that is passed to \code{psLogMsgV} with code \code{PS_LOG_ERROR}. The 889 933 result 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 a891 call to\code{psErrorClear}.934 stack; this stack is cleared if \code{new} is true, or by a call to 935 \code{psErrorClear}. 892 936 893 937 The errors on the error stack are defined as the following: … … 920 964 defined in the next section. Note that these are also available in 921 965 the \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}.966 should be indented by an additional space. \code{psErrorStackPrintV} 967 must not invoke \code{va_end}. 924 968 % 925 969 \begin{verbatim} … … 1113 1157 PS_TYPE_F64, ///< Double-precision floating point 1114 1158 PS_TYPE_C32, ///< Complex numbers consisting of floats 1159 PS_TYPE_C64, ///< Complex numbers consisting of doubles 1115 1160 PS_TYPE_OTHER, ///< Not supported for arithmetic 1116 1161 } psElemType; … … 1119 1164 section~\ref{sec:arithmetic}. 1120 1165 1166 \subsection{Simple Scalars} 1167 1168 We define a basic scalar data type which includes the type 1169 information. This structure allows scalars to be used in functions 1170 which interpret the data type from the structure when deciding how to 1171 perform an operation. The basic scalar structure is: 1172 \begin{verbatim} 1173 typedef 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 1188 In addition, we specify two functions for working with \code{psScalar} data: 1189 \begin{verbatim} 1190 psScalar *psScalarAlloc (psC64 value, psElemType dataType); 1191 psScalar *psScalarCopy (psScalar *value); 1192 \end{verbatim} 1193 The first creates a \code{psType}-ed structure from a constant value, 1194 casting it as appropriate based on the \code{dataType}. The second 1195 copies the provided \code{psScalar} value. This latter function is 1196 necessary 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 1121 1200 \subsection{Simple Vectors} 1122 1201 1123 1202 We require several related types of basic one-dimensional arrays: 1124 1203 arrays of values of type \code{int}, \code{float}, \code{double}, 1125 \code{complex float}, and \code{ void *}. We have defined a single1126 s tructure, \code{psVector} to represent these concepts:1204 \code{complex float}, and \code{complex double}. We have defined a 1205 single structure, \code{psVector} to represent these concepts: 1127 1206 % 1128 1207 \begin{verbatim} … … 1132 1211 const int nalloc; ///< allocated data block 1133 1212 union { 1134 psS8 *S8; ///< Pointers to short-integerdata1213 psS8 *S8; ///< Pointers to byte data 1135 1214 psS16 *S16; ///< Pointers to short-integer data 1136 1215 psS32 *S32; ///< Pointers to integer data 1137 1216 psS64 *S64; ///< Pointers to long-integer data 1138 psU8 *U18; ///< Pointers to unsigned- short-integerdata1217 psU8 *U18; ///< Pointers to unsigned-byte data 1139 1218 psU16 *U16; ///< Pointers to unsigned-short-integer data 1140 1219 psU32 *U32; ///< Pointers to unsigned-integer data … … 1142 1221 psF32 *F32; ///< Pointers to floating-point data 1143 1222 psF64 *F64; ///< Pointers to double-precision data 1144 ps F32 *C32; ///< Pointers to complex floating-point data1145 void **void;1223 psC32 *C32; ///< Pointers to complex floating-point data 1224 psC64 *C64; ///< Pointers to complex floating-point data 1146 1225 } data; 1147 1226 } psVector; … … 1161 1240 psVector *psVectorAlloc(int nalloc, psElemType type); 1162 1241 psVector *psVectorRealloc(const psVector *vector, int nalloc); 1163 void p sVectorFree(psVector *restrict vector, void (*elemFree)(void *));1242 void p_psVectorFree(psVector *restrict vector); 1164 1243 \end{verbatim} 1165 1244 % … … 1173 1252 and the extra elements are lost. If \code{nalloc} is larger than the 1174 1253 current 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. 1254 If the value of \code{vector} is \code{NULL}, then 1255 \code{psVectorRealloc} must return an error. 1184 1256 1185 1257 \subsection{Simple Images} … … 1206 1278 psF64 **F64; ///< Pointers to double-precision data 1207 1279 psC32 **C32; ///< Pointers to complex floating-point data 1280 psC64 **C64; ///< Pointers to complex floating-point data 1208 1281 } data; 1209 1282 const struct psImage *parent; ///< parent, if a subimage … … 1227 1300 starting row number. The structure may include references to 1228 1301 subrasters (\code{children, Nchildren}) and/or to a containing array 1229 (\code{parent}). Unless this i s image is a child of another image1302 (\code{parent}). Unless this image is a child of another image 1230 1303 (represents a subset of the pixels of another image), the image data 1231 1304 is allocated in a contiguous block. We define the following 1232 supporting functions: 1305 supporting functions, which are valid for data types \code{psS8, 1306 psS16, psU8, psU16, psF32, psF64, psC32, psC64}. 1233 1307 1234 1308 \begin{verbatim} … … 1238 1312 \code{type}. This function must allow any of the valid image data 1239 1313 types and not restrict to the valid FITS BITPIX types. The image 1240 dimensionality must be 2. 1241 1242 \begin{verbatim} 1243 void p sImageFree(psImage *image);1314 dimensionality must be 2. 1315 1316 \begin{verbatim} 1317 void p_psImageFree(psImage *restrict image); 1244 1318 \end{verbatim} 1245 1319 Free the memory associated with a specific image, including the pixel 1246 1320 data. Free the children of the image if they exist. 1247 1321 1322 \subsection{Simple Arrays} 1323 1324 \tbd{fill out this section} 1325 1326 We require an order collection of unspecified data elements. We 1327 define \code{psArray} to carry such a collection: 1328 % 1329 \begin{verbatim} 1330 typedef 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 % 1337 In this structure, the argument \code{n} is the length of the array 1338 (the number of elements); \code{nalloc} is the number of elements 1339 allocated ($nalloc \ge n$). The allocated memory is pointed to by 1340 \code{data}. The structure is associated with a constructor and a 1341 destructor: 1342 % 1343 \begin{verbatim} 1344 psArray *psArrayAlloc(int nalloc, psElemType type); 1345 psArray *psArrayRealloc(const psArray *array, int nalloc); 1346 void p_psArrayFree(psArray *restrict array); 1347 \end{verbatim} 1348 % 1349 In these functions, \code{nalloc} is the number of elements to 1350 allocate. For \code{psArrayAlloc}, the value of \code{psArray.n} is 1351 set to \code{nalloc}. Users may choose to restrict the data range 1352 after the \code{psArrayAlloc} function is called. For 1353 \code{psArrayRealloc}, if the value of \code{nalloc} is smaller than 1354 the 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 1356 the extra elements are dropped and freed if necesitated by the 1357 reference counter. If \code{nalloc} is larger than the current value 1358 of \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 1360 error. 1361 1362 \begin{verbatim} 1363 psArray *psArraySort(psArray *array, int (*compare)(const void **a, const void **b) ); 1364 \end{verbatim} 1365 An array may be sorted using \code{psArraySort}, which requires the 1366 specification of a comparison function to specify how the objects on 1367 the list should be sorted. The motivation is primarily to be able to 1368 iterate on a sorted list of keys from a hash. 1369 1248 1370 \subsection{Doubly-linked lists} 1249 1371 \label{sec:psList} … … 1253 1375 \begin{verbatim} 1254 1376 typedef struct { 1255 int n;///< number of elements on list1377 unsigned int size; ///< number of elements on list 1256 1378 psListElem *head; ///< first element on list (may be NULL) 1257 1379 psListElem *tail; ///< last element on list (may be NULL) 1258 1380 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 1259 1383 } psList; 1260 1384 \end{verbatim} … … 1334 1458 1335 1459 \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); 1460 void p_psListFree(psList *list); 1461 \end{verbatim} 1462 This function frees the data associated with the entire list. This 1463 function is used by psFree to free a list with its associated data. 1464 1465 \begin{verbatim} 1466 psArray *psListToArray(psList *list); 1467 psList *psArrayToList(psArray *array); 1346 1468 \end{verbatim} 1347 1469 These two functions are available to convert between the 1348 \code{psList} and \code{ps Vector} containers. These functions do not1470 \code{psList} and \code{psArray} containers. These functions do not 1349 1471 free the elements or destroy the input collection. Rather, they 1350 1472 increment the reference counter for each of the elements. … … 1367 1489 1368 1490 \begin{verbatim} 1369 psList *psListSort(psList *list, int (*compare)(const void * a, const void*b) );1491 psList *psListSort(psList *list, int (*compare)(const void **a, const void **b) ); 1370 1492 \end{verbatim} 1371 1493 A list may be sorted using \code{psListSort}, which requires the … … 1445 1567 a specific key may be removed (deleted) with the function: 1446 1568 \begin{verbatim} 1447 void *psHashRemove(psHash *table, char *key);1569 bool psHashRemove(psHash *table, char *key); 1448 1570 \end{verbatim} 1449 1571 The function returns a value of \code{true} if the operation was 1450 1572 successfull, and \code{false} otherwise. 1451 1573 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. 1574 The data associated with a complete hash table may be freed by calling: 1575 \begin{verbatim} 1576 void p_psHashFree(psHash *table); 1577 \end{verbatim} 1459 1578 1460 1579 The function 1461 1580 \begin{verbatim} 1462 psList *psHashKey list(psHast*table);1581 psList *psHashKeyList(psHash *table); 1463 1582 \end{verbatim} 1464 1583 returns the complete list of defined keys associated with the … … 1504 1623 \begin{verbatim} 1505 1624 psBitSet *psBitSetAlloc(int n); 1506 void p sBitSetFree(psBitSet *restrict myBits);1625 void p_psBitSetFree(psBitSet *restrict myBits); 1507 1626 \end{verbatim} 1508 1627 where \code{n} is the requested number of bits. … … 1553 1672 value in the last element. The input vector, \code{in}, may be sorted 1554 1673 in-place if it is also specified as the \code{out} vector. This 1555 function is specified for input types \code{ps U8, psU16, psF32,1674 function is specified for input types \code{psS8, psU16, psF32, 1556 1675 psF64}. The input and output vectors must have the same type. 1557 1676 1558 1677 \begin{verbatim} 1559 psVector *ps Sort(psVector *out, const psVector *restrict in);1678 psVector *psVectorSort(psVector *out, const psVector *restrict in); 1560 1679 \end{verbatim} 1561 1680 … … 1568 1687 largest (i.e.\ most positive) value in the last element. The output 1569 1688 vector must be of type \code{psU32}. This function is specified for 1570 input types \code{ps U8, psU16, psF32, psF64}.1571 1572 \begin{verbatim} 1573 psVector *ps SortIndex(psVector *restrict out; const psVector *restrict in);1689 input types \code{psS8, psU16, psF32, psF64}. 1690 1691 \begin{verbatim} 1692 psVector *psVectorSortIndex(psVector *restrict out; const psVector *restrict in); 1574 1693 \end{verbatim} 1575 1694 1576 1695 The sorted vectors may be accessed in the following manner: 1577 1696 \begin{verbatim} 1578 indexVector = ps SortIndex(NULL, x);1697 indexVector = psVectorSortIndex(NULL, x); 1579 1698 for (int i = 0; i < indexVector.n; i++) { 1580 1699 doMyFunc(x[indexVector.arr.arr_U32[i]], y[indexVector[i].arr.arr_U32]); 1581 1700 } 1582 1701 \end{verbatim} 1702 1583 1703 1584 1704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1634 1754 The defaults for these two numbers is both 3. Since the sample 1635 1755 statistics 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}. 1756 points, it is faster to use the robust statistics. Default input 1757 field values must be set by the \code{psStats} constructor. The input 1758 vector may be of type \code{psU8}, \code{psU16}, \code{psF32}, 1759 \code{psF64}; the mask must be of type \code{psU8}. 1647 1760 1648 1761 The \code{psStats} structure is defined with entries for each of the … … 1698 1811 PS_STAT_USE_RANGE = 0x002000, 1699 1812 PS_STAT_USE_BINSIZE = 0x004000 1700 PS_STAT_ROBUST_FOR_SAMPLE = 0x0080001701 1813 } psStatsOptions; 1702 1814 \end{verbatim} … … 1706 1818 \begin{verbatim} 1707 1819 psStats *psStatsAlloc(psStatsOptions options); 1708 void p sStatsFree(psStats *restrict stats);1820 void p_psStatsFree(psStats *restrict stats); 1709 1821 \end{verbatim} 1710 1822 … … 1720 1832 psVector *nums; ///< Number in each of the bins 1721 1833 int minNum, maxNum; ///< Number below minimum / above maximum 1722 intuniform; ///< Is it a uniform distribution?1834 bool uniform; ///< Is it a uniform distribution? 1723 1835 } psHistogram; 1724 1836 \end{verbatim} … … 1755 1867 A histogram is free with the destructor: 1756 1868 \begin{verbatim} 1757 void p sHistogramFree(psHistogram *restrict myHist);1869 void p_psHistogramFree(psHistogram *restrict myHist); 1758 1870 \end{verbatim} 1759 1871 … … 1833 1945 \begin{verbatim} 1834 1946 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY); 1835 void p sDPolynomial2DFree(psDPolynomial2D *restrict myPoly);1947 void p_psDPolynomial2DFree(psDPolynomial2D *restrict myPoly); 1836 1948 \end{verbatim} 1837 1949 where \code{nX} and \code{nY} are the number of terms in x and y … … 1853 1965 The Gaussian evaluation is provide by: 1854 1966 \begin{verbatim} 1855 float psGaussian(float x, float mean, float sigma, intnormal);1967 float psGaussian(float x, float mean, float sigma, bool normal); 1856 1968 \end{verbatim} 1857 1969 which evaluates a Gaussian with the given \code{mean} and \code{sigma} … … 1906 2018 Note that \code{paramMask} must be of type \code{psU8}, while 1907 2019 \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 2021 function must be valid only for types \code{psF32}, \code{psF64}. 1909 2022 1910 2023 \begin{verbatim} … … 1918 2031 \end{verbatim} 1919 2032 \code{psMinimizeChi2} fits a model to observations by minimizing 1920 $\chi^2$, retur ing the best-fit parameters. The input parameters are2033 $\chi^2$, returning the best-fit parameters. The input parameters are 1921 2034 a function that evaluates the model for a specified domain, given the 1922 2035 parameters, \code{evalModel}; a list of observations, (\code{domain}, … … 1925 2038 parameters, and an optional mask specifying which parameters are to be 1926 2039 fit, \code{paramMask}, which must be of type \code{psU8}. All 1927 parameters are fit if this vector is \code{NULL}. 2040 parameters are fit if this vector is \code{NULL}. This 2041 function must be valid only for types \code{psF32}, \code{psF64}. 1928 2042 1929 2043 \begin{verbatim} … … 1933 2047 const psVector *restrict yErr); 1934 2048 \end{verbatim} 1935 \code{psVectorFitPolynomial } returns the polynomial that best fits the2049 \code{psVectorFitPolynomial1d} returns the polynomial that best fits the 1936 2050 observations. The input parameters are a polynomial that specifies 1937 2051 the fit order, \code{myPoly}, which will be altered and returned with … … 1941 2055 variable error, \code{yErr} may be null, in which case the solution is 1942 2056 determined 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}. 2057 function must be valid only for types \code{psF32}, \code{psF64}. 1945 2058 1946 2059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1959 2072 \end{verbatim} 1960 2073 Define a subimage of the specified area of the given image. This 1961 function must r eturn an error if the requested subset area lies1962 o utside of the parent image. The argument \code{image} is the parent1963 i mage, \code{nx,ny} specify the dimensions of the desired subraster,1964 and \code{x0, y0} specify the starting pixel of the subraster. The1965 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{psF 64}, \code{psC32}, \code{psC64}.2074 function must raise an error if the requested subset area lies outside 2075 of the parent image and return \code{NULL}. The argument \code{image} 2076 is the parent image, \code{nx,ny} specify the dimensions of the 2077 desired subraster, and \code{x0, y0} specify the starting pixel of the 2078 subraster. The entire subraster must be contained within the raster 2079 of the parent image. Note that the \code{refCounter} for the parent 2080 should be incremented. This function must be defined for the 2081 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2082 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 1970 2083 1971 2084 \begin{verbatim} … … 1973 2086 \end{verbatim} 1974 2087 Create 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}. 2088 process. If the output target pointer is not \code{NULL}, place the 2089 result in the specified structure. If the output target pointer is 2090 \code{NULL}, the original data type must be maintained. The output 2091 image data must be allocated as a single, contiguous block of memory. 2092 The output image may not be the input image. This function must be 2093 defined for the following types: \code{psU8}, \code{psU16}, 2094 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, 2095 \code{psC64}. 1981 2096 1982 2097 \subsubsection{Image Pixel Extractions} 1983 2098 1984 2099 \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);1988 2100 typedef enum { 1989 2101 PS_CUT_X_POS; … … 1992 2104 PS_CUT_Y_NEG; 1993 2105 } psImageCutDirection; 2106 2107 psVector *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); 1994 2112 \end{verbatim} 1995 2113 Extract pixels from rectlinear region to a vector (array of floats). … … 2002 2120 value is specified by \code{stats}. Only one of the statistics 2003 2121 choices may be specified, otherwise the function must return an error. 2004 This function must be defined for the following types: \code{ps U8},2122 This function must be defined for the following types: \code{psS8}, 2005 2123 \code{psU16}, \code{psF32}, \code{psF64}. 2006 2124 2007 2125 \begin{verbatim} 2008 2126 psVector *psImageCut(psVector *out, const psImage *input, 2127 const psImage *restrict mask, 2128 unsigned int maskVal, 2009 2129 float xs, float ys, float xe, float ye, 2010 2130 float dw, const psStats *stats); … … 2021 2141 vector value is specified by \code{stats}. Only one of the statistics 2022 2142 choices may be specified, otherwise the function must return an error. 2023 This function must be defined for the following types: \code{ps U8},2143 This function must be defined for the following types: \code{psS8}, 2024 2144 \code{psU16}, \code{psF32}, \code{psF64} 2025 2145 2026 2146 \begin{verbatim} 2027 psVector *psImageRadialCut(psVector *out, const psImage *input, float x, float y, 2147 psVector *psImageRadialCut(psVector *out, const psImage *input, 2148 const psImage *restrict mask, 2149 unsigned int maskVal, 2150 float x, float y, 2028 2151 const psVector *radii, const psStats *stats); 2029 2152 \end{verbatim} … … 2037 2160 \code{stats}. Only one of the statistics choices may be specified, 2038 2161 otherwise the function must return an error. This function must be 2039 defined for the following types: \code{ps U8}, \code{psU16},2162 defined for the following types: \code{psS8}, \code{psU16}, 2040 2163 \code{psF32}, \code{psF64}. 2041 2164 … … 2044 2167 \begin{verbatim} 2045 2168 psImage *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); 2047 2172 \end{verbatim} 2048 2173 Rebin 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. 2174 dimensions are reduced by a factor of \code{1 / scale}. The 2175 \code{scale}, always a positive number, is equal in each dimension and 2176 specified the number of pixels used to define a new pixel in the 2177 output image. The output image is generated from all input image 2178 pixels. Care must be taken on the image boundary if the image 2179 dimensions are not divisible by the scaling factor. In those regions, 2180 the output pixel must be constructed from the available input pixels. 2052 2181 Each pixel in the output image is derived from the statistics of the 2053 2182 corresponding set of input image pixels based on the statistics 2054 2183 specified by \code{stats}. Only one of the statistics choices may be 2055 2184 specified, otherwise the function must return an error. This function 2056 must be defined for the following types: \code{ps U8}, \code{psU16},2185 must be defined for the following types: \code{psS8}, \code{psU16}, 2057 2186 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, 2058 2187 \code{psC64}. 2059 2188 2060 2189 \begin{verbatim} 2061 psImage *psImageRotate(psImage *out, const psImage *input, float 2062 angle, float exposed); 2190 psImage *psImageResample(psImage *out, const psImage *in, 2191 int scale, psImageResampleMode mode); 2192 typedef enum { 2193 PS_RESAMPLE_FLAT, 2194 PS_RESAMPLE_BILINEAR, 2195 PS_RESAMPLE_BICUBIC, 2196 PS_RESAMPLE_SINC 2197 } psImageResampleMode mode; 2198 \end{verbatim} 2199 Resample image to new scale. A new image is constructed in which the 2200 dimensions are increased by a factor of \code{scale}. The 2201 \code{scale}, always a positive number, is equal in each dimension. 2202 The output image is generated from all input image pixels. Each pixel 2203 in the output image is derived by interpolating between neighboring 2204 pixels using the specified interpolation method (\code{mode}). 2205 2206 \begin{verbatim} 2207 psImage *psImageRotate(psImage *out, const psImage *input, float angle, float exposed); 2063 2208 \end{verbatim} 2064 2209 Rotate the input image by given angle, specified in degrees. The … … 2108 2253 pixels to be excluded if their corresponding mask pixel value matches 2109 2254 the value of \code{maskVal}. This function must be defined for the 2110 following types: \code{ps U8}, \code{psU16}, \code{psF32},2255 following types: \code{psS8}, \code{psU16}, \code{psF32}, 2111 2256 \code{psF64}. 2112 2257 … … 2120 2265 generate is specified by \code{psHistogram hist} (see 2121 2266 section~\ref{sec:histograms}). This function must be defined for the 2122 following types: \code{ps U8}, \code{psU16}, \code{psF32}, \code{psF64}.2267 following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}. 2123 2268 2124 2269 \begin{verbatim} … … 2128 2273 structure \code{coeffs} contains the desired order and terms of 2129 2274 interest. This function must be defined for the 2130 following types: \code{ps U8}, \code{psU16}, \code{psF32}, \code{psF64}.2275 following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}. 2131 2276 2132 2277 \begin{verbatim} … … 2136 2281 input polynomial coefficients, set the image pixel values on the basis 2137 2282 of the polynomial function. This function must be defined for the 2138 following types: \code{ps U8}, \code{psU16}, \code{psF32}, \code{psF64}.2283 following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}. 2139 2284 2140 2285 \subsubsection{Image I/O Functions} … … 2158 2303 slice of the image. The data is read from the extension specified by 2159 2304 extname (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. 2305 representing the primary header unit (PHU), 1 the first extension, 2306 etc). This function must call \code{psError} and return \code{NULL} 2307 if any of the specified parameters are out of range for the data in 2308 the image file, if the specified image file does not exist, or the 2309 image on disk is zero- or one-dimensional. This function will only 2310 read images of the native FITS image types (\code{psU8}, \code{psU16}, 2311 \code{psU32}, \code{psF32}, \code{psF64}). The user is expected to 2312 convert the data type as needed with \code{psImageCopy}. The return 2313 value must be 0 for a successful operation and 1 for an error. 2165 2314 2166 2315 \begin{verbatim} … … 2180 2329 the image, return an error (ie, if x + image.nx >= NAXIS1, y + 2181 2330 image.ny >= NAXIS2, or z >= NAXIS3). If the image does not exist, 2182 require x,y,z to be zero. 2331 require x,y,z to be zero. This function will only write images of the 2332 native FITS image types (\code{psU8}, \code{psU16}, \code{psU32}, 2333 \code{psF32}, \code{psF64}). The user is expected to convert the data 2334 type as needed with \code{psImageCopy}. The return value must be 0 2335 for a successful operation and 1 for an error. 2183 2336 2184 2337 \subsubsection{Image Pixel Manipulations} 2185 2338 2186 2339 \begin{verbatim} 2187 int psImageClip(psImage *input, float min, float vmin, float max, floatvmax);2340 int psImageClip(psImage *input, double min, double vmin, double max, double vmax); 2188 2341 \end{verbatim} 2189 2342 Clip image values outside of range to given values. All pixels with … … 2204 2357 2205 2358 \begin{verbatim} 2359 int psImageClipComplexRegion(psImage *input, complex double min, complex double vmin, complex double max, complex double vmax); 2360 \end{verbatim} 2361 Clip image values outside of range to given values. All pixels with 2362 values \code{< min} are set to the value \code{vmin}. All pixels with 2363 values \code{> max} are set to the value \code{vmax}. Returns the 2364 number of clipped pixels. This function must be defined for the 2365 following types: \code{psC32}, \code{psC64}. The arguments 2366 (\code{min}, \code{max}, etc) define a rectangular region in complex 2367 space; data values inside this regions are unchanged while those 2368 outside are set to either \code{vmax} (if either their real or 2369 imaginary portions are greater than the corresponding values of 2370 \code{max}) or \code{vmin} (in all other cases). If the input 2371 parameters \code{vmin} or \code{vmax} are out of bounds for the image 2372 pixel 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} 2206 2376 int psImageClipNaN(psImage *input, float value); 2207 2377 \end{verbatim} … … 2249 2419 their \code{psType} elements, which always are the first elements. 2250 2420 Note that these functions return a pointer to the appropriate type for 2251 the operation. Since the result may iscast to \code{psType}, the2421 the operation. Since the result may be cast to \code{psType}, the 2252 2422 resulting type may be determined by examining the return value. It is 2253 2423 expected that the implementation of these functions will employ … … 2260 2430 Operations between data structures with incompatible sizes are not 2261 2431 allowed. 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 2433 functions are valid for all data types \code{psU8}, \code{psU16}, 2434 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, 2435 \code{psC64}. 2263 2436 2264 2437 Binary operations between an image and a vector have a potential … … 2270 2443 a ``transposed vector'' in the same context acts on all columns. 2271 2444 Vectors, 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} 2445 converted to ``transposed vectors'' by setting 2446 \code{vector->type.dimen = PS_DIMEN_TRANSV}. 2276 2447 2277 2448 It 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: 2449 functions. These functions may take a pointer to type 2450 \code{psScalar}, which is freed by the function. This allows one to 2451 write the following lines to take the sine of the square of all pixels 2452 in an image: 2302 2453 \begin{verbatim} 2303 2454 psImage A,B; 2304 2455 2305 B = psBinaryOp (NULL, A, "^", psScalar (2));2306 (void)psUnaryOp(B, B, "sin");2456 B = psBinaryOp (NULL, A, "^", psScalarAlloc(2)); 2457 psUnaryOp(B, B, "sin"); 2307 2458 \end{verbatim} 2308 2459 … … 2677 2828 being represented, given by the enumerated type \code{psMetadataType}: 2678 2829 \begin{verbatim} 2679 typedef enum { ///< type of valis:2830 typedef enum { ///< type of data.item is: 2680 2831 PS_META_ITEM_SET = 0, ///< NULL; metadata is in psMetadataType.items 2681 2832 PS_META_S32, ///< int (.S32) … … 2749 2900 The \code{psMetadataItem} destructor is specified below. Note that 2750 2901 the destructor for \code{psMetadataItem} must call the appropriate 2751 destructor for the \code{ val} (recall that it is the duty of the2902 destructor for the \code{data.item} (recall that it is the duty of the 2752 2903 \code{psMyTypeFree}s to decrement the \code{refCounter} and free the 2753 2904 memory if and only if the \code{refCounter == 1} --- see 2754 2905 \S\ref{sec:free}). 2755 2906 \begin{verbatim} 2756 void p sMetadataItemFree(psMetadataItem *item);2907 void p_psMetadataItemFree(psMetadataItem *item); 2757 2908 \end{verbatim} 2758 2909 … … 2763 2914 \begin{verbatim} 2764 2915 psMetadata *psMetadataAlloc(void); 2765 void p sMetadataFree(psMetadata *md);2916 void p_psMetadataFree(psMetadata *md); 2766 2917 \end{verbatim} 2767 2918 … … 2771 2922 be appended. In both cases, the return value defines the success 2772 2923 (\code{true}) or failure of the operation. The second function, 2773 \code{psMetadataAdd} takes a pointer or value which is interpret ted2774 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 not2924 \code{psMetadataAdd} takes a pointer or value which is interpreted by 2925 the function using variadic argument interpretation. Both functions 2926 take an parameter \code{where} which specifies where in the list to 2927 place the element, following the conventions for the \code{psList}. 2928 Care should be taken not to leak memory when appending an item for 2929 which the key already exists in the metadata (and is not 2779 2930 \code{PS_META_NON_UNIQUE}). 2780 2931 % 2781 2932 \begin{verbatim} 2782 2933 bool psMetadataAddItem(psMetadata *restrict md, int where, 2783 psMetadataItem *restrict item);2934 psMetadataItem *restrict item); 2784 2935 bool psMetadataAdd(psMetadata *restrict md, int where, 2785 const char *name, int format, const char *comment, ...);2936 const char *name, int format, const char *comment, ...); 2786 2937 \end{verbatim} 2787 2938 … … 2829 2980 \end{verbatim} 2830 2981 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); 2982 Metadata items may be printed to an open file descriptor based on a 2983 provided format. The format string is an sprintf format statement 2984 with exactly one \% formatting command. If the metadata item type is 2985 a numeric type, this formatting command must also be numeric, and type 2986 conversion performed to the value to match the format type. If the 2987 metadata item type is a string, the formatting command must also be 2988 for a string (\%s type of command). If the metadata type is any other 2989 data type, printing is not allowed. 2990 \begin{verbatim} 2991 void psMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *restrict md); 2836 2992 \end{verbatim} 2837 2993 … … 2937 3093 the mask: \code{T.x->mask[1][1] = 0; T.y->mask[1][1] = 0;} 2938 3094 2939 The \code{psPlaneDistort ion} represents an optical distortion. The3095 The \code{psPlaneDistort} represents an optical distortion. The 2940 3096 lowest two terms are the $x$ and $y$ axis of the target system. The 2941 3097 higher two terms may represent magnitude and color terms. … … 2956 3112 CCD, of an object with magnitude and color ($m,c$) to a second frame 2957 3113 ($p,q$), e.g., the focal plane. If we have only first order terms in 2958 the transformation \code{psPlane TransformT}, the new coordinates3114 the transformation \code{psPlaneDistort T}, the new coordinates 2959 3115 would be represented by the terms: 2960 3116 % … … 3013 3169 \begin{verbatim} 3014 3170 psSphereTransform *psSphereTransformAlloc(double NPlon, double NPlat, double ZP); 3015 void p sSphereTransformFree(psSphereTransform *trans);3171 void p_psSphereTransformFree(psSphereTransform *trans); 3016 3172 \end{verbatim} 3017 3173 where \code{NPlon} and \code{NPlat} define the coordinates in the … … 3019 3175 defines the longitude in the input system of the equatorial 3020 3176 intersection between the two systems (e.g, the first point of Ares). 3177 The constructor must calculate the sines and cosines above. 3021 3178 3022 3179 Spherical coordinates may be transformed by providing the … … 3031 3188 The following functions simply return the appropriate 3032 3189 \code{psSphereTransform} to convert between predefined spherical 3033 coordinate systems (i.e., ICRS, Ecliptic and Galactic). 3190 coordinate systems (i.e., ICRS, Ecliptic and Galactic). These are 3191 constructors as well as the above \code{psSphereTransformAlloc}. 3034 3192 % 3035 3193 \begin{verbatim} … … 3087 3245 the sky, as well as a function to apply an offset to a position. The 3088 3246 first 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.} 3247 The second applies the given offset to the coordinate. Both an offset 3248 mode and an offset unit may be defined. The mode may be either 3249 \code{PS_SPHERICAL}, in which case the specified offset corresponds to 3250 an offset in angles, or it may be \code{PS_LINEAR}, in which case the 3251 offset corresponds to a linear offset in a local projection. The 3252 offset 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 3254 the offset only. 3091 3255 3092 3256 \begin{verbatim} 3093 3257 psSphere *psSphereGetOffset(const psSphere *restrict position1, 3094 3258 const psSphere *restrict position2, 3095 const char *type); 3259 psSphereOffsetMode mode, 3260 psSphereOffsetUnit unit); 3261 3096 3262 psSphere *psSphereSetOffset(const psSphere *restrict position, 3097 3263 const psSphere *restrict offset, 3098 const char *type); 3264 psSphereOffsetMode mode, 3265 psSphereOffsetUnit unit); 3266 3267 typedef enum { 3268 PS_SPHERICAL; 3269 PS_LINEAR; 3270 } psSphereOffsetMode; 3271 3272 typedef enum { 3273 PS_ARCSEC; 3274 PS_ARCMIN; 3275 PS_DEGREE; 3276 PS_RADIAN; 3277 } psSphereOffsetUnit; 3099 3278 \end{verbatim} 3100 3279 Note that these should propagate the errors appropriately. … … 3412 3591 \begin{verbatim} 3413 3592 psGrommit *psGrommitAlloc(const psExposure *exp); 3414 void p sGrommitFree(psGrommit *grommit);3593 void p_psGrommitFree(psGrommit *grommit); 3415 3594 \end{verbatim} 3416 3595
Note:
See TracChangeset
for help on using the changeset viewer.
