Data Containers


Files

file  psType.h
 Contains support for basic types.

Data Structures

struct  psMathType
 The type of a data type. More...
struct  psMath
 The type of a basic data type. More...
struct  psArray
 An array to support primitive types. More...
struct  psBitSet
 Struct containing array of bytes to hold bit data and corresponding array length. More...
struct  psHashBucket
 A bucket that holds an item of data. More...
struct  psHash
 The hash-table itself. More...
struct  psListElem
 Doubly-linked list element. More...
struct  psList
 The psList Linked list structure. More...
struct  psListIterator
 The psList iterator structure. More...
struct  psLookupTable
 Lookup table structure. More...
struct  psMetadata
 Metadata data structure. More...
struct  psMetadataIterator
 Metadata iterator. More...
struct  psMetadataItem
 Metadata item data structure. More...
struct  psPixelCoord
 Data structure for storing psPixel coordinates. More...
struct  psPixels
 list of pixel coordinates More...

Defines

#define PS_TYPE_MASK   PS_TYPE_U8
 the psElemType to use for mask image
#define PS_TYPE_MASK_DATA   U8
 the data member to use for mask image
#define PS_TYPE_MASK_NAME   "psU8"
 the data type for mask as a string
#define PS_MIN_S8   INT8_MIN
 minimum valid psS8 value
#define PS_MIN_S16   INT16_MIN
 minimum valid psS16 value
#define PS_MIN_S32   INT32_MIN
 minimum valid psS32 value
#define PS_MIN_S64   INT64_MIN
 minimum valid psS64 value
#define PS_MIN_U8   0
 minimum valid psU8 value
#define PS_MIN_U16   0
 minimum valid psU16 value
#define PS_MIN_U32   0
 minimum valid psU32 value
#define PS_MIN_U64   0
 minimum valid psU64 value
#define PS_MIN_F32   -FLT_MAX
 minimum valid psF32 value
#define PS_MIN_F64   -DBL_MAX
 minimum valid psF64 value
#define PS_MIN_C32   -FLT_MAX
 minimum valid real or imaginary psC32 value
#define PS_MIN_C64   -DBL_MAX
 minimum valid real or imaginary psC32 value
#define PS_MAX_S8   INT8_MAX
 maximum valid psS8 value
#define PS_MAX_S16   INT16_MAX
 maximum valid psS16 value
#define PS_MAX_S32   INT32_MAX
 maximum valid psS32 value
#define PS_MAX_S64   INT64_MAX
 maximum valid psS64 value
#define PS_MAX_U8   UINT8_MAX
 maximum valid psU8 value
#define PS_MAX_U16   UINT16_MAX
 maximum valid psU16 value
#define PS_MAX_U32   UINT32_MAX
 maximum valid psU32 value
#define PS_MAX_U64   UINT64_MAX
 maximum valid psU64 value
#define PS_MAX_F32   FLT_MAX
 maximum valid psF32 value
#define PS_MAX_F64   DBL_MAX
 maximum valid psF64 value
#define PS_MAX_C32   FLT_MAX
 maximum valid real or imaginary psC32 value
#define PS_MAX_C64   DBL_MAX
 maximum valid real or imaginary psC32 value
#define PS_TYPE_BOOL_NAME   "psBool"
#define PS_TYPE_S8_NAME   "psS8"
#define PS_TYPE_S16_NAME   "psS16"
#define PS_TYPE_S32_NAME   "psS32"
#define PS_TYPE_S64_NAME   "psS64"
#define PS_TYPE_U8_NAME   "psU8"
#define PS_TYPE_U16_NAME   "psU16"
#define PS_TYPE_U32_NAME   "psU32"
#define PS_TYPE_U64_NAME   "psU64"
#define PS_TYPE_F32_NAME   "psF32"
#define PS_TYPE_F64_NAME   "psF64"
#define PS_TYPE_C32_NAME   "psC32"
#define PS_TYPE_C64_NAME   "psC64"
#define PS_TYPE_NAME(value, type)
#define PS_BADPIXEL_BITMASK   0x0f
 Macro to get the bad pixel reason code (stored as part of mask value).
#define PS_GET_BADPIXEL(maskValue)   (maskValue & PS_BADPIXEL_BITMASK)
#define PS_IS_BADPIXEL(maskValue)   (PS_GET_BADPIXEL(maskValue) != 0)
#define PS_SET_BADPIXEL(maskValue, reasonCode)
 Macro to apply a bad pixel reason code to mask image.
#define PS_IS_PSELEMTYPE_INT(x)   ((x & 0x100) == 0x100)
 Macro to determine if the psElemType is an integer.
#define PS_IS_PSELEMTYPE_UNSIGNED(x)   ((x & 0x200) == 0x200)
 Macro to determine if the psElemType is unsigned.
#define PS_IS_PSELEMTYPE_REAL(x)   ((x & 0x400) == 0x400)
 Macro to determine if the psElemType is a real (non-complex) floating-point type.
#define PS_IS_PSELEMTYPE_COMPLEX(x)   ((x & 0x800) == 0x800)
 Macro to determine if the psElemType is complex number type.
#define PS_IS_PSELEMTYPE_BOOL(x)   ((x & 0x1000) == 0x1000)
 Macro to determine if the psElemType is boolean type.
#define PSELEMTYPE_SIZEOF(x)   (x & 0xFF)
 Macro to determine the storage size, in bytes, of the psElemType.
#define P_PSARRAY_SET_NALLOC(vec, n)   *(long*)&vec->nalloc = n
#define PS_ASSERT_ARRAY_NON_NULL(NAME, RETURNVAL)   PS_ASSERT_GENERAL_ARRAY_NON_NULL(NAME, return RETURNVAL)
#define PS_ASSERT_GENERAL_ARRAY_NON_NULL(NAME, CLEANUP)
#define PS_ASSERT_ARRAY_NON_EMPTY(NAME, RETURNVAL)   PS_ASSERT_GENERAL_ARRAY_NON_EMPTY(NAME, return RETURNVAL)
#define PS_ASSERT_GENERAL_ARRAY_NON_EMPTY(NAME, CLEANUP)
#define PS_ASSERT_ARRAYS_SIZE_EQUAL(ARRAY1, ARRAY2, RVAL)
#define PS_ASSERT_ARRAY_SIZE(ARRAY, SIZE, RVAL)
#define PS_DATA_IS_PRIMITIVE(TYPE)
#define PS_DATA_PRIMITIVE_TYPE(DATATYPE)
#define PS_METADATA_FLAGS_MASK   0xFF000000
#define PS_METADATA_TYPE_MASK   0x00FFFFFF
#define PS_ASSERT_METADATA_NON_NULL(NAME, RVAL)
 Assert on metadata with extant hash and list components.
#define P_PSPIXELS_SET_NALLOC(pix, n)   *(long*)&pix->nalloc = n

Typedefs

typedef uint8_t psU8
 Basic data types used by the containers. 8-bit unsigned int.
typedef uint16_t psU16
 16-bit unsigned int
typedef uint32_t psU32
 32-bit unsigned int
typedef uint64_t psU64
 64-bit unsigned int
typedef int8_t psS8
 8-bit signed int
typedef int16_t psS16
 16-bit signed int
typedef int32_t psS32
 32-bit signed int
typedef int64_t psS64
 64-bit signed int
typedef float psF32
 32-bit floating point
typedef double psF64
 64-bit floating point
typedef float complex psC32
 complex with 32-bit floating point Real and Imagary numbers
typedef double complex psC64
 complex with 64-bit floating point Real and Imagary numbers
typedef char * psString
 string value
typedef void * psPtr
 void pointer
typedef bool psBool
 boolean value
typedef psU8 psMaskType
 the C datatype for a mask image
typedef psBool psBOOL
 allow psBOOL to be used instead of psBool (for macros)

Enumerations

enum  psElemType {
  PS_TYPE_S8 = 0x0101, PS_TYPE_S16 = 0x0102, PS_TYPE_S32 = 0x0104, PS_TYPE_S64 = 0x0108, PS_TYPE_U8 = 0x0301, PS_TYPE_U16 = 0x0302, PS_TYPE_U32 = 0x0304, PS_TYPE_U64 = 0x0308, PS_TYPE_F32 = 0x0404, PS_TYPE_F64 = 0x0408,
  PS_TYPE_C32 = 0x0808, PS_TYPE_C64 = 0x0810, PS_TYPE_BOOL = 0x1301
}
 Enumeration of data types for function elements. More...
enum  psDataType {
  PS_DATA_S8 = PS_TYPE_S8, PS_DATA_S16 = PS_TYPE_S16, PS_DATA_S32 = PS_TYPE_S32, PS_DATA_S64 = PS_TYPE_S64, PS_DATA_U8 = PS_TYPE_U8, PS_DATA_U16 = PS_TYPE_U16, PS_DATA_U32 = PS_TYPE_U32, PS_DATA_U64 = PS_TYPE_U64, PS_DATA_F32 = PS_TYPE_F32, PS_DATA_F64 = PS_TYPE_F64,
  PS_DATA_BOOL = PS_TYPE_BOOL, PS_DATA_STRING = 0x10000, PS_DATA_ARRAY, PS_DATA_BITSET, PS_DATA_CUBE, PS_DATA_FITS, PS_DATA_HASH, PS_DATA_HISTOGRAM, PS_DATA_IMAGE, PS_DATA_KERNEL,
  PS_DATA_LINE, PS_DATA_LIST, PS_DATA_LOOKUPTABLE, PS_DATA_METADATA, PS_DATA_METADATAITEM, PS_DATA_MINIMIZATION, PS_DATA_PIXELS, PS_DATA_PLANE, PS_DATA_PLANEDISTORT, PS_DATA_PLANETRANSFORM,
  PS_DATA_POLYNOMIAL1D, PS_DATA_POLYNOMIAL2D, PS_DATA_POLYNOMIAL3D, PS_DATA_POLYNOMIAL4D, PS_DATA_PROJECTION, PS_DATA_REGION, PS_DATA_SCALAR, PS_DATA_SPHERE, PS_DATA_SPHEREROT, PS_DATA_SPLINE1D,
  PS_DATA_STATS, PS_DATA_TIME, PS_DATA_VECTOR, PS_DATA_UNKNOWN, PS_DATA_METADATA_MULTI
}
 Enumeration primarily used with metadata which defines a data structure e.g., list, array, FITS file, etc. More...
