IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1568


Ignore:
Timestamp:
Aug 18, 2004, 3:04:08 PM (22 years ago)
Author:
eugene
Message:

bugzilla additions

File:
1 edited

Legend:

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

    r1567 r1568  
    1 %%% $Id: psLibSDRS.tex,v 1.78 2004-08-19 00:26:42 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.79 2004-08-19 01:04:08 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    381381
    382382\begin{verbatim}
    383   void p_psSetFreeFcn(void* ptr);     
    384   ///< sets the fcn pointer to the appropriate ps*Free function.  If NULL,
    385   ///< then a generic free functionality is used (i.e., the old psFree
    386   ///< functionality).
    387 
    388   freeFcn p_psGetFreeFcn(void* ptr);
    389   ///< retrieves the function pointer to the higher-level free function to be
    390   ///< used.  If NULL, then the traditional psFree functionality shall be used.
    391 \end{verbatim}
     383void p_psMemSetDeallocator(void* ptr, psFreeFcn freeFcn);     
     384psFreeFcn p_psMemGetDeallocator(void* ptr);     
     385\end{verbatim}
     386
     387A free function handles any deallocation procedures of an object
     388referred to by a pointer, excluding the freeing of the memory block of
     389the pointer reference itself.  If the pointer refers to an object that
     390references other memory blocks this free function would insure the
     391freeing of any encapsulated memory block references. For example,
     392\code{psList} references a series of node objects of a linked list, so
     393its free function would free these node objects and the node object's
     394free function would free the data element references they may contain.
     395
     396The fucntion \code{p_psSetFreeFcn} is used to associated a free
     397function to a memory block, while \code{p_psGetFreeFcn} retrieves the
     398last free function set.  To remove a free function from a memory
     399block, the \code{psSetFreeFcn} should be invoked with \code{NULL}.  If
     400no free function is set, \code{p_psGetFreeFcn} shall return
     401\code{NULL}.
    392402
    393403\subsubsection{Callback Routines}
     
    497507typedef long (*psMemFreeCallback)(const psMemBlock *ptr);
    498508psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func);
    499 long psMemGetId(void);
     509psMemoryId psMemGetId(void);
    500510\end{verbatim}
    501511%
     
    573583%
    574584\begin{verbatim}
    575 int psMemGetRefCounter(void *vptr);
     585psReferenceCount psMemGetRefCounter(void *vptr);
    576586void *psMemIncrRefCounter(void *vptr);
    577587void *psMemDecrRefCounter(void *vptr);
     
    12841294    } data;
    12851295    const struct psImage *parent;       ///< parent, if a subimage
    1286     int Nchildren;                      ///< number of subimages
    1287     struct psImage **children;          ///< children of this region (Nchildren total)
     1296    int nChildren;                      ///< number of subimages
     1297    struct psImage **children;          ///< children of this region (nChildren total)
    12881298} psImage;
    12891299\end{verbatim}
     
    13021312starting column number in the parent image while \code{y0} is the
    13031313starting row number.  The structure may include references to
    1304 subrasters (\code{children, Nchildren}) and/or to a containing array
     1314subrasters (\code{children, nChildren}) and/or to a containing array
    13051315(\code{parent}).  Unless this image is a child of another image
    13061316(represents a subset of the pixels of another image), the image data
     
    23352345Create a copy of the specified image, converting the type in the
    23362346process.  If the output target pointer is not \code{NULL}, place the
    2337 result in the specified structure.  If the output target pointer is
    2338 \code{NULL}, the original data type must be maintained.  The output
    2339 image data must be allocated as a single, contiguous block of memory.
    2340 The output image may not be the input image.  This function must be
    2341 defined for the following types: \code{psU8}, \code{psU16},
    2342 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
    2343 \code{psC64}.
     2347result in the specified structure.  The output image data must be
     2348allocated as a single, contiguous block of memory.  The output image
     2349may not be the input image.  This function must be defined for the
     2350following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16},
     2351\code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.
    23442352
    23452353\begin{verbatim}
     
    23632371} psImageCutDirection;
    23642372
    2365 psVector *psImageSlice(psVector *out, const psImage *input,
     2373psVector *psImageSlice(psVector *out,
     2374                       psVector *coords,
     2375                       const psImage *restrict input,
    23662376                       const psImage *restrict mask,
    23672377                       unsigned int maskVal,
    2368                        int x, int y, int nx, int ny,
    2369                        psImageCutDirection direction, const psStats *stats);
     2378                       unsigned int x,
     2379                       unsigned int y,
     2380                       unsigned int nx,
     2381                       unsigned int ny,
     2382                       psImageCutDirection direction,
     2383                       const psStats *stats);
    23702384\end{verbatim}
    23712385Extract pixels from rectlinear region to a vector (array of floats).
     
    23762390output vectors is derived from the statistics of the pixels at that
    23772391direction coordinate.  The statistic used to derive the output vector
    2378 value is specified by \code{stats}.  Only one of the statistics
    2379 choices may be specified, otherwise the function must return an error.
    2380 This function must be defined for the following types: \code{psS8},
    2381 \code{psU16}, \code{psF32}, \code{psF64}.
     2392value is specified by \code{stats}.  If \code{coords} is not
     2393\code{NULL}, the calculated coordinates along the slice are returned
     2394in this vector.  Only one of the statistics choices may be specified,
     2395otherwise the function must return an error.  This function must be
     2396defined for the following types: \code{psS8}, \code{psU16},
     2397\code{psF32}, \code{psF64}.
    23822398
    23832399\begin{verbatim}
     
    24222438
    24232439\subsubsection{Image Geometry Manipulation}
     2440
     2441Several functions which manipulate the image geometry require the
     2442specification of the interpolation scheme to be used.  This
     2443information is carried by the following enum:
     2444\begin{verbatim}
     2445typedef enum {
     2446    PS_INTERPOLATE_FLAT,
     2447    PS_INTERPOLATE_BILINEAR,
     2448    PS_INTERPOLATE_BICUBIC,
     2449    PS_INTERPOLATE_SINC
     2450} psImageInterpolateMode mode;
     2451\end{verbatim}
    24242452
    24252453\begin{verbatim}
     
    24472475\begin{verbatim}
    24482476psImage *psImageResample(psImage *out, const psImage *in,
    2449                          int scale, psImageResampleMode mode);
    2450 typedef enum {
    2451     PS_RESAMPLE_FLAT,
    2452     PS_RESAMPLE_BILINEAR,
    2453     PS_RESAMPLE_BICUBIC,
    2454     PS_RESAMPLE_SINC
    2455 } psImageResampleMode mode;
     2477                         int scale, psImageInterpolateMode mode);
    24562478\end{verbatim}
    24572479Resample image to new scale.  A new image is constructed in which the
     
    24632485
    24642486\begin{verbatim}
    2465 psImage *psImageRotate(psImage *out, const psImage *input, float angle, float exposed);
     2487psImage *psImageRotate(psImage *out, const psImage *input, float angle, psC64 exposed, psImageInterpolateMode mode);
    24662488\end{verbatim}
    24672489Rotate the input image by given angle, specified in degrees.  The
    24682490output image must contain all of the pixels from the input image in
    24692491their new frame.  Pixels in the output image which do not map to input
    2470 pixels should be set to \code{exposed}.  The center of rotation is
    2471 always the center pixel of the image.  The rotation is specified in
    2472 the sense that a positive angle is an anti-clockwise rotation.  This
    2473 function must be defined for the following types: \code{psU8},
    2474 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64},
    2475 \code{psC32}, \code{psC64}.
     2492pixels should be set to \code{exposed}, cast to the same type as the
     2493image.  The center of rotation is always the center pixel of the
     2494image.  The rotation is specified in the sense that a positive angle
     2495is an anti-clockwise rotation.  This function must be defined for the
     2496following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16},
     2497\code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.
    24762498
    24772499\begin{verbatim}
    24782500psImage *psImageShift(psImage *out, const psImage *input,
    2479                       float dx, float dy, float exposed);
     2501                      float dx, float dy, psC64 exposed, psImageInterpolateMode mode);
    24802502\end{verbatim}
    24812503Shift image by an arbitrary number of pixels (\code{dx,dy}) in either
     
    24842506image has the same dimensions as the input image.  Pixels which fall
    24852507off the edge of the output image are lost.  Newly exposed pixels are
    2486 set to the value given by \code{exposed}.  This function must be
    2487 defined for the following types: \code{psU8}, \code{psU16},
    2488 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
    2489 \code{psC64}.
     2508set to the value given by \code{exposed}, cast to the same type as the
     2509image.  This function must be defined for the following types:
     2510\code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32},
     2511\code{psF64}, \code{psC32}, \code{psC64}.
    24902512
    24912513\begin{verbatim}
     
    25412563following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}.
    25422564
    2543 \begin{verbatim}
    2544 float psImagePixelInterpolate (psImage *input, float x, float y, psImageResampleMode mode);
     2565\tbd{does this need to define the mask?}
     2566
     2567\begin{verbatim}
     2568psF64 psImagePixelInterpolate (const psImage *input, float x, float y, psC64 unexposedValue, psImageInterpolateMode mode);
    25452569\end{verbatim}
    25462570Perform interpolation of image pixel values to the given fractional
     
    32243248\subsubsection{Metadata Representation}
    32253249
     3250\begin{figure}
     3251\psfig{file=Metadata.ps,width=6.5in}
     3252\caption{Metadata Structures\label{fig:metadata}}
     3253\end{figure}
     3254
    32263255This section addresses the question of how \PS{} metadata should be
    32273256represented in memory, not how it should be represented on disk.
     
    32333262    char *restrict name;                ///< Name of item
    32343263    psMetadataType type;                ///< type of this item
    3235     psMetadataFlags flags;              ///< flags associated with this item
    32363264    const union {
    32373265        psS32 S32;                      ///< integer value
     
    32473275The \code{id} is a unique identifier for this item of metadata;
    32483276experience shows that such tags are useful.  The entry \code{name}
    3249 specifies the name of the metadata item.  Metadata naming conventions
    3250 for the Pan-STARRS IPP are specified in the IPP Software Requirements
    3251 Specification (PSDC-430-005).  The value of the metadata is given by
    3252 the union \code{data}, and may be of type \code{psS32}, \code{psF32},
    3253 \code{psF64}, or an arbitrary rich structure pointed at by the
    3254 \code{void} pointer \code{void}.  A character string comment
     3277specifies the name of the metadata item.  The value of the metadata is
     3278given by the union \code{data}, and may be of type \code{psS32},
     3279\code{psF32}, \code{psF64}, or an arbitrary rich structure pointed at
     3280by the \code{void} pointer \code{void}.  A character string comment
    32553281associated with this metadata item may be stored in the element
    32563282\code{comment}. The \code{type} entry specifies the type of the data
     
    32713297} psMetadataType;
    32723298\end{verbatim}
    3273 The \code{flags} entry specifies some optional characteristics of the
    3274 metadata type, given by the enumerated type \code{psMetadataFlags}:
    3275 \begin{verbatim}
    3276 typedef enum {
    3277     PS_META_TYPE_MASK =     0xffff,     ///< the type enum must fit in this mask
    3278     PS_META_UNIQUE =       0x10000,     ///< the name must be unique (default)
    3279     PS_META_NON_UNIQUE =   0x20000,     ///< the name may be repeated
    3280 } psMetadataFlags;
    3281 \end{verbatim}
    32823299
    32833300A collection of metadata is represented by the \code{psMetadata} structure:
     
    32993316Certain metadata names (such as the FITS keywords \code{COMMENT} and
    33003317\code{HISTORY} in a FITS header) may be repeated with different
    3301 values.  The \code{psMetadataAdd} routine is required to check that
    3302 all metadata names are unique unless the type is qualified as
    3303 \code{PS_META_NON_UNIQUE}; in this case a unique integer must be added
    3304 to each name specified.
     3318values.  In such a case, the \code{psMetadata.list} structure contains
     3319the entries in their original sequence with duplicate keys.  The
     3320\code{psMetadata.hash} entries, which are required to have unique
     3321keys, would have a single entry with the keyword of the repeated key,
     3322with the value of \code{psMetadataType} set to
     3323\code{PS_META_ITEM_SET}, and the \code{psMetadataItem.items} element
     3324pointing to a \code{psList} pointing to the actual entries.  If
     3325\code{psMetadataItemAlloc} is called with the type set to
     3326\code{PS_META_ITEM_SET}, such a repeated key is created.  If the data
     3327value passed to \code{psMetadataItemAlloc} (the quantity in ellipsis)
     3328is \code{NULL}, then an empty \code{psMetadataItem} with the given
     3329keyword is created to hold future entries of that keyword.
     3330
     3331The \code{psMetadataAdd} routine is required to check that all
     3332metadata names are unique unless the type is already qualified as
     3333\code{PS_META_NON_UNIQUE}; in this case the data are added to the
     3334corresponding \code{psMetadataItem.items} list.
    33053335
    33063336\subsubsection{Metadata APIs}
    3307 
    3308 In this section, we explain the metadata APIs more fully.
    33093337
    33103338The allocator for \code{psMetadataItem} returns a full
     
    33153343optional flags, is constructed by bit-wise or'ing the appropriate type
    33163344and flag.  The \code{comment} entry is a fixed string which is used
    3317 for the comment associated with this metadata item.  The arguments to
    3318 the \code{name} formatting codes and the metadata data itself are
    3319 passed to \code{psMetadataItemAlloc} as arguments following the
    3320 comment string.  The data must be a pointer for any data types which
    3321 are stored in the element \code{data.void}, while other data types are
    3322 passed as numeric values.  The argument list must be interpreted
    3323 appropriately by the \code{va_list} operators in the function.   
    3324 \begin{verbatim}
    3325 psMetadataItem *psMetadataItemAlloc(const char *name, int format, const char *comment, ...);
    3326 psMetadataItem *psMetadataItemAllocV(const char *name, int format, const char *comment, va_list list);
     3345for the comment associated with this metadata item.  The metadata data
     3346and the arguments to the \code{name} formatting codes are passed, in
     3347that order (metadata pointer first), to \code{psMetadataItemAlloc} as
     3348arguments following the comment string.  The data must be a pointer
     3349for any data types which are stored in the element \code{data.void},
     3350while other data types are passed as numeric values.  The argument
     3351list must be interpreted appropriately by the \code{va_list} operators
     3352in the function.
     3353\begin{verbatim}
     3354psMetadataItem *psMetadataItemAlloc(const char *name, psMetadataType type, const char *comment, ...);
     3355psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, const char *comment, va_list list);
    33273356\end{verbatim}
    33283357
Note: See TracChangeset for help on using the changeset viewer.