Changeset 247 for trunk/archive/pslib/include/psMath.h
- Timestamp:
- Mar 15, 2004, 3:20:03 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psMath.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psMath.h
r238 r247 2 2 #define PS_MATH_H 3 3 4 /** in this method, the data types (psImage, psVector) include embedded information about their data type in 5 * the structure. The constant value is then handled by calling the psScalar function which returns a private 6 * scalar data type which is always freed by the code. This forces the layout of the data structures to be 7 * consistent, with the type information as the first entry. We can then define a data type which is 8 * completely flat and can be used to check on the data type of the data. 4 /** \file psMath.h 5 * \brief math operators between PSLib data types 6 * \ingroup MathGroup 9 7 */ 8 9 /** private structure used to pass constant values into the math operators. */ 10 typedef struct { 11 psType type; ///< data type information 12 union { 13 int i; ///< integer value entry 14 float f; ///< float value entry 15 double d; ///< double value entry 16 complex float c; ///< complex value entry 17 } 18 } p_psScalar; 10 19 11 20 /** Perform a binary operation on two data items (psImage, psVector, psScalar). */ … … 24 33 ); 25 34 26 /** create a psType-ed structure from a constant value. */35 /** create a psType-ed structure from a constant double value. */ 27 36 p_ps_Scalar * 28 37 psScalar (double value); … … 34 43 ); 35 44 36 typedef struct { 37 psType type; 38 union { 39 int i; 40 float f; 41 double d; 42 complex float c; 43 } 44 } p_psScalar; 45 /** the functions defined here can operate on the basic PSLib data types: psImage, psVector, XXX. These data 46 * types include embedded information about their type in the structure. Constant values are handled by 47 * wrapping the value in the psScalar function, which returns a private scalar data type, p_ps_Scalar, which 48 * is always freed by the function. The return value type can be determined by casting the return to psType 49 * and checking the type entry. 50 */ 45 51 46 52 /* examples of usage: … … 66 72 67 73 */ 68 69 74 70 75 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
