Changeset 206
- Timestamp:
- Mar 10, 2004, 12:07:04 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 3 edited
-
psImages.h (modified) (1 diff)
-
psMath.h (modified) (1 diff)
-
psStdArrays.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psImages.h
r198 r206 11 11 */ 12 12 13 /// image data type names.14 typedef enum {15 PS_U8 = 1,16 PS_U16 = 2,17 PS_U32 = 3,18 PS_F32 = 4,19 PS_F64 = 5,20 } PS_IMAGE_DEPTH;21 22 PS_DECLARE_ARRAY_TYPE(psFloatArray); ///< Declare an array of real vectors (psFloatArrayArray).23 24 typedef unsigned char psU8; ///< BITPIX 8 (unsigned short)25 typedef unsigned short psU16; ///< BITPIX 16 (unsigned int)26 typedef unsigned long psU32; ///< BITPIX 32 (unsigned long)27 typedef float psF32; ///< BITPIX -32 (float)28 typedef double psF64; ///< BITPIX -64 (double)29 30 13 /// basic image data structure. 31 14 typedef struct psImage { 15 psType type; ///< image data type and dimension 32 16 int nx, ny; ///< size of image 33 17 int x0, y0; ///< data region relative to parent 34 PS_IMAGE_DEPTH depth; ///< type of image35 18 psF32 **rows; ///< == rows_f32 36 19 psU8 **rows_u8; ///< pointers to psU8 data -
trunk/archive/pslib/include/psMath.h
r204 r206 83 83 84 84 /** for a set of N data types, you need a collection of N^2 - 1 functions **/ 85 86 /*** example 3: embedded data type */ 87 88 psImage A, B, Y; 89 90 B = psBinaryOp (NULL, A, "^", psScalar(2)); 91 Y = psUnaryOp (NULL, B, "log"); 92 93 /** in this method, the data types (psImage, psVector) include embedded information about their data type in 94 * the structure. The constant value is then handled by calling the psScalar function which returns a private 95 * scalar data type which is always freed by the code. This forces the layout of the data structures to be 96 * consistent, with the type information as the first entry. We can then define a data type which is 97 * completely flat and can be used to check on the data type of the data. 98 */ 99 100 typedef struct { 101 psTypeInfo type; 102 union { 103 int i; 104 float f; 105 double d; 106 } 107 } p_psScalar; 108 109 typedef struct { 110 psType type; 111 psDimension dim; 112 } psTypeInfo; -
trunk/archive/pslib/include/psStdArrays.h
r205 r206 38 38 * generally. 39 39 */ 40 typedef float psFloat; 41 typedef int psInt; 42 typedef complex float psComplex; 43 typedef double psDouble; 40 typedef float psFloat; ///< BITPIX -32 (float) 41 typedef float psF32; ///< BITPIX -32 (float) 42 typedef double psDouble; 43 typedef double psF64; ///< BITPIX -64 (double) 44 45 typedef complex float psComplex; 46 47 typedef int8_t psS8; 48 typedef int16_t psS16; 49 typedef int32_t psS32; 50 typedef int64_t psS64; 51 typedef int8_t psChar; 52 typedef int16_t psShort; 53 typedef int32_t psInt; 54 typedef int64_t psLong; 55 56 typedef uint8_t psU8; ///< BITPIX 8 57 typedef uint16_t psU16; ///< BITPIX 16 58 typedef uint32_t psU32; ///< BITPIX 32 59 typedef uint64_t psU64; 60 typedef uint8_t psUchar; ///< BITPIX 8 61 typedef uint16_t psUshort; ///< BITPIX 16 62 typedef uint32_t psUint; ///< BITPIX 32 63 typedef uint64_t psUlong; 44 64 45 65 /** An array of real numbers */ … … 52 72 /** An array of complex numbers */ 53 73 PS_DECLARE_ARRAY_TYPE(psComplex); 54 PS_CREATE_ARRAY_TYPE(psComplex);55 74 56 75 /** An array of integers */ 57 76 PS_DECLARE_ARRAY_TYPE(psInt); 58 PS_CREATE_ARRAY_TYPE(psInt);59 77 60 78 /** An array of double-precision real numbers */ 61 79 PS_DECLARE_ARRAY_TYPE(psDouble); 62 PS_CREATE_ARRAY_TYPE(psDouble); 80 81 PS_DECLARE_ARRAY_TYPE(psFloatArray); ///< Declare an array of real vectors (psFloatArrayArray). 63 82 64 83 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
