Changeset 1568
- Timestamp:
- Aug 18, 2004, 3:04:08 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r1567 r1568 1 %%% $Id: psLibSDRS.tex,v 1.7 8 2004-08-19 00:26:42 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.79 2004-08-19 01:04:08 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 381 381 382 382 \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} 383 void p_psMemSetDeallocator(void* ptr, psFreeFcn freeFcn); 384 psFreeFcn p_psMemGetDeallocator(void* ptr); 385 \end{verbatim} 386 387 A free function handles any deallocation procedures of an object 388 referred to by a pointer, excluding the freeing of the memory block of 389 the pointer reference itself. If the pointer refers to an object that 390 references other memory blocks this free function would insure the 391 freeing of any encapsulated memory block references. For example, 392 \code{psList} references a series of node objects of a linked list, so 393 its free function would free these node objects and the node object's 394 free function would free the data element references they may contain. 395 396 The fucntion \code{p_psSetFreeFcn} is used to associated a free 397 function to a memory block, while \code{p_psGetFreeFcn} retrieves the 398 last free function set. To remove a free function from a memory 399 block, the \code{psSetFreeFcn} should be invoked with \code{NULL}. If 400 no free function is set, \code{p_psGetFreeFcn} shall return 401 \code{NULL}. 392 402 393 403 \subsubsection{Callback Routines} … … 497 507 typedef long (*psMemFreeCallback)(const psMemBlock *ptr); 498 508 psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func); 499 longpsMemGetId(void);509 psMemoryId psMemGetId(void); 500 510 \end{verbatim} 501 511 % … … 573 583 % 574 584 \begin{verbatim} 575 int psMemGetRefCounter(void *vptr);585 psReferenceCount psMemGetRefCounter(void *vptr); 576 586 void *psMemIncrRefCounter(void *vptr); 577 587 void *psMemDecrRefCounter(void *vptr); … … 1284 1294 } data; 1285 1295 const struct psImage *parent; ///< parent, if a subimage 1286 int Nchildren; ///< number of subimages1287 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) 1288 1298 } psImage; 1289 1299 \end{verbatim} … … 1302 1312 starting column number in the parent image while \code{y0} is the 1303 1313 starting row number. The structure may include references to 1304 subrasters (\code{children, Nchildren}) and/or to a containing array1314 subrasters (\code{children, nChildren}) and/or to a containing array 1305 1315 (\code{parent}). Unless this image is a child of another image 1306 1316 (represents a subset of the pixels of another image), the image data … … 2335 2345 Create a copy of the specified image, converting the type in the 2336 2346 process. 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}. 2347 result in the specified structure. The output image data must be 2348 allocated as a single, contiguous block of memory. The output image 2349 may not be the input image. This function must be defined for the 2350 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2351 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2344 2352 2345 2353 \begin{verbatim} … … 2363 2371 } psImageCutDirection; 2364 2372 2365 psVector *psImageSlice(psVector *out, const psImage *input, 2373 psVector *psImageSlice(psVector *out, 2374 psVector *coords, 2375 const psImage *restrict input, 2366 2376 const psImage *restrict mask, 2367 2377 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); 2370 2384 \end{verbatim} 2371 2385 Extract pixels from rectlinear region to a vector (array of floats). … … 2376 2390 output vectors is derived from the statistics of the pixels at that 2377 2391 direction 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}. 2392 value is specified by \code{stats}. If \code{coords} is not 2393 \code{NULL}, the calculated coordinates along the slice are returned 2394 in this vector. Only one of the statistics choices may be specified, 2395 otherwise the function must return an error. This function must be 2396 defined for the following types: \code{psS8}, \code{psU16}, 2397 \code{psF32}, \code{psF64}. 2382 2398 2383 2399 \begin{verbatim} … … 2422 2438 2423 2439 \subsubsection{Image Geometry Manipulation} 2440 2441 Several functions which manipulate the image geometry require the 2442 specification of the interpolation scheme to be used. This 2443 information is carried by the following enum: 2444 \begin{verbatim} 2445 typedef enum { 2446 PS_INTERPOLATE_FLAT, 2447 PS_INTERPOLATE_BILINEAR, 2448 PS_INTERPOLATE_BICUBIC, 2449 PS_INTERPOLATE_SINC 2450 } psImageInterpolateMode mode; 2451 \end{verbatim} 2424 2452 2425 2453 \begin{verbatim} … … 2447 2475 \begin{verbatim} 2448 2476 psImage *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); 2456 2478 \end{verbatim} 2457 2479 Resample image to new scale. A new image is constructed in which the … … 2463 2485 2464 2486 \begin{verbatim} 2465 psImage *psImageRotate(psImage *out, const psImage *input, float angle, float exposed);2487 psImage *psImageRotate(psImage *out, const psImage *input, float angle, psC64 exposed, psImageInterpolateMode mode); 2466 2488 \end{verbatim} 2467 2489 Rotate the input image by given angle, specified in degrees. The 2468 2490 output image must contain all of the pixels from the input image in 2469 2491 their 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 is2471 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{ps C32}, \code{psC64}.2492 pixels should be set to \code{exposed}, cast to the same type as the 2493 image. The center of rotation is always the center pixel of the 2494 image. The rotation is specified in the sense that a positive angle 2495 is an anti-clockwise rotation. This function must be defined for the 2496 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2497 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2476 2498 2477 2499 \begin{verbatim} 2478 2500 psImage *psImageShift(psImage *out, const psImage *input, 2479 float dx, float dy, float exposed);2501 float dx, float dy, psC64 exposed, psImageInterpolateMode mode); 2480 2502 \end{verbatim} 2481 2503 Shift image by an arbitrary number of pixels (\code{dx,dy}) in either … … 2484 2506 image has the same dimensions as the input image. Pixels which fall 2485 2507 off the edge of the output image are lost. Newly exposed pixels are 2486 set to the value given by \code{exposed} . This function must be2487 defined for the following types: \code{psU8}, \code{psU16}, 2488 \code{ps S8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},2489 \code{ps C64}.2508 set to the value given by \code{exposed}, cast to the same type as the 2509 image. 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}. 2490 2512 2491 2513 \begin{verbatim} … … 2541 2563 following types: \code{psS8}, \code{psU16}, \code{psF32}, \code{psF64}. 2542 2564 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} 2568 psF64 psImagePixelInterpolate (const psImage *input, float x, float y, psC64 unexposedValue, psImageInterpolateMode mode); 2545 2569 \end{verbatim} 2546 2570 Perform interpolation of image pixel values to the given fractional … … 3224 3248 \subsubsection{Metadata Representation} 3225 3249 3250 \begin{figure} 3251 \psfig{file=Metadata.ps,width=6.5in} 3252 \caption{Metadata Structures\label{fig:metadata}} 3253 \end{figure} 3254 3226 3255 This section addresses the question of how \PS{} metadata should be 3227 3256 represented in memory, not how it should be represented on disk. … … 3233 3262 char *restrict name; ///< Name of item 3234 3263 psMetadataType type; ///< type of this item 3235 psMetadataFlags flags; ///< flags associated with this item3236 3264 const union { 3237 3265 psS32 S32; ///< integer value … … 3247 3275 The \code{id} is a unique identifier for this item of metadata; 3248 3276 experience 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 3277 specifies the name of the metadata item. The value of the metadata is 3278 given by the union \code{data}, and may be of type \code{psS32}, 3279 \code{psF32}, \code{psF64}, or an arbitrary rich structure pointed at 3280 by the \code{void} pointer \code{void}. A character string comment 3255 3281 associated with this metadata item may be stored in the element 3256 3282 \code{comment}. The \code{type} entry specifies the type of the data … … 3271 3297 } psMetadataType; 3272 3298 \end{verbatim} 3273 The \code{flags} entry specifies some optional characteristics of the3274 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 mask3278 PS_META_UNIQUE = 0x10000, ///< the name must be unique (default)3279 PS_META_NON_UNIQUE = 0x20000, ///< the name may be repeated3280 } psMetadataFlags;3281 \end{verbatim}3282 3299 3283 3300 A collection of metadata is represented by the \code{psMetadata} structure: … … 3299 3316 Certain metadata names (such as the FITS keywords \code{COMMENT} and 3300 3317 \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. 3318 values. In such a case, the \code{psMetadata.list} structure contains 3319 the entries in their original sequence with duplicate keys. The 3320 \code{psMetadata.hash} entries, which are required to have unique 3321 keys, would have a single entry with the keyword of the repeated key, 3322 with the value of \code{psMetadataType} set to 3323 \code{PS_META_ITEM_SET}, and the \code{psMetadataItem.items} element 3324 pointing 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 3327 value passed to \code{psMetadataItemAlloc} (the quantity in ellipsis) 3328 is \code{NULL}, then an empty \code{psMetadataItem} with the given 3329 keyword is created to hold future entries of that keyword. 3330 3331 The \code{psMetadataAdd} routine is required to check that all 3332 metadata 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 3334 corresponding \code{psMetadataItem.items} list. 3305 3335 3306 3336 \subsubsection{Metadata APIs} 3307 3308 In this section, we explain the metadata APIs more fully.3309 3337 3310 3338 The allocator for \code{psMetadataItem} returns a full … … 3315 3343 optional flags, is constructed by bit-wise or'ing the appropriate type 3316 3344 and 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); 3345 for the comment associated with this metadata item. The metadata data 3346 and the arguments to the \code{name} formatting codes are passed, in 3347 that order (metadata pointer first), to \code{psMetadataItemAlloc} as 3348 arguments following the comment string. The data must be a pointer 3349 for any data types which are stored in the element \code{data.void}, 3350 while other data types are passed as numeric values. The argument 3351 list must be interpreted appropriately by the \code{va_list} operators 3352 in the function. 3353 \begin{verbatim} 3354 psMetadataItem *psMetadataItemAlloc(const char *name, psMetadataType type, const char *comment, ...); 3355 psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, const char *comment, va_list list); 3327 3356 \end{verbatim} 3328 3357
Note:
See TracChangeset
for help on using the changeset viewer.
