Changeset 792 for trunk/doc/pslib/psLibSDRS.tex
- Timestamp:
- May 26, 2004, 4:34:32 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r748 r792 1 %%% $Id: psLibSDRS.tex,v 1.4 7 2004-05-20 08:44:30eugene Exp $1 %%% $Id: psLibSDRS.tex,v 1.48 2004-05-27 02:34:32 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 212 212 The first and last elements of this structure are \code{void} pointers 213 213 called \code{startblock} and \code{endblock}, which are assigned a 214 special value, \code{P S_MEM_MAGIC}. The segment following the214 special value, \code{P_PS_MEMMAGIC}. The segment following the 215 215 user-memory block consists of a single \code{void} pointer, and is 216 also assigned the special value of \code{P S_MEM_MAGIC}. This address216 also assigned the special value of \code{P_PS_MEMMAGIC}. This address 217 217 is pointed to by the structure element \code{endpost}. 218 218 … … 223 223 \code{sizeof(psMemBlock)} bytes with the data of the \code{psMemBlock} 224 224 structure, and the last \code{sizeof(void)} bytes with 225 \code{P S_MEM_MAGIC}. It returns to the user the pointer corresponding225 \code{P_PS_MEMMAGIC}. It returns to the user the pointer corresponding 226 226 to the address \code{ADDR + sizeof(psMemBlock)}. If the memory 227 227 management system reallocates a block of memory, it must also allocate … … 240 240 values, which can be detected by the memory management system. In the 241 241 second case, hexadecimal dumps of large blocks of memory are easier to 242 examine if the value of \code{P S_MEM_MAGIC} is chosen to catch the243 eye. A traditional value for \code{P S_MEM_MAGIC} is \code{0xdeadbeef}242 examine if the value of \code{P_PS_MEMMAGIC} is chosen to catch the 243 eye. A traditional value for \code{P_PS_MEMMAGIC} is \code{0xdeadbeef} 244 244 which is also easily recognized in a dump of the memory table. 245 245 … … 250 250 \begin{verbatim} 251 251 typedef struct { 252 const void *startblock; ///< initialised to P S_MEM_MAGIC252 const void *startblock; ///< initialised to P_PS_MEMMAGIC 253 253 const unsigned long id; ///< a unique ID for this allocation 254 254 const char *file; ///< set from __FILE__ in e.g. p_psAlloc 255 255 const int lineno; ///< set from __LINE__ in e.g. p_psAlloc 256 256 int refCounter; ///< how many times pointer is referenced 257 const void **endpost; ///< initialised to P S_MEM_MAGIC258 const void *endblock; ///< initialised to P S_MEM_MAGIC257 const void **endpost; ///< initialised to P_PS_MEMMAGIC 258 const void *endblock; ///< initialised to P_PS_MEMMAGIC 259 259 } psMemBlock; 260 260 \end{verbatim} … … 390 390 The callback function is called with the attempted size and is 391 391 expected to return a pointer to the allocated memory or \code{NULL}. 392 Until the callback function is set with \code{psMemExhaustedCallbackSet},393 the default callback function immediately returns \code{NULL}, in 394 which case \code{psAlloc} will call\code{psAbort}.392 Until the callback function is set with 393 \code{psMemExhaustedCallbackSet}, or if this callback is set to NULL, 394 \code{psAlloc} immediately calls \code{psAbort}. 395 395 396 396 \subsubsubsection{\tt psMemProblemCallback} … … 2106 2106 full image or a subimage to be read. The starting pixel of the region 2107 2107 is specified by \code{x,y}, while the dimensions of the requested 2108 region are specified by \code{nx,ny}. A negative value of -1 for 2109 these two parameters specifies the full array of the requested image, 2110 less absolute value of the variable. If the native image is a cube, 2111 the value of z specifies the requested slice of the image. The data 2112 is read from the extension specified by extname (matching the EXTNAME 2113 keyword) or by the extnum value (with 0 representing the PHU, 1 the 2114 first extension, etc). This function must call \code{psError} and 2115 return \code{NULL} if any of the specified parameters are out of range 2116 for the data in the image file, if the specified image file does not 2117 exist, or the image on disk is zero- or one-dimensional. 2108 region are specified by \code{nx,ny}. A negative value for either of 2109 \code{nx} or \code{ny} specifies the size of the region to be read 2110 counting down from the end of the array. In other words, the implied 2111 value of \code{nx} is: 2112 \begin{verbatim} 2113 nx = (nx > 0) ? nx : image.ncols - x + nx; 2114 \end{verbatim} 2115 If the native image is a cube, the value of z specifies the requested 2116 slice of the image. The data is read from the extension specified by 2117 extname (matching the EXTNAME keyword) or by the extnum value (with 0 2118 representing the PHU, 1 the first extension, etc). This function must 2119 call \code{psError} and return \code{NULL} if any of the specified 2120 parameters are out of range for the data in the image file, if the 2121 specified image file does not exist, or the image on disk is zero- or 2122 one-dimensional. 2118 2123 2119 2124 \begin{verbatim} 2120 psImage *psImageFReadSection(psImage *output, int x, int y, int nx, int ny, int z, 2121 const char *extname, int extnum, FILE *f); 2122 \end{verbatim} 2123 Read an image or subimage from file descriptor. The input parameters 2124 and their behavior for this function are identical with those in 2125 \code{psImageReadSection}. 2126 2127 \begin{verbatim} 2128 psImage *psImageWriteSection(const psImage *input, int x, int y, int z, 2129 const char *extname, int extnum, const char *filename); 2125 int psImageWriteSection(const psImage *input, int x, int y, int z, 2126 const char *extname, int extnum, const char *filename); 2130 2127 \end{verbatim} 2131 2128 Write an image section to the named file, which may exist. This … … 2134 2131 If the specified extension does not exist, it should be created. If 2135 2132 an extension is specified and no PHU exists, a basic PHU should be 2136 created. 2137 2138 \begin{verbatim} 2139 psImage *psImageFWriteSection(const psImage *input, int x, int y, int z, 2140 const char *extname, int extnum, FILE *f); 2141 \end{verbatim} 2142 Write an image section to file descriptor as above: 2133 created. Care must be taken to interpret x,y,z in the two cases a) 2134 there is already an existing image and b) there is not an existing 2135 image. If the image exists, write the complete psImage data to the 2136 existing image starting at the coordinate x,y,z. If any of these 2137 parameters implies writing pixels outside the existing data area of 2138 the image, return an error (ie, if x + image.nx >= NAXIS1, y + 2139 image.ny >= NAXIS2, or z >= NAXIS3). If the image does not exist, 2140 require x,y,z to be zero. 2143 2141 2144 2142 \subsubsection{Image Pixel Manipulations}
Note:
See TracChangeset
for help on using the changeset viewer.