enum  psDimen { PS_DIMEN_SCALAR, PS_DIMEN_VECTOR, PS_DIMEN_TRANSV, PS_DIMEN_IMAGE, PS_DIMEN_OTHER }
 Dimensions of a data type. More...
enum  { PS_LIST_HEAD = 0, PS_LIST_TAIL = -1 }
 Special values of index into list. More...
enum  psLookupStatusType { PS_LOOKUP_SUCCESS = 0x0000, PS_LOOKUP_PAST_TOP = 0x0101, PS_LOOKUP_PAST_BOTTOM = 0x0102, PS_LOOKUP_ERROR = 0x0104 }
 Lookup table lookup status and error conditions. More...
enum  psParseErrorType { PS_PARSE_SUCCESS = 0x0000, PS_PARSE_ERROR_TYPE = 0x0101, PS_PARSE_ERROR_VALUE = 0x0102, PS_PARSE_ERROR_GENERAL = 0x0104 }
 Lookup table parse status and error conditions. More...
enum  psMetadataFlags { PS_META_DEFAULT = 0, PS_META_REPLACE = 0x1000000, PS_META_NO_REPLACE = 0x2000000, PS_META_DUPLICATE_OK = 0x4000000, PS_META_NULL = 0x8000000 }
 Option flags for psMetadata functions. More...

Functions

bool psMemCheckType (psDataType type, psPtr ptr)
 Checks the deallocator to see if the pointer matches the desired datatype.
bool psMemCheckArray (psPtr ptr)
 Checks the type of a particular pointer.
psArraypsArrayAlloc (long nalloc)
 Allocate an array, set the length to the number of allocated elements.
psArraypsArrayAllocEmpty (long nalloc)
 Allocate an array, set the length to zero.
psArraypsArrayRealloc (psArray *array, long nalloc)
 Reallocate an array.
psArraypsArrayAdd (psArray *array, long delta, psPtr data)
 Add an element to the end the array, expanding the array storage if necessary.
bool psArrayRemoveData (psArray *array, const psPtr data)
 Remove an element from the array by it's pointer.
bool psArrayRemoveIndex (psArray *array, long index)
 Remove an element from the array.
void psArrayElementsFree (psArray *array)
 Deallocate/Dereference elements of an array.
psArraypsArraySort (psArray *array, psComparePtrFunc func)
 Sort the array according to an external compare function.
bool psArraySet (psArray *array, long position, psPtr data)
 Set an element in the array.
psPtr psArrayGet (const psArray *array, long position)
 Get an element from the array.
long psArrayLength (const psArray *array)
 Get the number of elements in use from a specified psArray.
bool psMemCheckBitSet (psPtr ptr)
 Checks the type of a particular pointer.
psBitSetpsBitSetAlloc (long nalloc)
 Allocate a psBitSet.
psBitSetpsBitSetSet (psBitSet *bitSet, long bit)
 Set a bit.
psBitSetpsBitSetClear (psBitSet *bitSet, long bit)
 Clear a bit.
bool psBitSetTest (const psBitSet *bitSet, long bit)
 Test the value of a bit.
psBitSetpsBitSetOp (psBitSet *outBitSet, const psBitSet *inBitSet1, const char *operator, const psBitSet *inBitSet2)
 Perform a binary operation on two psBitSets.
psBitSetpsBitSetNot (psBitSet *outBitSet, const psBitSet *inBitSet)
 Perform a not operation on a psBitSet.
psString psBitSetToString (const psBitSet *bitSet)
 Convert the psBitSet to a string of ones and zeros.
bool psMemCheckHash (psPtr ptr)
 Checks the type of a particular pointer.
psHashpsHashAlloc (long nalloc)
 Allocate hash buckets in table.
bool psHashAdd (psHash *hash, const char *key, psPtr data)
 Insert entry into table.
psPtr psHashLookup (const psHash *hash, const char *key)
 Lookup key in table.
bool psHashRemove (psHash *hash, const char *key)
 Remove key from table.
psListpsHashKeyList (const psHash *hash)
 List all keys in table.
psArraypsHashToArray (const psHash *hash)
 Create a psArray from a psHash contents.
bool psMemCheckList (psPtr ptr)
 Checks the type of a particular pointer.
psListpsListAlloc (psPtr data)
 Creates a psList linked list object.
psListIteratorpsListIteratorAlloc (psList *list, long location, bool mutable)
 Creates a psListIterator object and associates it with a psList.
bool psListIteratorSet (psListIterator *iterator, long location)
 Set the iterator of the list to a given position.
bool psListAdd (psList *list, long location, psPtr data)
 Adds an element to a psList at position given.
bool psListAddAfter (psListIterator *iterator, psPtr data)
 Adds an data item to a psList at position just after the list position given.
bool psListAddBefore (psListIterator *iterator, psPtr data)
 Adds a data item to a psList at position just before the list position given.
bool psListRemove (psList *list, long location)
 Remove an item at the specified location from a list.
bool psListRemoveData (psList *list, psPtr data)
 Remove an item from a list.
psPtr psListGet (psList *list, long location)
 Retrieve an item from a list.
psPtr psListGetAndIncrement (psListIterator *iterator)
 Position the specified iterator to the next item in list.
psPtr psListGetAndDecrement (psListIterator *iterator)
 Position the specified iterator to the previous item in list.
psArraypsListToArray (const psList *list)
 Convert a linked list to an array.
psListpsArrayToList (const psArray *array)
 Convert array to a doubly-linked list.
psListpsListSort (psList *list, psComparePtrFunc func)
 Sort a list via a comparison function.
long psListLength (const psList *list)
 Get the number of elements in use from a specified psList.
bool psMemCheckLookupTable (psPtr ptr)
 Checks the type of a particular pointer.
psLookupTablepsLookupTableAlloc (const char *filename, const char *format, long indexCol)
 Allocator for psLookupTable struct.
psArraypsVectorsReadFromFile (const char *filename, const char *format)
 Read vectors from file.
psLookupTablepsLookupTableImport (psLookupTable *table, const psArray *vectors, long indexCol)
 Import arrays of vectors into a table.
long psLookupTableRead (psLookupTable *table)
 Read lookup table.
double psLookupTableInterpolate (const psLookupTable *table, double index, long column)
 Lookup and interpolate value from table.
psVectorpsLookupTableInterpolateAll (const psLookupTable *table, double index)
 Lookup and interpolate all values from table.
psMetadataItempsMetadataItemAlloc (const char *name, psDataType type, const char *comment,...)
 Create a metadata item.
bool psMemCheckMetadataItem (psPtr ptr)
 Checks the type of a particular pointer.
psMetadataItempsMetadataItemAllocStr (const char *name, const char *comment, const char *value)
 Create a metadata item with specified string data.
psMetadataItempsMetadataItemAllocF32 (const char *name, const char *comment, psF32 value)
 Create a metadata item with specified psF32 data.
psMetadataItempsMetadataItemAllocF64 (const char *name, const char *comment, psF64 value)
 Create a metadata item with specified psF64 data.
psMetadataItempsMetadataItemAllocS8 (const char *name, const char *comment, psS8 value)
 Create a metadata item with specified psS8 data.
psMetadataItempsMetadataItemAllocS16 (const char *name, const char *comment, psS16 value)
 Create a metadata item with specified psS16 data.
psMetadataItempsMetadataItemAllocS32 (const char *name, const char *comment, psS32 value)
 Create a metadata item with specified psS32 data.
psMetadataItempsMetadataItemAllocS64 (const char *name, const char *comment, psS64 value)
 Create a metadata item with specified psS64 data.
psMetadataItempsMetadataItemAllocU8 (const char *name, const char *comment, psU8 value)
 Create a metadata item with specified psU8 data.
psMetadataItempsMetadataItemAllocU16 (const char *name, const char *comment, psU16 value)
 Create a metadata item with specified psU16 data.
psMetadataItempsMetadataItemAllocU32 (const char *name, const char *comment, psU32 value)
 Create a metadata item with specified psU32 data.
psMetadataItempsMetadataItemAllocU64 (const char *name, const char *comment, psU64 value)
 Create a metadata item with specified psU64 data.
psMetadataItempsMetadataItemAllocBool (const char *name, const char *comment, bool value)
 Create a metadata item with specified psBool data.
psMetadataItempsMetadataItemAllocPtr (const char *name, psDataType type, const char *comment, psPtr value)
 Create a metadata item with specified psPtr data.
psMetadataItempsMetadataItemAllocV (const char *name, psDataType type, const char *comment, va_list list)
 Create a metadata item with va_list.
psMetadatapsMetadataAlloc (void)
 Create a metadata collection.
bool psMemCheckMetadata (psPtr ptr)
 Checks the type of a particular pointer.
psMetadataItempsMetadataItemCopy (const psMetadataItem *in)
 Creates a new copy of a psMetadataItem.
psMetadatapsMetadataCopy (psMetadata *out, const psMetadata *in)
 Create a copy of an existing psMetadata collection.
bool psMetadataItemTransfer (psMetadata *out, const psMetadata *in, const char *key)
 Copy a metadata item from one psMetadata to another.
bool psMetadataAddItem (psMetadata *md, const psMetadataItem *item, int location, psS32 flags)
 Add existing metadata item to metadata collection.
bool psMetadataAdd (psMetadata *md, long location, const char *name, int format, const char *comment,...)
 Create and add a metadata item to metadata collection.
bool psMetadataAddV (psMetadata *md, long location, const char *name, int format, const char *comment, va_list list)
 Create and add a metadata item to metadata collection.
bool psMetadataAddBool (psMetadata *md, long location, const char *name, int format, const char *comment, bool value)
 Add a psBool value to metadata collection.
bool psMetadataAddS8 (psMetadata *md, long location, const char *name, int format, const char *comment, psS8 value)
 Add a psS8 value to metadata collection.
bool psMetadataAddS16 (psMetadata *md, long location, const char *name, int format, const char *comment, psS16 value)
 Add a psS16 value to metadata collection.
bool psMetadataAddS32 (psMetadata *md, long location, const char *name, int format, const char *comment, psS32 value)
 Add a psS32 value to metadata collection.
bool psMetadataAddS64 (psMetadata *md, long location, const char *name, int format, const char *comment, psS64 value)
 Add a psS64 value to metadata collection.
