Changeset 4453
- Timestamp:
- Jul 5, 2005, 1:52:23 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r4445 r4453 1 %%% $Id: psLibSDRS.tex,v 1.30 7 2005-07-01 04:30:18price Exp $1 %%% $Id: psLibSDRS.tex,v 1.308 2005-07-05 23:52:23 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 560 560 561 561 For array-like collections (specifically, \code{psArray}, 562 \code{psVector}, and \code{psImage}) we allow the user to refer to a 563 negative index to mean address from the end. Consequently, the number 564 of elements in structures should be signed. It is the responsibility 565 of these structure allocators (e.g., \code{psArrayAlloc}) to check 566 that the requested number of elements is not negative (calling 567 \code{psAbort} otherwise). All other allocators shall simply use 568 \code{size_t} where the number of elements is needed (saving the 569 trouble of checking before passing to psAlloc). 562 \code{psPixels}, \code{psVector}, and \code{psImage}) we allow the 563 user to refer to a negative index in the accessor (e.g., 564 \code{psArrayGet}) to mean address from the end. Consequently, the 565 number of elements in structures should be signed (in order to be able 566 to access the full range of allocated values). It is the 567 responsibility of these structure allocators (e.g., 568 \code{psArrayAlloc}) to check that the requested number of elements is 569 not negative (calling \code{psAbort} otherwise). All other allocators 570 shall simply use \code{size_t} where the number of elements is needed 571 (saving the trouble of checking before passing to psAlloc). 570 572 571 573 \subsubsection{Callback Routines} … … 1696 1698 1697 1699 These accessor functions are provided as a convenience to the user. 1698 \code{psArraySet} sets the value of the \code{in} array at the specified 1699 \code{position} to \code{value}, returning \code{true} if successful. 1700 \code{psArrayGet} returns the value of the \code{in} array at the 1701 specified \code{position}. 1700 \code{psArraySet} sets the value of the \code{in} array at the 1701 specified \code{position} to \code{value}, returning \code{true} if 1702 successful. \code{psArrayGet} returns the value of the \code{in} 1703 array at the specified \code{position}. A negative \code{position} 1704 means index from the end. 1702 1705 1703 1706 \begin{datatype} … … 2029 2032 2030 2033 typedef struct { 2031 psU32 n;// Number in use2032 const psU32 nalloc;// Number allocated2034 long n; // Number in use 2035 const long nalloc; // Number allocated 2033 2036 psPixelCoord *data; // The pixel coordinates 2034 2037 void *lock; // Lock for thread safety … … 2037 2040 2038 2041 \begin{prototype} 2039 psPixels *psPixelsAlloc( psU32nalloc);2040 psPixels *psPixelsRealloc(psPixels *pixels, psU32nalloc);2042 psPixels *psPixelsAlloc(long nalloc); 2043 psPixels *psPixelsRealloc(psPixels *pixels, long nalloc); 2041 2044 \end{prototype} 2042 2045 … … 2064 2067 are stored is not important, the values may be sorted, allowing the 2065 2068 use of a faster algorithm than a linear scan). 2069 2070 \begin{prototype} 2071 bool psPixelsSet(psPixels *pixels, long position, psPixelCoord value); 2072 psPixelCoord psPixelsGet(const psPixels *pixels, long position); 2073 \end{prototype} 2074 2075 These accessor functions are provided as a convenience to the user. 2076 \code{psPixelsSet} sets the value of the \code{pixels} array at the 2077 specified \code{position} to \code{value} (a \code{psPixelCoord} 2078 passed by value), returning \code{true} if successful. 2079 \code{psPixelsGet} returns the value of the \code{pixels} array at the 2080 specified \code{position}. A negative \code{position} means index 2081 from the end. 2066 2082 2067 2083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 2539 2555 The iterator may be set to a location in the \code{psMetadata} list, 2540 2556 and the user may get the previous or next item in the list relative to 2541 that location. \code{psMetadataGetNext} has the ability to match the2542 key using a POSIX \code{regex}, e.g., if the user only wants to 2543 iterate through \code{IPP.machines.sky} and doesn't want to bother 2544 with \code{IPP.machines.detector}. The iterator should iterate over 2545 everyitem in the metadata list, even those that are contained in a2557 that location. The iterators may be used to return the next key 2558 matching a POSIX \code{regex}, e.g., if the user only wants to iterate 2559 through \code{IPP.machines.sky} and doesn't want to bother with 2560 \code{IPP.machines.detector}. The iterator should iterate over every 2561 item in the metadata list, even those that are contained in a 2546 2562 \code{PS_DATA_LIST}. The value \code{iterator} specifies the iterator 2547 2563 to be used. In setting the iterator, the position of the iterator is … … 3140 3156 The input data is cast to match the vector datatype, allowing for 3141 3157 integers to be preserved. 3158 3159 \begin{prototype} 3160 bool psVectorSet(const psVector *input, long position, complex double value); 3161 complex double psVectorGet(const psVector *input, long position); 3162 \end{prototype} 3163 3164 These accessor functions are provided as a convenience to the user. 3165 \code{psVectorSet} sets the value of the \code{input} vector at the 3166 specified \code{position} to \code{value} (appropriately cast), 3167 returning \code{true} if successful. \code{psVectorGet} returns the 3168 value of the \code{input} vector at the specified \code{position}. A 3169 negative \code{position} means index from the end. 3142 3170 3143 3171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 3238 3266 The input data is cast to match the image datatype, allowing for 3239 3267 integers to be preserved. 3268 3269 \begin{prototype} 3270 bool psImageSet(const psImage *image, int x, int y, complex double value); 3271 complex double psImageGet(const psImage *image, int x, int y); 3272 \end{prototype} 3273 3274 These accessor functions are provided as a convenience to the user. 3275 \code{psImageSet} sets the value of the \code{image} at the specified 3276 \code{x,y} position to \code{value} (appropriately cast), returning 3277 \code{true} if successful. \code{psImageGet} returns the value of the 3278 \code{image} at the specified \code{x,y} position. A negative value 3279 for the \code{x,y} position means index from the end. 3240 3280 3241 3281 \subsubsection{Image Regions}
Note:
See TracChangeset
for help on using the changeset viewer.
