Index: /trunk/archive/pslib/include/psImages.h
===================================================================
--- /trunk/archive/pslib/include/psImages.h	(revision 205)
+++ /trunk/archive/pslib/include/psImages.h	(revision 206)
@@ -11,26 +11,9 @@
  */
 
-/// image data type names.
-typedef enum { 
-    PS_U8  = 1, 
-    PS_U16 = 2, 
-    PS_U32 = 3, 
-    PS_F32 = 4, 
-    PS_F64 = 5, 
-} PS_IMAGE_DEPTH;
-
-PS_DECLARE_ARRAY_TYPE(psFloatArray);	///< Declare an array of real vectors (psFloatArrayArray).
-
-typedef unsigned char  psU8;		///< BITPIX 8   (unsigned short)
-typedef unsigned short psU16;		///< BITPIX 16  (unsigned int)
-typedef unsigned long  psU32;		///< BITPIX 32  (unsigned long)
-typedef float          psF32;		///< BITPIX -32 (float)
-typedef double         psF64;		///< BITPIX -64 (double)
-
 /// basic image data structure.
 typedef struct psImage {
+    psType type; 			///< image data type and dimension
     int nx, ny;				///< size of image 
     int x0, y0;				///< data region relative to parent 
-    PS_IMAGE_DEPTH depth;		///< type of image 
     psF32 **rows;		        ///< == rows_f32 
     psU8  **rows_u8;			///< pointers to psU8 data 
Index: /trunk/archive/pslib/include/psMath.h
===================================================================
--- /trunk/archive/pslib/include/psMath.h	(revision 205)
+++ /trunk/archive/pslib/include/psMath.h	(revision 206)
@@ -83,2 +83,30 @@
 
 /** for a set of N data types, you need a collection of N^2 - 1 functions **/
+
+/*** example 3: embedded data type */
+
+psImage A, B, Y;
+
+B = psBinaryOp (NULL, A, "^", psScalar(2));
+Y = psUnaryOp (NULL, B, "log");
+
+/** in this method, the data types (psImage, psVector) include embedded information about their data type in
+ * the structure.  The constant value is then handled by calling the psScalar function which returns a private
+ * scalar data type which is always freed by the code.  This forces the layout of the data structures to be
+ * consistent, with the type information as the first entry.  We can then define a data type which is
+ * completely flat and can be used to check on the data type of the data.
+ */
+
+typedef struct {
+    psTypeInfo type;
+    union {
+	int i;
+	float f;
+	double d;
+    }
+} p_psScalar;
+
+typedef struct {
+    psType type;
+    psDimension dim;
+} psTypeInfo;
Index: /trunk/archive/pslib/include/psStdArrays.h
===================================================================
--- /trunk/archive/pslib/include/psStdArrays.h	(revision 205)
+++ /trunk/archive/pslib/include/psStdArrays.h	(revision 206)
@@ -38,8 +38,28 @@
  * generally.
  */
-typedef float psFloat;
-typedef int psInt;
-typedef complex float psComplex;
-typedef double psDouble;
+typedef float          psFloat;         ///< BITPIX -32 (float)
+typedef float          psF32;		///< BITPIX -32 (float)
+typedef double         psDouble;
+typedef double         psF64;		///< BITPIX -64 (double)
+
+typedef complex float  psComplex;
+
+typedef int8_t         psS8;
+typedef int16_t        psS16;
+typedef int32_t        psS32;
+typedef int64_t        psS64;
+typedef int8_t         psChar;
+typedef int16_t        psShort;
+typedef int32_t        psInt;
+typedef int64_t        psLong;
+
+typedef uint8_t        psU8;		///< BITPIX 8   
+typedef uint16_t       psU16;		///< BITPIX 16  
+typedef uint32_t       psU32;		///< BITPIX 32  
+typedef uint64_t       psU64;		
+typedef uint8_t        psUchar;		///< BITPIX 8   
+typedef uint16_t       psUshort;	///< BITPIX 16  
+typedef uint32_t       psUint;		///< BITPIX 32  
+typedef uint64_t       psUlong;		
 
 /** An array of real numbers */
@@ -52,13 +72,12 @@
 /** An array of complex numbers */
 PS_DECLARE_ARRAY_TYPE(psComplex);
-PS_CREATE_ARRAY_TYPE(psComplex);
 
 /** An array of integers */
 PS_DECLARE_ARRAY_TYPE(psInt);
-PS_CREATE_ARRAY_TYPE(psInt);
 
 /** An array of double-precision real numbers */
 PS_DECLARE_ARRAY_TYPE(psDouble);
-PS_CREATE_ARRAY_TYPE(psDouble);
+
+PS_DECLARE_ARRAY_TYPE(psFloatArray);	///< Declare an array of real vectors (psFloatArrayArray).
 
 #endif