bool psMetadataAddU8 (psMetadata *md, long location, const char *name, int format, const char *comment, psU8 value)
 Add a psU8 value to metadata collection.
bool psMetadataAddU16 (psMetadata *md, long location, const char *name, int format, const char *comment, psU16 value)
 Add a psU16 value to metadata collection.
bool psMetadataAddU32 (psMetadata *md, long location, const char *name, int format, const char *comment, psU32 value)
 Add a psU32 value to metadata collection.
bool psMetadataAddU64 (psMetadata *md, long location, const char *name, int format, const char *comment, psU64 value)
 Add a psU64 value to metadata collection.
bool psMetadataAddF32 (psMetadata *md, long location, const char *name, int format, const char *comment, psF32 value)
 Add a psF32 value to metadata collection.
bool psMetadataAddF64 (psMetadata *md, long location, const char *name, int format, const char *comment, psF64 value)
 Add a psF64 value to metadata collection.
bool psMetadataAddList (psMetadata *md, long location, const char *name, int format, const char *comment, psList *value)
 Add a psList to metadata collection.
bool psMetadataAddStr (psMetadata *md, long location, const char *name, int format, const char *comment, const char *value)
 Add a string to metadata collection.
bool psMetadataAddVector (psMetadata *md, long location, const char *name, int format, const char *comment, psVector *value)
 Add a vector to metadata collection.
bool psMetadataAddArray (psMetadata *md, long location, const char *name, int format, const char *comment, psArray *value)
 Add a array to metadata collection.
bool psMetadataAddImage (psMetadata *md, long location, const char *name, int format, const char *comment, psImage *value)
 Add an Image to metadata collection.
bool psMetadataAddTime (psMetadata *md, long location, const char *name, int format, const char *comment, psTime *value)
 Add a Time to metadata collection.
bool psMetadataAddHash (psMetadata *md, long location, const char *name, int format, const char *comment, psHash *value)
 Add a Hash to metadata collection.
bool psMetadataAddLookupTable (psMetadata *md, long location, const char *name, int format, const char *comment, psLookupTable *value)
 Add a LookupTable to metadata collection.
bool psMetadataAddUnknown (psMetadata *md, long location, const char *name, int format, const char *comment, psPtr value)
 Add an Unknown (psPtr) to metadata collection.
bool psMetadataAddPtr (psMetadata *md, long location, const char *name, psDataType type, const char *comment, psPtr value)
 Add a psPtr to metadata collection.
bool psMetadataAddMetadata (psMetadata *md, long location, const char *name, int format, const char *comment, psMetadata *value)
 Add Metadata to metadata collection.
bool psMetadataRemoveKey (psMetadata *md, const char *key)
 Removes an item from metadata by key name.
bool psMetadataRemoveIndex (psMetadata *md, long location)
 Removes an item from metadata by index number.
psMetadataItempsMetadataLookup (const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name.
psF64 psMetadataLookupF64 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its double precision value.
psF32 psMetadataLookupF32 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its single precision value.
psS8 psMetadataLookupS8 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psS16 psMetadataLookupS16 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psS32 psMetadataLookupS32 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psS64 psMetadataLookupS64 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psU8 psMetadataLookupU8 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psU16 psMetadataLookupU16 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psU32 psMetadataLookupU32 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psU64 psMetadataLookupU64 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
bool psMetadataLookupBool (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its boolean value.
psPtr psMetadataLookupPtr (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psMetadataItempsMetadataGet (const psMetadata *md, int location)
 Find an item in the metadata collection based on list index.
psMetadataIteratorpsMetadataIteratorAlloc (const psMetadata *md, long location, const char *regex)
 Creates a psMetadataIterator to iterate over the specified psMetadata.
bool psMetadataIteratorSet (psMetadataIterator *iterator, long location)
 Set the iterator of the psMetadat to a given position.
psMetadataItempsMetadataGetAndIncrement (psMetadataIterator *iterator)
 Position the specified iterator to the next matching item in psMetadata, given the regular expression of the iterator.
psMetadataItempsMetadataGetAndDecrement (psMetadataIterator *iterator)
 Position the specified iterator to the previous matching item in psMetadata, given the regular expression of the iterator.
psMetadatapsMetadataLookupMetadata (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its metadata value.
psString psMetadataLookupStr (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its string value.
psTimepsMetadataLookupTime (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return it as a psTime pointer.
bool psMetadataPrint (FILE *fd, const psMetadata *md, int level)
 Prints metadata collection.
psPolynomial1DpsPolynomial1DfromMetadata (const psMetadata *folder)
 Allocates a new psPolynomial1D structure with information from a psMetadata.
bool psPolynomial1DtoMetadata (psMetadata *md, const psPolynomial1D *poly, const char *format,...)
 Stores the information from a psPolynomial1D structure in a psMetadata container.
psPolynomial2DpsPolynomial2DfromMetadata (const psMetadata *folder)
 Allocates a new psPolynomial2D structure with information from a psMetadata.
bool psPolynomial2DtoMetadata (psMetadata *md, const psPolynomial2D *poly, const char *format,...)
 Stores the information from a psPolynomial2D structure in a psMetadata container.
psPolynomial3DpsPolynomial3DfromMetadata (const psMetadata *folder)
 Allocates a new psPolynomial3D structure with information from a psMetadata.
bool psPolynomial3DtoMetadata (psMetadata *md, const psPolynomial3D *poly, const char *format,...)
 Stores the information from a psPolynomial3D structure in a psMetadata container.
psPolynomial4DpsPolynomial4DfromMetadata (const psMetadata *folder)
 Allocates a new psPolynomial4D structure with information from a psMetadata.
bool psPolynomial4DtoMetadata (psMetadata *md, const psPolynomial4D *poly, const char *format,...)
 Stores the information from a psPolynomial4D structure in a psMetadata container.
bool psMetadataItemPrint (FILE *fd, const char *format, const psMetadataItem *item)
 Print metadata item to file.
psMetadatapsMetadataConfigRead (psMetadata *md, unsigned int *nFail, const char *filename, bool overwrite)
 Read metadata configuration file.
psMetadatapsMetadataConfigParse (psMetadata *md, unsigned int *nFail, const char *str, bool overwrite)
 Parse metadata configuration string.
psString psMetadataConfigFormat (psMetadata *md)
 Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string.
bool psMetadataConfigWrite (psMetadata *md, const char *filename)
 Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written out to filename.
bool psMetadataConfigPrint (FILE *stream, psMetadata *md)
 Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written a file stream.
bool psMetadataItemCompare (const psMetadataItem *compare, const psMetadataItem *template)
 Compares two psMetadataItems.
psBool psMetadataItemParseBool (const psMetadataItem *item)
psF32 psMetadataItemParseF32 (const psMetadataItem *item)
psF64 psMetadataItemParseF64 (const psMetadataItem *item)
psS8 psMetadataItemParseS8 (const psMetadataItem *item)
psS16 psMetadataItemParseS16 (const psMetadataItem *item)
psS32 psMetadataItemParseS32 (const psMetadataItem *item)
psU8 psMetadataItemParseU8 (const psMetadataItem *item)
psU16 psMetadataItemParseU16 (const psMetadataItem *item)
psU32 psMetadataItemParseU32 (const psMetadataItem *item)
psString psMetadataItemParseString (const psMetadataItem *item)
psPixelspsPixelsAlloc (long nalloc)
 Allocates a new psPixels structure.
bool psMemCheckPixels (psPtr ptr)
 Checks the type of a particular pointer.
psPixelspsPixelsRealloc (psPixels *pixels, long nalloc)
 resizes a psPixels structure
psPixelsp_psPixelsAppend (psPixels *pixels, long growth, float x, float y)
 Add a pixel location to a psPixels.
psPixelspsPixelsCopy (psPixels *out, const psPixels *pixels)
 Copies a psPixels object.
psImagepsPixelsToMask (psImage *out, const psPixels *pixels, psRegion region, psMaskType maskVal)
 Generate a psImage from a psPixels.
psPixelspsPixelsFromMask (psPixels *out, const psImage *mask, psMaskType maskVal)
 Generate a psPixels from a mask psImage.
psPixelspsPixelsConcatenate (psPixels *out, const psPixels *pixels)
 Concatenates two psPixels.
bool p_psPixelsPrint (FILE *fd, psPixels *pixels, const char *name)
 Prints a psPixels to specified destination.
bool psPixelsSet (psPixels *pixels, long position, psPixelCoord value)
 Sets the value of the the pixels array at the specified position to value.
psPixelCoord psPixelsGet (const psPixels *pixels, long position)
 Returns the value of the pixels array at the specified position.
long psPixelsLength (const psPixels *pixels)
 Get the number of elements in use from a specified psPixels.


Define Documentation

#define P_PSARRAY_SET_NALLOC ( vec,
 )     *(long*)&vec->nalloc = n

Definition at line 40 of file psArray.h.

#define P_PSPIXELS_SET_NALLOC ( pix,
 )     *(long*)&pix->nalloc = n

Definition at line 51 of file psPixels.h.

#define PS_ASSERT_ARRAY_NON_EMPTY ( NAME,
RETURNVAL   )     PS_ASSERT_GENERAL_ARRAY_NON_EMPTY(NAME, return RETURNVAL)

Definition at line 205 of file psArray.h.

#define PS_ASSERT_ARRAY_NON_NULL ( NAME,
RETURNVAL   )     PS_ASSERT_GENERAL_ARRAY_NON_NULL(NAME, return RETURNVAL)

Definition at line 196 of file psArray.h.

#define PS_ASSERT_ARRAY_SIZE ( ARRAY,
SIZE,
RVAL   ) 

Value:

if ((ARRAY)->n != (SIZE)) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "psArray %s has size %ld instead of expected size %ld.", \
            #ARRAY, (ARRAY)->n, SIZE); \
    return RVAL; \
}

Definition at line 222 of file psArray.h.

#define PS_ASSERT_ARRAYS_SIZE_EQUAL ( ARRAY1,
ARRAY2,
RVAL   ) 

Value:

if ((ARRAY1)->n != (ARRAY2)->n) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "psArray %s has size %ld, psArray %s has size %ld.", \
            #ARRAY1, (ARRAY1)->n, #ARRAY2, (ARRAY2)->n); \
    return(RVAL); \
}

Definition at line 214 of file psArray.h.

