IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2004, 4:34:32 PM (22 years ago)
Author:
eugene
Message:

minor edits from several recent bugs (~29-39)

File:
1 edited

Legend:

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

    r748 r792  
    1 %%% $Id: psLibSDRS.tex,v 1.47 2004-05-20 08:44:30 eugene Exp $
     1%%% $Id: psLibSDRS.tex,v 1.48 2004-05-27 02:34:32 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    212212The first and last elements of this structure are \code{void} pointers
    213213called \code{startblock} and \code{endblock}, which are assigned a
    214 special value, \code{PS_MEM_MAGIC}.  The segment following the
     214special value, \code{P_PS_MEMMAGIC}.  The segment following the
    215215user-memory block consists of a single \code{void} pointer, and is
    216 also assigned the special value of \code{PS_MEM_MAGIC}.  This address
     216also assigned the special value of \code{P_PS_MEMMAGIC}.  This address
    217217is pointed to by the structure element \code{endpost}.
    218218
     
    223223\code{sizeof(psMemBlock)} bytes with the data of the \code{psMemBlock}
    224224structure, and the last \code{sizeof(void)} bytes with
    225 \code{PS_MEM_MAGIC}.  It returns to the user the pointer corresponding
     225\code{P_PS_MEMMAGIC}.  It returns to the user the pointer corresponding
    226226to the address \code{ADDR + sizeof(psMemBlock)}.  If the memory
    227227management system reallocates a block of memory, it must also allocate
     
    240240values, which can be detected by the memory management system.  In the
    241241second case, hexadecimal dumps of large blocks of memory are easier to
    242 examine if the value of \code{PS_MEM_MAGIC} is chosen to catch the
    243 eye.  A traditional value for \code{PS_MEM_MAGIC} is \code{0xdeadbeef}
     242examine if the value of \code{P_PS_MEMMAGIC} is chosen to catch the
     243eye.  A traditional value for \code{P_PS_MEMMAGIC} is \code{0xdeadbeef}
    244244which is also easily recognized in a dump of the memory table.
    245245
     
    250250\begin{verbatim}
    251251typedef struct {
    252     const void *startblock;             ///< initialised to PS_MEM_MAGIC
     252    const void *startblock;             ///< initialised to P_PS_MEMMAGIC
    253253    const unsigned long id;             ///< a unique ID for this allocation
    254254    const char *file;                   ///< set from __FILE__ in e.g. p_psAlloc
    255255    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
    256256    int refCounter;                     ///< how many times pointer is referenced
    257     const void **endpost;               ///< initialised to PS_MEM_MAGIC
    258     const void *endblock;               ///< initialised to PS_MEM_MAGIC
     257    const void **endpost;               ///< initialised to P_PS_MEMMAGIC
     258    const void *endblock;               ///< initialised to P_PS_MEMMAGIC
    259259} psMemBlock;
    260260\end{verbatim}
     
    390390The callback function is called with the attempted size and is
    391391expected 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}.
     392Until the callback function is set with
     393\code{psMemExhaustedCallbackSet}, or if this callback is set to NULL,
     394\code{psAlloc} immediately calls \code{psAbort}.
    395395
    396396\subsubsubsection{\tt psMemProblemCallback}
     
    21062106full image or a subimage to be read.  The starting pixel of the region
    21072107is 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.
     2108region 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
     2110counting down from the end of the array.  In other words, the implied
     2111value of \code{nx} is:
     2112\begin{verbatim}
     2113nx = (nx > 0) ? nx : image.ncols - x + nx;
     2114\end{verbatim}
     2115If the native image is a cube, the value of z specifies the requested
     2116slice of the image.  The data is read from the extension specified by
     2117extname (matching the EXTNAME keyword) or by the extnum value (with 0
     2118representing the PHU, 1 the first extension, etc).  This function must
     2119call \code{psError} and return \code{NULL} if any of the specified
     2120parameters are out of range for the data in the image file, if the
     2121specified image file does not exist, or the image on disk is zero- or
     2122one-dimensional.
    21182123 
    21192124\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);
     2125int psImageWriteSection(const psImage *input, int x, int y, int z,
     2126                        const char *extname, int extnum, const char *filename);
    21302127\end{verbatim}
    21312128Write an image section to the named file, which may exist.  This
     
    21342131If the specified extension does not exist, it should be created.  If
    21352132an 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:
     2133created.  Care must be taken to interpret x,y,z in the two cases a)
     2134there is already an existing image and b) there is not an existing
     2135image.  If the image exists, write the complete psImage data to the
     2136existing image starting at the coordinate x,y,z.  If any of these
     2137parameters implies writing pixels outside the existing data area of
     2138the image, return an error (ie, if x + image.nx >= NAXIS1, y +
     2139image.ny >= NAXIS2, or z >= NAXIS3).  If the image does not exist,
     2140require x,y,z to be zero.
    21432141
    21442142\subsubsection{Image Pixel Manipulations}
Note: See TracChangeset for help on using the changeset viewer.