#define PS_ASSERT_GENERAL_ARRAY_NON_EMPTY ( NAME,
CLEANUP   ) 

Value:

if ((NAME)->n < 1) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "Unallowable operation: psArray %s has no elements.", \
            #NAME); \
    CLEANUP; \
} \

Definition at line 206 of file psArray.h.

#define PS_ASSERT_GENERAL_ARRAY_NON_NULL ( NAME,
CLEANUP   ) 

Value:

if ((NAME) == NULL || (NAME)->data == NULL) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: psArray %s or its data is NULL.", \
            #NAME); \
    CLEANUP; \
} \

Definition at line 197 of file psArray.h.

#define PS_ASSERT_METADATA_NON_NULL ( NAME,
RVAL   ) 

Value:

if (!(NAME) || !(NAME)->hash || !(NAME)->list) { \
    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
            "Error: Metadata %s or one of its components is NULL.", \
            #NAME); \
    return RVAL; \
}
Assert on metadata with extant hash and list components.

Definition at line 1191 of file psMetadata.h.

#define PS_BADPIXEL_BITMASK   0x0f

Macro to get the bad pixel reason code (stored as part of mask value).

Definition at line 240 of file psType.h.

#define PS_DATA_IS_PRIMITIVE ( TYPE   ) 

Value:

(TYPE == PS_DATA_S8 || \
 TYPE == PS_DATA_S16 || \
 TYPE == PS_DATA_S32 || \
 TYPE == PS_DATA_S64 || \
 TYPE == PS_DATA_U8 || \
 TYPE == PS_DATA_U16 || \
 TYPE == PS_DATA_U32 || \
 TYPE == PS_DATA_U64 || \
 TYPE == PS_DATA_F32 || \
 TYPE == PS_DATA_F64 || \
 TYPE == PS_DATA_BOOL)

Definition at line 32 of file psMetadata.h.

#define PS_DATA_PRIMITIVE_TYPE ( DATATYPE   ) 

Value:

( \
        (DATATYPE==PS_DATA_S8 || DATATYPE==PS_DATA_S16 || \
         DATATYPE==PS_DATA_S32 || DATATYPE==PS_DATA_S64 || DATATYPE==PS_DATA_U8 || \
         DATATYPE==PS_DATA_U16 || DATATYPE==PS_DATA_U32 || DATATYPE==PS_DATA_U64 || \
         DATATYPE==PS_DATA_F32 || DATATYPE==PS_DATA_F64 || DATATYPE==PS_DATA_BOOL) ? DATATYPE : 0)

Definition at line 45 of file psMetadata.h.

#define PS_GET_BADPIXEL ( maskValue   )     (maskValue & PS_BADPIXEL_BITMASK)

Definition at line 241 of file psType.h.

#define PS_IS_BADPIXEL ( maskValue   )     (PS_GET_BADPIXEL(maskValue) != 0)

Definition at line 243 of file psType.h.

#define PS_IS_PSELEMTYPE_BOOL (  )     ((x & 0x1000) == 0x1000)

Macro to determine if the psElemType is boolean type.

Definition at line 260 of file psType.h.

#define PS_IS_PSELEMTYPE_COMPLEX (  )     ((x & 0x800) == 0x800)

Macro to determine if the psElemType is complex number type.

Definition at line 258 of file psType.h.

#define PS_IS_PSELEMTYPE_INT (  )     ((x & 0x100) == 0x100)

Macro to determine if the psElemType is an integer.

Definition at line 252 of file psType.h.

#define PS_IS_PSELEMTYPE_REAL (  )     ((x & 0x400) == 0x400)

Macro to determine if the psElemType is a real (non-complex) floating-point type.

Definition at line 256 of file psType.h.

#define PS_IS_PSELEMTYPE_UNSIGNED (  )     ((x & 0x200) == 0x200)

Macro to determine if the psElemType is unsigned.

Definition at line 254 of file psType.h.

#define PS_MAX_C32   FLT_MAX

maximum valid real or imaginary psC32 value

Definition at line 177 of file psType.h.

#define PS_MAX_C64   DBL_MAX

maximum valid real or imaginary psC32 value

Definition at line 178 of file psType.h.

#define PS_MAX_F32   FLT_MAX

maximum valid psF32 value

Definition at line 175 of file psType.h.

#define PS_MAX_F64   DBL_MAX

maximum valid psF64 value

Definition at line 176 of file psType.h.

#define PS_MAX_S16   INT16_MAX

maximum valid psS16 value

Definition at line 168 of file psType.h.

#define PS_MAX_S32   INT32_MAX

maximum valid psS32 value

Definition at line 169 of file psType.h.

#define PS_MAX_S64   INT64_MAX

maximum valid psS64 value

Definition at line 170 of file psType.h.

#define PS_MAX_S8   INT8_MAX

maximum valid psS8 value

Definition at line 167 of file psType.h.

#define PS_MAX_U16   UINT16_MAX

maximum valid psU16 value

Definition at line 172 of file psType.h.

#define PS_MAX_U32   UINT32_MAX

maximum valid psU32 value

Definition at line 173 of file psType.h.

#define PS_MAX_U64   UINT64_MAX

maximum valid psU64 value

Definition at line 174 of file psType.h.

#define PS_MAX_U8   UINT8_MAX

maximum valid psU8 value

Definition at line 171 of file psType.h.

#define PS_METADATA_FLAGS_MASK   0xFF000000

Definition at line 66 of file psMetadata.h.

#define PS_METADATA_TYPE_MASK   0x00FFFFFF

Definition at line 67 of file psMetadata.h.

#define PS_MIN_C32   -FLT_MAX

minimum valid real or imaginary psC32 value

Definition at line 164 of file psType.h.

#define PS_MIN_C64   -DBL_MAX

minimum valid real or imaginary psC32 value

Definition at line 165 of file psType.h.

#define PS_MIN_F32   -FLT_MAX

minimum valid psF32 value

Definition at line 162 of file psType.h.

#define PS_MIN_F64   -DBL_MAX

minimum valid psF64 value

Definition at line 163 of file psType.h.

#define PS_MIN_S16   INT16_MIN

minimum valid psS16 value

Definition at line 155 of file psType.h.

#define PS_MIN_S32   INT32_MIN

minimum valid psS32 value

Definition at line 156 of file psType.h.

#define PS_MIN_S64   INT64_MIN

minimum valid psS64 value

Definition at line 157 of file psType.h.

#define PS_MIN_S8   INT8_MIN

minimum valid psS8 value

Definition at line 154 of file psType.h.

#define PS_MIN_U16   0

minimum valid psU16 value

Definition at line 159 of file psType.h.

#define PS_MIN_U32   0

minimum valid psU32 value

Definition at line 160 of file psType.h.

#define PS_MIN_U64   0

minimum valid psU64 value

Definition at line 161 of file psType.h.

#define PS_MIN_U8   0

minimum valid psU8 value

Definition at line 158 of file psType.h.

#define PS_SET_BADPIXEL ( maskValue,
reasonCode   ) 

Value:

{ \
    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
}
Macro to apply a bad pixel reason code to mask image.

Definition at line 246 of file psType.h.

#define PS_TYPE_BOOL_NAME   "psBool"

Definition at line 180 of file psType.h.

#define PS_TYPE_C32_NAME   "psC32"

Definition at line 191 of file psType.h.

#define PS_TYPE_C64_NAME   "psC64"

Definition at line 192 of file psType.h.

#define PS_TYPE_F32_NAME   "psF32"

Definition at line 189 of file psType.h.

#define PS_TYPE_F64_NAME   "psF64"

Definition at line 190 of file psType.h.

#define PS_TYPE_MASK   PS_TYPE_U8

the psElemType to use for mask image

Definition at line 147 of file psType.h.

#define PS_TYPE_MASK_DATA   U8

the data member to use for mask image

Definition at line 148 of file psType.h.

#define PS_TYPE_MASK_NAME   "psU8"

the data type for mask as a string

Definition at line 149 of file psType.h.

#define PS_TYPE_NAME ( value,
type   ) 

Definition at line 194 of file psType.h.

#define PS_TYPE_S16_NAME   "psS16"

Definition at line 182 of file psType.h.

#define PS_TYPE_S32_NAME   "psS32"

Definition at line 183 of file psType.h.

#define PS_TYPE_S64_NAME   "psS64"

Definition at line 184 of file psType.h.

#define PS_TYPE_S8_NAME   "psS8"

Definition at line 181 of file psType.h.

#define PS_TYPE_U16_NAME   "psU16"

Definition at line 186 of file psType.h.

#define PS_TYPE_U32_NAME   "psU32"

Definition at line 187 of file psType.h.

#define PS_TYPE_U64_NAME   "psU64"

Definition at line 188 of file psType.h.

#define PS_TYPE_U8_NAME   "psU8"

Definition at line 185 of file psType.h.

#define PSELEMTYPE_SIZEOF (  )     (x & 0xFF)

Macro to determine the storage size, in bytes, of the psElemType.

Definition at line 262 of file psType.h.


Typedef Documentation

typedef psBool psBOOL

allow psBOOL to be used instead of psBool (for macros)

Definition at line 152 of file psType.h.

typedef bool psBool

boolean value

Definition at line 75 of file psType.h.

typedef float complex psC32

complex with 32-bit floating point Real and Imagary numbers

Definition at line 69 of file psType.h.

typedef double complex psC64

complex with 64-bit floating point Real and Imagary numbers

Definition at line 70 of file psType.h.

typedef float psF32

32-bit floating point

Definition at line 50 of file psType.h.

typedef double psF64

64-bit floating point

Definition at line 51 of file psType.h.

typedef psU8 psMaskType

the C datatype for a mask image

Definition at line 151 of file psType.h.

typedef void* psPtr

void pointer

Definition at line 74 of file psType.h.

typedef int16_t psS16

16-bit signed int

Definition at line 47 of file psType.h.

typedef int32_t psS32

32-bit signed int

Definition at line 48 of file psType.h.

typedef int64_t psS64

64-bit signed int

Definition at line 49 of file psType.h.

typedef int8_t psS8

8-bit signed int

Definition at line 46 of file psType.h.

typedef char* psString

string value

Definition at line 73 of file psType.h.

typedef uint16_t psU16

16-bit unsigned int

Definition at line 43 of file psType.h.

typedef uint32_t psU32

32-bit unsigned int

Definition at line 44 of file psType.h.

typedef uint64_t psU64

64-bit unsigned int

Definition at line 45 of file psType.h.

typedef uint8_t psU8

Basic data types used by the containers. 8-bit unsigned int.

The basic types of the primitives used by psLib are defined within this enum. This enum is in turn used by the psType struct.

Definition at line 42 of file psType.h.


Enumeration Type Documentation

anonymous enum

Special values of index into list.

This list of possible list position values should be contiguous non-positive values ending with PS_LIST_UNKNOWN. Any value less-than-or-equal-to PS_LIST_UNKNOWN is considered a undefined position.

Enumerator:
PS_LIST_HEAD  at head
PS_LIST_TAIL  at tail

Definition at line 28 of file psList.h.

enum psDataType

Enumeration primarily used with metadata which defines a data structure e.g., list, array, FITS file, etc.

Enumerator:
PS_DATA_S8  psS8
PS_DATA_S16  psS16
PS_DATA_S32  psS32
PS_DATA_S64  psS64
PS_DATA_U8  psU8
PS_DATA_U16  psU16
PS_DATA_U32  psU32
PS_DATA_U64  psU64
PS_DATA_F32  psF32
PS_DATA_F64  psF64
PS_DATA_BOOL  psBool
PS_DATA_STRING  psString (char *)
PS_DATA_ARRAY  psArray
PS_DATA_BITSET  psBitSet
PS_DATA_CUBE  psCube
PS_DATA_FITS  psFits
PS_DATA_HASH  psHash
PS_DATA_HISTOGRAM  psHistogram
PS_DATA_IMAGE  psImage
PS_DATA_KERNEL  psKernel
PS_DATA_LINE  psLine
PS_DATA_LIST  psList
PS_DATA_LOOKUPTABLE  psLookupTable
PS_DATA_METADATA  psMetadata
PS_DATA_METADATAITEM  psMetadataItem
PS_DATA_MINIMIZATION  psMinimization
PS_DATA_PIXELS  psPixels
PS_DATA_PLANE  psPlane
PS_DATA_PLANEDISTORT  psPlaneDistort
PS_DATA_PLANETRANSFORM  psPlaneTransform
PS_DATA_POLYNOMIAL1D  psPolynomial1D
PS_DATA_POLYNOMIAL2D  psPolynomial2D
PS_DATA_POLYNOMIAL3D  psPolynomial3D
PS_DATA_POLYNOMIAL4D  psPolynomial4D
PS_DATA_PROJECTION  psProjection
PS_DATA_REGION  psRegion
PS_DATA_SCALAR  psScalar
PS_DATA_SPHERE  psSphere
PS_DATA_SPHEREROT  psSphereTransform
PS_DATA_SPLINE1D  psSpline1D
PS_DATA_STATS  psStats
PS_DATA_TIME  psTime
PS_DATA_VECTOR  psVector
PS_DATA_UNKNOWN  Other data of an unknown type.
PS_DATA_METADATA_MULTI  Used internally for metadata; not a 'real' type.

Definition at line 99 of file psType.h.

enum psDimen

Dimensions of a data type.

The dimensions of containers used by psLib are defined within this enum. This enum is used by the psType struct. *

Enumerator:
PS_DIMEN_SCALAR  Scalar.
PS_DIMEN_VECTOR  Vector.
PS_DIMEN_TRANSV  Transposed vector.
PS_DIMEN_IMAGE  Image.
PS_DIMEN_OTHER  Something else that's not supported for arithmetic.

Definition at line 269 of file psType.h.

enum psElemType

Enumeration of data types for function elements.

Contains replacements for native types.

Enumerator:
PS_TYPE_S8  Character.
PS_TYPE_S16  Short integer.
PS_TYPE_S32  Integer.
PS_TYPE_S64  Long integer.
PS_TYPE_U8  Unsigned character.
PS_TYPE_U16  Unsigned psS16 integer.
PS_TYPE_U32  Unsigned integer.
PS_TYPE_U64  Unsigned psS64 integer.
PS_TYPE_F32  Single-precision Floating point.
PS_TYPE_F64  Double-precision floating point.
PS_TYPE_C32  Complex numbers consisting of single-precision floating point.
PS_TYPE_C64  Complex numbers consisting of double-precision floating point.
PS_TYPE_BOOL  Boolean.

Definition at line 80 of file psType.h.

enum psLookupStatusType

Lookup table lookup status and error conditions.

Success, failure, and status conditions for table lookups.

Enumerator:
PS_LOOKUP_SUCCESS  Table lookup succeeded.
PS_LOOKUP_PAST_TOP  Lookup off top of table.
PS_LOOKUP_PAST_BOTTOM  Lookup off bottom of table.
PS_LOOKUP_ERROR  Any other type of lookup error.

Definition at line 48 of file psLookupTable.h.

enum psMetadataFlags

Option flags for psMetadata functions.

Enumeration for the modification of the behaviour in psMetadataAddItem.

See also:
psMetadataAddItem
Enumerator:
PS_META_DEFAULT  default behaviour (duplicate entry is an error)
PS_META_REPLACE  allow entry to be replaced
PS_META_NO_REPLACE  duplicate entry is silently skipped
PS_META_DUPLICATE_OK  allow duplicate entries
PS_META_NULL  psMetadataItem.data is a NULL value

Definition at line 58 of file psMetadata.h.

enum psParseErrorType

Lookup table parse status and error conditions.

Success, failure, and status conditions for table parsing.

Enumerator:
PS_PARSE_SUCCESS  Table lookup succeeded.
PS_PARSE_ERROR_TYPE  Error parsing type.
PS_PARSE_ERROR_VALUE  Error parsing numerical value.
PS_PARSE_ERROR_GENERAL  Any other type of lookup error.

Definition at line 59 of file psLookupTable.h.


Function Documentation

psPixels* p_psPixelsAppend ( psPixels pixels,
long  growth,
float  x,
float  y 
)

Add a pixel location to a psPixels.

Grow the psPixels input by growth. If growth is less that 1, 10 is used. If a NULL psPixels is given, a new one is created.

Returns:
psPixels* psPixels with the value appended.
Parameters:
pixels  psPixels to append new coordinate to.
growth  Number of elements to grow the pixels list if necessary.
x  x coordinate to append
y  y coordinate to append

bool p_psPixelsPrint ( FILE *  fd,
psPixels pixels,
const char *  name 
)

Prints a psPixels to specified destination.

Returns:
bool: True if successful.
Parameters:
fd  destination file descriptor
pixels  psPixels to print
name  printf-style format of header line

psArray* psArrayAdd ( psArray array,
long  delta,
psPtr  data 
)

Add an element to the end the array, expanding the array storage if necessary.

Returns:
psArray* The array with the element added
Parameters:
array  array to operate on
delta  the amount to expand array, if necessary. If less than one, 10 will be used.
data  the data pointer to add to psArray

psArray* psArrayAlloc ( long  nalloc  ) 

Allocate an array, set the length to the number of allocated elements.

Uses psLib memory allocation functions to create an array collection of data

Returns:
psArray* : Pointer to psArray.
Parameters:
nalloc  Total number of elements to make available.

psArray* psArrayAllocEmpty ( long  nalloc  ) 

Allocate an array, set the length to zero.

Uses psLib memory allocation functions to create an array collection of data

Returns:
psArray* : Pointer to psArray.
Parameters:
nalloc  Total number of elements to make available.

void psArrayElementsFree ( psArray array  ) 

Deallocate/Dereference elements of an array.

Uses psLib memory allocation functions to deallocate/dereference elements of a array of void pointers. The array psArr is not freed, and its elements will all be set to NULL. Additionaly, the array size (n) is set to zero.

Parameters:
array  Void pointer array to destroy.

psPtr psArrayGet ( const psArray array,
long  position 
)

Get an element from the array.

Returns:
void* the element at given position.
Parameters:
array  input array to get element from
position  the element position to get

long psArrayLength ( const psArray array  ) 

Get the number of elements in use from a specified psArray.

(array.n)

Returns:
long: The number of elements in use.
Parameters:
array  input psArray

psArray* psArrayRealloc ( psArray array,
long  nalloc 
)

Reallocate an array.

Uses psLib memory allocation functions to reallocate an array collection of data.

Returns:
psArray* : Pointer to psArray.
Parameters:
array  array to reallocate.
nalloc  Total number of elements to make available.

bool psArrayRemoveData ( psArray array,
const psPtr  data 
)

Remove an element from the array by it's pointer.

Finds and removes the specified data pointer from the list.

Returns:
bool: TRUE if the specified data pointer was found and removed, otherwise FALSE.
Parameters:
array  array to operate on
data  the data pointer to remove from psArray

bool psArrayRemoveIndex ( psArray array,
long  index 
)

Remove an element from the array.

Finds and removes the elements as the specified position

Returns:
bool: TRUE if the specified data pointer was found and removed, otherwise FALSE.
Parameters:
array  array to operate on
index  the element to remove

bool psArraySet ( psArray array,
long  position,
psPtr  data 
)

Set an element in the array.

If the current element is non-NULL, the old element is freed.

Returns:
psBool TRUE if the element was set successfully, otherwise FALSE
Parameters:
array  input array to set element in
position  the element position to set
data  the value to set it to

psArray* psArraySort ( psArray array,
psComparePtrFunc  func 
)

Sort the array according to an external compare function.

Sorts an array via the specification of a comparison function to specify how the objects on the array should be sorted.

The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

If two members compare as equal, their order in the sorted array is undefined.

Returns:
psArray* The sorted array.
Parameters:
array  input array to sort.
func  the compare function

psList* psArrayToList ( const psArray array  ) 

Convert array to a doubly-linked list.

Returns:
psList* A new psList populated with elements formt the psArray, or NULL is the given arr parameter is NULL.
Parameters:
array  vector to convert

psBitSet* psBitSetAlloc ( long  nalloc  ) 

Allocate a psBitSet.

Create a psBitSet with the number of bits specified by the user. All bits are set to zero upon allocation.

Returns:
psBitSet* : Pointer to struct containing array of bits and size of array.
Parameters:
nalloc  Number of bits in psBitSet array

psBitSet* psBitSetClear ( psBitSet bitSet,
long  bit 
)

Clear a bit.

Clear a bit at a given bit location. The bit is cleared based on a zero index with the first bit set in the zero bit slot of the zero element of the byte array.

Returns:
psBitSet* : Pointer to struct containing psBitSet.
Parameters:
bitSet  Pointer to psBitSet to be cleared.
bit  Bit to be cleared.

psBitSet* psBitSetNot ( psBitSet outBitSet,
const psBitSet inBitSet 
)

Perform a not operation on a psBitSet.

Toggles bits in a psBitset. All zero bits are set to one and all one bits are set to zero.

Returns:
psBitSet* : Pointer to struct containing result of operation.
Parameters:
outBitSet  Resulting psBitSet from operation
inBitSet  Input psBitSet

psBitSet* psBitSetOp ( psBitSet outBitSet,
const psBitSet inBitSet1,
const char *  operator,
const psBitSet inBitSet2 
)

Perform a binary operation on two psBitSets.

Perform an AND, OR, or XOR on two psBitSets. If the BitMasks are not the same size, the operation will not be performed and an error message will be logged.

Returns:
psBitSet* : Pointer to struct containing result of binary operation.
Parameters:
outBitSet  Resulting psBitSet from binary operation
inBitSet1  First psBitSet on which to operate
operator  Bit operation
inBitSet2  Second psBitSet on which to operate

psBitSet* psBitSetSet ( psBitSet bitSet,
long  bit 
)

Set a bit.

Sets a bit at a given bit location. The bit is set based on a zero index with the first bit set in the zero bit slot of the zero element of the byte array. As an example, setting bit 3 in an array with two elements would result in an psBitSet that looks like 00000000 00001000.

Returns:
psBitSet* : Pointer to struct containing psBitSet.
Parameters:
bitSet  Pointer to psBitSet to be set.
bit  Bit to be set.

bool psBitSetTest ( const psBitSet bitSet,
long  bit 
)

Test the value of a bit.

Prints the value of a bit at a given bit location, either one or zero. The resulting bit is based on a zero index format with the first bit set in the zero bit slot of the zero element of the byte array. As an example, testing bit 3 in a psBitSet with two bytes that looks like 00000000 00001000 would return a value of one, since that is the value that was set.

Returns:
bool: True if successful, otherwise false
Parameters:
bitSet  Pointer psBitSet to be tested.
bit  Bit to be tested.

psString psBitSetToString ( const psBitSet bitSet  ) 

Convert the psBitSet to a string of ones and zeros.

Converts the contents of a psBitSet to a string representation of its binary form of ones and zeros. The LSB is the right-most chracter. Each set of eight characters represents one byte.

Returns:
psString: Pointer to character array containing string data.
Parameters:
bitSet  psBitSet to convert

bool psHashAdd ( psHash hash,
const char *  key,
psPtr  data 
)

Insert entry into table.

Parameters:
hash  The table to insert in.
key  The key to use.
data  The data to insert.

psHash* psHashAlloc ( long  nalloc  ) 

Allocate hash buckets in table.

Parameters:
nalloc  The number of buckets to allocate.

psList* psHashKeyList ( const psHash hash  ) 

List all keys in table.

Parameters:
hash  The table to list keys from..

psPtr psHashLookup ( const psHash hash,
const char *  key 
)

Lookup key in table.

Parameters:
hash  The table to lookup key in.
key  The key to lookup.

bool psHashRemove ( psHash hash,
const char *  key 
)

Remove key from table.

Parameters:
hash  The table to lookup key in.
key  The key to lookup.

psArray* psHashToArray ( const psHash hash  ) 

Create a psArray from a psHash contents.

Returns:
psArray* A new psArray with duplicate contents of the input psHash
Parameters:
hash  The table to convert to psArray.

bool psListAdd ( psList list,
long  location,
psPtr  data 
)

Adds an element to a psList at position given.

Returns:
bool TRUE if item was successfully added, otherwise FALSE.
Parameters:
list  list to add item to
location  index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
data  data item to add. If NULL, list is not modified.

bool psListAddAfter ( psListIterator iterator,
psPtr  data 
)

Adds an data item to a psList at position just after the list position given.

Returns:
bool TRUE if item was successfully added, otherwise FALSE.
Parameters:
iterator  list position to add item to
data  data item to add. If NULL, list is not modified.

bool psListAddBefore ( psListIterator iterator,
psPtr  data 
)

Adds a data item to a psList at position just before the list position given.

Returns:
bool TRUE if item was successfully added, otherwise FALSE.
Parameters:
iterator  list position to add item to
data  data item to add. If NULL, list is not modified.

psList* psListAlloc ( psPtr  data  ) 

Creates a psList linked list object.

Returns:
psList* A new psList object.
Parameters:
data  initial data item; may be NULL if an empty psList is desired

psPtr psListGet ( psList list,
long  location 
)

Retrieve an item from a list.

Returns:
psPtr the item corresponding to the location parameter. If location is invalid (e.g., a numbered index greater than the list size or if the list is empty), a NULL is returned.
Parameters:
list  list to retrieve element from
location  index number, PS_LIST_HEAD, or PS_LIST_TAIL

psPtr psListGetAndDecrement ( psListIterator iterator  ) 

Position the specified iterator to the previous item in list.

Returns:
psPtr the data item at the original iterator position or NULL if the iterator went past the beginning of the list.
Parameters:
iterator  iterator to move

psPtr psListGetAndIncrement ( psListIterator iterator  ) 

Position the specified iterator to the next item in list.

Returns:
psPtr the data item at the original iterator position or NULL if the iterator went past the end of the list.
Parameters:
iterator  iterator to move

psListIterator* psListIteratorAlloc ( psList list,
long  location,
bool  mutable 
)

Creates a psListIterator object and associates it with a psList.

Returns:
psListIterator* A new psListIterator object.
Parameters:
list  the psList to iterate with
location  the initial starting point. This can be a numeric index, PS_LIST_HEAD, or PS_LIST_TAIL.
mutable  Is it permissible to modify list?

bool psListIteratorSet ( psListIterator iterator,
long  location 
)

Set the iterator of the list to a given position.

If location is invalid the iterator position is not changed.

Returns:
bool TRUE if iterator successfully set, otherwise FALSE.
Parameters:
iterator  list iterator
location  index number, PS_LIST_HEAD, or PS_LIST_TAIL

long psListLength ( const psList list  ) 

Get the number of elements in use from a specified psList.

(list.n)

Returns:
long: The number of elements in use.
Parameters:
list  input psList

bool psListRemove ( psList list,
long  location 
)

Remove an item at the specified location from a list.

Returns:
bool TRUE if element is successfully removed, otherwise FALSE.
Parameters:
list  list to remove element from
location  index of item

bool psListRemoveData ( psList list,
psPtr  data 
)

Remove an item from a list.

Returns:
bool TRUE if element is successfully removed, otherwise FALSE.
Parameters:
list  list to remove element from
data  data item to find and remove

psList* psListSort ( psList list,
psComparePtrFunc  func 
)

Sort a list via a comparison function.

The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

If two members compare as equal, their order in the sorted array is undefined.

Returns:
psList* Sorted list.
Parameters:
list  the list to sort
func  the comparison function

psArray* psListToArray ( const psList list  ) 

Convert a linked list to an array.

Returns:
psArray* A new psArray populated with elements from the list, or NULL if the given dlist parameter is NULL.
Parameters:
list  List to convert

psLookupTable* psLookupTableAlloc ( const char *  filename,
const char *  format,
long  indexCol 
)

Allocator for psLookupTable struct.

Allocates a new psLookupTable struct.

Returns:
psLookupTable* New psLookupTable struct.
Parameters:
filename  Name of file to read
format  scanf-like format string
indexCol  Column of the index vector (starting at zero)

psLookupTable* psLookupTableImport ( psLookupTable table,
const psArray vectors,
long  indexCol 
)

Import arrays of vectors into a table.

Import array of vectors read from text file into a table structure

Returns:
psLookupTable* Lookup table structure with array vector data
Parameters:
table  Lookup table into which to import
vectors  Array of vectors
indexCol  Index of the index vector in the array of vectors

double psLookupTableInterpolate ( const psLookupTable table,
double  index,
long  column 
)

Lookup and interpolate value from table.

Interpolates value from table. Sets status bit for success or one of several possible failure conditions.

Returns:
double Interpolation value at index
Parameters:
table  Table with data
index  Value to be interpolated
column  Column in table to be interpolated

psVector* psLookupTableInterpolateAll ( const psLookupTable table,
double  index 
)

Lookup and interpolate all values from table.

Interpolates all values from table. Sets status bit for success or one of several possible failure conditions.

Returns:
psVector* Interpolation values calculated at index
Parameters:
table  Table with data
index  Value to be interpolated

long psLookupTableRead ( psLookupTable table  ) 

Read lookup table.

Reads a lookup table and fills corresponding psLookupTable struct.

Returns:
long: Number of valid lines read
Parameters:
table  Table to read

bool psMemCheckArray ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psArray structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckBitSet ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psBitSet structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckHash ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psHash structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckList ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psList structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckLookupTable ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psLookupTable structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckMetadata ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psMetadata structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckMetadataItem ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psMetadataItem structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPixels ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPixels structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckType ( psDataType  type,
psPtr  ptr 
)

Checks the deallocator to see if the pointer matches the desired datatype.

Returns:
bool: True if type matches, otherwise false.
Parameters:
type  The desired psDataType to match
ptr  The desired pointer to match

bool psMetadataAdd ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
  ... 
)

Create and add a metadata item to metadata collection.

Creates a new metadata item add to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item.
format  psDataType of metadata item & options (psMetadataFlags)
comment  Comment for metadata item.

bool psMetadataAddArray ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psArray value 
)

Add a array to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Vector for metadata item data

bool psMetadataAddBool ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
bool  value 
)

Add a psBool value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddF32 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psF32  value 
)

Add a psF32 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddF64 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psF64  value 
)

Add a psF64 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddHash ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psHash value 
)

Add a Hash to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Hash for metadata item data

bool psMetadataAddImage ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psImage value 
)

Add an Image to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Image for metadata item data

bool psMetadataAddItem ( psMetadata md,
const psMetadataItem item,
int  location,
psS32  flags 
)

Add existing metadata item to metadata collection.

Add a metadata item that has already been created to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadata item.
item  Metadata item to be added.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
flags  Options flag mask, see psMetadataFlags enum

bool psMetadataAddList ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psList value 
)

Add a psList to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  psList for metadata item data

bool psMetadataAddLookupTable ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psLookupTable value 
)

Add a LookupTable to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  LookupTable for metadata item data

bool psMetadataAddMetadata ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psMetadata value 
)

Add Metadata to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Metadata for metadata item data

bool psMetadataAddPtr ( psMetadata md,
long  location,
const char *  name,
psDataType  type,
const char *  comment,
psPtr  value 
)

Add a psPtr to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
type  psDataType for metadata item
comment  Comment for metadata item
value  Unknown for metadata item data

bool psMetadataAddS16 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psS16  value 
)

Add a psS16 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddS32 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psS32  value 
)

Add a psS32 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddS64 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psS64  value 
)

Add a psS64 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddS8 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psS8  value 
)

Add a psS8 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddStr ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
const char *  value 
)

Add a string to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  String for metadata item data

bool psMetadataAddTime ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psTime value 
)

Add a Time to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Time for metadata item data

bool psMetadataAddU16 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psU16  value 
)

Add a psU16 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddU32 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psU32  value 
)

Add a psU32 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddU64 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psU64  value 
)

Add a psU64 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddU8 ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psU8  value 
)

Add a psU8 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddUnknown ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psPtr  value 
)

Add an Unknown (psPtr) to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Unknown for metadata item data

bool psMetadataAddV ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
va_list  list 
)

Create and add a metadata item to metadata collection.

Creates a new metadata item add to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item.
format  psDataType of metadata item & options (psMetadataFlags)
comment  Comment for metadata item.
list  Arguments for name formatting and metadata item data.

bool psMetadataAddVector ( psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psVector value 
)

Add a vector to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Vector for metadata item data

psMetadata* psMetadataAlloc ( void   ) 

Create a metadata collection.

Returns an empty metadata container with fully allocated internal metadata containers.

Returns:
psMetadata* : Pointer metadata.

psString psMetadataConfigFormat ( psMetadata md  ) 

Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string.

A NULL shall be returned on error.

Returns:
psString: a Configuration File formatted string.
Parameters:
md  The metadata to convert

psMetadata* psMetadataConfigParse ( psMetadata md,
unsigned int *  nFail,
const char *  str,
bool  overwrite 
)

Parse metadata configuration string.

Loads pre-defined settings by parsing a string into a psMetadata structure.

Returns:
psMetadata* : Resulting metadata from parse.
Parameters:
md  Resulting metadata from read.
nFail  Number of failed lines.
str  String to process.
overwrite  Allow overwrite of duplicate specifications.

bool psMetadataConfigPrint ( FILE *  stream,
psMetadata md 
)

Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written a file stream.

Returns:
bool: True if successful, otherwise false.
Parameters:
stream  file stream to write to
md  The metadata to convert

psMetadata* psMetadataConfigRead ( psMetadata md,
unsigned int *  nFail,
const char *  filename,
bool  overwrite 
)

Read metadata configuration file.

Loads pre-defined settings by parsing a configuration file into a psMetadata structure.

Returns:
psMetadata* : Resulting metadata from read.
Parameters:
md  Resulting metadata from read.
nFail  Number of failed lines.
filename  Name of file to read.
overwrite  Allow overwrite of duplicate specifications.

bool psMetadataConfigWrite ( psMetadata md,
const char *  filename 
)

Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written out to filename.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  The metadata to convert
filename  Name of file to write

psMetadata* psMetadataCopy ( psMetadata out,
const psMetadata in 
)

Create a copy of an existing psMetadata collection.

Creates a new copy of all the psMetadataItems in the psMetadata collection, in, and returns them in out, or creates a new container if out is NULL. If an error occurs, NULL is returned but out may still have been updated if it is non-NULL.

Returns:
psMetadata*: the copy of the psMetadata container.
Parameters:
out  output Metadata container for copying.
in  Metadata collection to be copied.

psMetadataItem* psMetadataGet ( const psMetadata md,
int  location 
)

Find an item in the metadata collection based on list index.

Items may be found in the metadata by their entry position in the list container.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
md  Metadata collection to retrieve metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL

psMetadataItem* psMetadataGetAndDecrement ( psMetadataIterator iterator  ) 

Position the specified iterator to the previous matching item in psMetadata, given the regular expression of the iterator.

Returns:
psPtr the psMetadataItem at the original iterator position or NULL if the iterator went past the beginning of the list.
Parameters:
iterator  iterator to move

psMetadataItem* psMetadataGetAndIncrement ( psMetadataIterator iterator  ) 

Position the specified iterator to the next matching item in psMetadata, given the regular expression of the iterator.

Returns:
psPtr the psMetadataItem at the original iterator position or NULL if the iterator went past the end of the list.
Parameters:
iterator  iterator to move

psMetadataItem* psMetadataItemAlloc ( const char *  name,
psDataType  type,
const char *  comment,
  ... 
)

Create a metadata item.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies the name to use for this item, and may include sprintf formatting codes. The format entry specifies both the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting codes and the metadata itself are passed as arguments following the comment string. The data must be a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately by the va_list operators in the function specified size and type.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Type of metadata item.
comment  Comment for metadata item.

psMetadataItem* psMetadataItemAllocBool ( const char *  name,
const char *  comment,
bool  value 
)

Create a metadata item with specified psBool data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocF32 ( const char *  name,
const char *  comment,
psF32  value 
)

Create a metadata item with specified psF32 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocF64 ( const char *  name,
const char *  comment,
psF64  value 
)

Create a metadata item with specified psF64 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocPtr ( const char *  name,
psDataType  type,
const char *  comment,
psPtr  value 
)

Create a metadata item with specified psPtr data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Data type of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocS16 ( const char *  name,
const char *  comment,
psS16  value 
)

Create a metadata item with specified psS16 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocS32 ( const char *  name,
const char *  comment,
psS32  value 
)

Create a metadata item with specified psS32 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocS64 ( const char *  name,
const char *  comment,
psS64  value 
)

Create a metadata item with specified psS64 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocS8 ( const char *  name,
const char *  comment,
psS8  value 
)

Create a metadata item with specified psS8 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocStr ( const char *  name,
const char *  comment,
const char *  value 
)

Create a metadata item with specified string data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocU16 ( const char *  name,
const char *  comment,
psU16  value 
)

Create a metadata item with specified psU16 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocU32 ( const char *  name,
const char *  comment,
psU32  value 
)

Create a metadata item with specified psU32 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocU64 ( const char *  name,
const char *  comment,
psU64  value 
)

Create a metadata item with specified psU64 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocU8 ( const char *  name,
const char *  comment,
psU8  value 
)

Create a metadata item with specified psU8 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocV ( const char *  name,
psDataType  type,
const char *  comment,
va_list  list 
)

Create a metadata item with va_list.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies the name to use for this item, and may include sprintf formatting codes. The format entry specifies both the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting codes and the metadata itself are passed as arguments following the comment string. The data must be a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately by the va_list operators in the function specified size and type.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Type of metadata item.
comment  Comment for metadata item.
list  Arguments for name formatting and metadata item data.

bool psMetadataItemCompare ( const psMetadataItem compare,
const psMetadataItem template 
)

Compares two psMetadataItems.

Returns:
bool: True if compare matches template, otherwise false.
Parameters:
compare  Item to compare to the template
template  The template

psMetadataItem* psMetadataItemCopy ( const psMetadataItem in  ) 

Creates a new copy of a psMetadataItem.

Returns:
psMetadataItem*: the copy of the psMetadataItem
Parameters:
in  metadata item to be copied

psBool psMetadataItemParseBool ( const psMetadataItem item  ) 

psF32 psMetadataItemParseF32 ( const psMetadataItem item  ) 

psF64 psMetadataItemParseF64 ( const psMetadataItem item  ) 

psS16 psMetadataItemParseS16 ( const psMetadataItem item  ) 

psS32 psMetadataItemParseS32 ( const psMetadataItem item  ) 

psS8 psMetadataItemParseS8 ( const psMetadataItem item  ) 

psString psMetadataItemParseString ( const psMetadataItem item  ) 

psU16 psMetadataItemParseU16 ( const psMetadataItem item  ) 

psU32 psMetadataItemParseU32 ( const psMetadataItem item  ) 

psU8 psMetadataItemParseU8 ( const psMetadataItem item  ) 

bool psMetadataItemPrint ( FILE *  fd,
const char *  format,
const psMetadataItem item 
)

Print metadata item to file.

Metadata items may be printed to an open file descriptor based on a provided format. The format is a sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric type, this formatting command must also be numeric, and the type conversion performed to the value to match the format type. If the metadata type is a string, the formatting command must also be for a string. If the metadata type is any other data type, printing is not allowed.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
fd  Pointer to file to write metadata item.
format  Format to print metadata item.
item  Metadata item to print.

bool psMetadataItemTransfer ( psMetadata out,
const psMetadata in,
const char *  key 
)

Copy a metadata item from one psMetadata to another.

Creates a copy of a psMetadataItem from in and appends it to out. If out is NULL, a new container is created.

Returns:
bool: True if successful, otherwise false.
Parameters:
out  output Metadata container for copying.
in  Metadata collection from which to copy.
key  key to identify the metadata item for copying.

psMetadataIterator* psMetadataIteratorAlloc ( const psMetadata md,
long  location,
const char *  regex 
)

Creates a psMetadataIterator to iterate over the specified psMetadata.

Supports the subsetting of the metadata via keyword using regular expression. If no regular expression is specified, iteration over the entire psMetadata is performed.

Returns:
psMetadataIterator* a new psMetadataIterator, of NULL if error occurred
Parameters:
md  the psMetadata to iterate with
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
regex  A regular expression for subsetting the psMetadata. If NULL, no subsetting is performed.

bool psMetadataIteratorSet ( psMetadataIterator iterator,
long  location 
)

Set the iterator of the psMetadat to a given position.

If location is invalid the iterator position is not changed.

Returns:
bool TRUE if iterator successfully set, otherwise FALSE.
Parameters:
iterator  psMetadata iterator
location  index number, PS_LIST_HEAD, or PS_LIST_TAIL

psMetadataItem* psMetadataLookup ( const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name.

Items may be found in the metadata by providing a key. If the key is non-unique, the first item is returned. If the item is not found, null is returned.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

bool psMetadataLookupBool ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its boolean value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
bool : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psF32 psMetadataLookupF32 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its single precision value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psF32 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psF64 psMetadataLookupF64 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its double precision value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psF64 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psMetadata* psMetadataLookupMetadata ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its metadata value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psMetadata*: Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psPtr psMetadataLookupPtr ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
void* : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psS16 psMetadataLookupS16 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psS16 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psS32 psMetadataLookupS32 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psS32 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psS64 psMetadataLookupS64 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psS64 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psS8 psMetadataLookupS8 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psS8 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psString psMetadataLookupStr ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its string value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psString: Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psTime* psMetadataLookupTime ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return it as a psTime pointer.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psTime: Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psU16 psMetadataLookupU16 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psU16 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psU32 psMetadataLookupU32 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psU32 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psU64 psMetadataLookupU64 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psU64 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psU8 psMetadataLookupU8 ( bool *  status,
const psMetadata md,
const char *  key 
)

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psU8 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

bool psMetadataPrint ( FILE *  fd,
const psMetadata md,
int  level 
)

Prints metadata collection.

Metadata contents are printed to a valid file descriptor if one exists. Otherwise, fd should be NULL and the contents are printed to the screen (stdout).

Returns:
bool: True if successful, otherwise false.
Parameters:
fd  File Descriptor or NULL
md  Metadata collection to print.
level  the level of metadata items.

bool psMetadataRemoveIndex ( psMetadata md,
long  location 
)

Removes an item from metadata by index number.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to remove metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL

bool psMetadataRemoveKey ( psMetadata md,
const char *  key 
)

Removes an item from metadata by key name.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to remove metadata item.
key  Name of metadata key.

psPixels* psPixelsAlloc ( long  nalloc  ) 

Allocates a new psPixels structure.

Returns:
psPixels* new psPixels
Parameters:
nalloc  the size of the coordinate vectors

psPixels* psPixelsConcatenate ( psPixels out,
const psPixels pixels 
)

Concatenates two psPixels.

psPixelsConcatenate shall concatenate pixels onto out. In the event that out is NULL, a new psPixels shall be allocated, and the contents of pixels simply copied in. If pixels is NULL, the function shall generate an error and return NULL. The function shall take care to ensure that there are no duplicate pixels in out.

Returns:
psPixels Concatenated psPixel list
Parameters:
out  psPixels to recycle, or NULL
pixels  psPixels to append to OUT

psPixels* psPixelsCopy ( psPixels out,
const psPixels pixels 
)

Copies a psPixels object.

Makes a deep copy of the data in a psPixels object. Any data in the OUT parameter will be destroyed and OUT will be resized, if necessary.

Returns:
psPixels* a new psPixels that is a duplicate to IN
Parameters:
out  psPixels struct to recycle, or NULL
pixels  psPixels struct to copy

psPixels* psPixelsFromMask ( psPixels out,
const psImage mask,
psMaskType  maskVal 
)

Generate a psPixels from a mask psImage.

psMaskToPixels shall return a psPixels consisting of the coordinates in the mask that match the maskVal. The out pixel list shall be modified if supplied, or allocated and returned if NULL. In hte event that mask is NULL, the function shall generate an error and return NULL.

Returns:
psPixels* generated psPixels pixel list
Parameters:
out  psPixels to recycle, or NULL
mask  the input mask psImage
maskVal  the mask bit-values to act upon

psPixelCoord psPixelsGet ( const psPixels pixels,
long  position 
)

Returns the value of the pixels array at the specified position.

A negative position means index from the end.

Returns:
psPixelCoord: The value of the pixels at the specified position.
Parameters:
pixels  input pixels from which to get
position  position to get

long psPixelsLength ( const psPixels pixels  ) 

Get the number of elements in use from a specified psPixels.

(pixels.n)

Returns:
long: The number of elements in use.
Parameters:
pixels  input psPixels

psPixels* psPixelsRealloc ( psPixels pixels,
long  nalloc 
)

resizes a psPixels structure

Returns:
psPixels* resized psPixels
Parameters:
pixels  psPixels to resize, or NULL to create new psPixels
nalloc  the size of the coordinate vectors

bool psPixelsSet ( psPixels pixels,
long  position,
psPixelCoord  value 
)

Sets the value of the the pixels array at the specified position to value.

A negative position means index from the end.

Returns:
bool: True if Successful, otherwise false.
Parameters:
pixels  pixels to set
position  position to set
value  pixels value to be set

psImage* psPixelsToMask ( psImage out,
const psPixels pixels,
psRegion  region,
psMaskType  maskVal 
)

Generate a psImage from a psPixels.

psPixelsToMask shall return an image of type U8 with the pixels lying within the specified region set to the maskVal. The out image shall be modified if supplied, or allocated and returned if NULL. The size of the output image shall be region->x1 - region->x0 by region->y1 - region->y0, with out->x0 = region->x0 and out->y0 = region->y0. In the event that either of pixels or region are NULL, the function shall generate an error and return NULL.

Returns:
psImage* generated mask image
Parameters:
out  psImage to recycle, or NULL
pixels  list of pixels to use
region  region to define the output mask image
maskVal  the mask bit-values to act upon

psPolynomial1D* psPolynomial1DfromMetadata ( const psMetadata folder  ) 

Allocates a new psPolynomial1D structure with information from a psMetadata.

Parses a psMetadata container with psPolynomial1D information. The first two elements of the metadata folder specify the order of the x & y variables. (ie, NORDER_X, NORDER_Y). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). If the orders or any coefficients are missing or have incorrect syntax, NULL is returned.

Returns:
psPolynomial1D*: Newly allocated psPolynomial1D from metadata.
Parameters:
folder  folder containing the polynomial info.

bool psPolynomial1DtoMetadata ( psMetadata md,
const psPolynomial1D poly,
const char *  format,
  ... 
)

Stores the information from a psPolynomial1D structure in a psMetadata container.

Creates a psMetadata folder with psPolynomial1D information. The first two elements of the metadata folder specify the order of the x & y variables. (ie, NORDER_X, NORDER_Y). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). The input polynomial must be of ordinary type and have a valid name format. False is also returned if any inputs are NULL. *If a particular mask element is non-zero, that polynomial coefficient (and error) are skipped.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  Metadata container for polynomial storage.
poly  Polynomial information to be stored.
format  Name of polynomial folder.

psPolynomial2D* psPolynomial2DfromMetadata ( const psMetadata folder  ) 

Allocates a new psPolynomial2D structure with information from a psMetadata.

Parses a psMetadata container with psPolynomial2D information. The first two elements of the metadata folder specify the order of the x & y variables. (ie, NORDER_X, NORDER_Y). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). If the orders or any coefficients are missing or have incorrect syntax, NULL is returned.

Returns:
psPolynomial2D*: Newly allocated psPolynomial2D from metadata.
Parameters:
folder  folder containing the polynomial info.

bool psPolynomial2DtoMetadata ( psMetadata md,
const psPolynomial2D poly,
const char *  format,
  ... 
)

Stores the information from a psPolynomial2D structure in a psMetadata container.

Creates a psMetadata folder with psPolynomial2D information. The first two elements of the metadata folder specify the order of the x & y variables. (ie, NORDER_X, NORDER_Y). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). The input polynomial must be of ordinary type and have a valid name format. False is also returned if any inputs are NULL. *If a particular mask element is non-zero, that polynomial coefficient (and error) are skipped.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  Metadata container for polynomial storage.
poly  Polynomial information to be stored.
format  Name of polynomial folder.

psPolynomial3D* psPolynomial3DfromMetadata ( const psMetadata folder  ) 

Allocates a new psPolynomial3D structure with information from a psMetadata.

Parses a psMetadata container with psPolynomial3D information. The first three elements of the metadata folder specify the order of the x, y, & z variables. (ie, NORDER_X, NORDER_Y, NORDER_Z). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00, etc.). If the orders or any coefficients are missing or have incorrect syntax, NULL is returned.

Returns:
psPolynomial3D*: Newly allocated psPolynomial3D from metadata.
Parameters:
folder  folder containing the polynomial info.

bool psPolynomial3DtoMetadata ( psMetadata md,
const psPolynomial3D poly,
const char *  format,
  ... 
)

Stores the information from a psPolynomial3D structure in a psMetadata container.

Creates a psMetadata folder with psPolynomial3D information. The first three elements of the metadata folder specify the order of the x, y, & z variables. (ie, NORDER_X, NORDER_Y, NORDER_Z). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00, etc.). The input polynomial must be of ordinary type and have a valid name format. False is also returned if any inputs are NULL. *If a particular mask element is non-zero, that polynomial coefficient (and error) are skipped.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  Metadata container for polynomial storage.
poly  Polynomial information to be stored.
format  Name of polynomial folder.

psPolynomial4D* psPolynomial4DfromMetadata ( const psMetadata folder  ) 

Allocates a new psPolynomial4D structure with information from a psMetadata.

Parses a psMetadata container with psPolynomial4D information. The first four elements of the metadata folder specify the order of the x, y, z, & t variables. (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00_T00, ERR_X00_Y00_Z00_T00, etc.). If the orders or any coefficients are missing or have incorrect syntax, NULL is returned.

Returns:
psPolynomial4D*: Newly allocated psPolynomial4D from metadata.
Parameters:
folder  folder containing the polynomial info.

bool psPolynomial4DtoMetadata ( psMetadata md,
const psPolynomial4D poly,
const char *  format,
  ... 
)

Stores the information from a psPolynomial4D structure in a psMetadata container.

Creates a psMetadata folder with psPolynomial4D information. The first four elements of the metadata folder specify the order of the x, y, z, & t variables. (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T). The following elements are the values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00_T00, ERR_X00_Y00_Z00_T00, etc.). The input polynomial must be of ordinary type and have a valid name format. False is also returned if any inputs are NULL. *If a particular mask element is non-zero, that polynomial coefficient (and error) are skipped.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  Metadata container for polynomial storage.
poly  Polynomial information to be stored.
format  Name of polynomial folder.

psArray* psVectorsReadFromFile ( const char *  filename,
const char *  format 
)

Read vectors from file.

Read numeric vectors from ASCII text file

Returns:
psArray* New array of psVectors corresponding to the columns of the table
Parameters:
filename  File to be read
format  scanf-like format string


Generated on Fri Feb 2 22:25:50 2007 for pslib by  doxygen 1.5.1