From c215893c6717108e95d6dfd3a7d7bb128bee3b1a Mon Sep 17 00:00:00 2001 From: rivers Date: Sun, 8 Jun 2008 04:28:25 +0000 Subject: [PATCH] More work done git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@7389 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b --- documentation/areaDetectorDoc.html | 117 ++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 1 deletion(-) diff --git a/documentation/areaDetectorDoc.html b/documentation/areaDetectorDoc.html index b51751e..5e072ca 100755 --- a/documentation/areaDetectorDoc.html +++ b/documentation/areaDetectorDoc.html @@ -434,9 +434,124 @@ number, and the asyn address to match.

NDArray

-The NDArray (N-Dimensional array) is the class that is used for passing image +The NDArray (N-Dimensional array) is the class that is used for passing detector data from drivers +to plugins. The NDArray class is defined as follows: +
+#define ND_ARRAY_MAX_DIMS 10
 
+typedef enum
+{
+    NDInt8,
+    NDUInt8,
+    NDInt16,
+    NDUInt16,
+    NDInt32,
+    NDUInt32,
+    NDFloat32,
+    NDFloat64
+} NDDataType_t;
+
+typedef struct NDDimension {
+    int size;
+    int offset;
+    int binning;
+    int reverse;
+} NDDimension_t;
+
+typedef struct NDArrayInfo {
+    int nElements;
+    int bytesPerElement;
+    int totalBytes;
+} NDArrayInfo_t;
+
+class NDArray {
+public:
+    /* Data: NOTE this must come first because ELLNODE must be first, i.e. same address as object */
+    /* The first 2 fields are used for the freelist */
+    ELLNODE node;
+    int referenceCount;
+    /* The NDArrayPool object that created this array */
+    void *owner;
+
+    int uniqueId;
+    double timeStamp;
+    int ndims;
+    NDDimension_t dims[ND_ARRAY_MAX_DIMS];
+    NDDataType_t dataType;
+    int dataSize;
+    void *pData;
+
+    /* Methods */
+    NDArray();
+    int          initDimension   (NDDimension_t *pDimension, int size);
+    int          getInfo         (NDArrayInfo_t *pInfo);
+    int          convertDimension(NDArray *pOut,
+                                  void *pDataIn,
+                                  void *pDataOut,
+                                  int dim);
+    int          copy            (NDArray *pOut);
+    int          reserve(); 
+    int          release();
+};
+
+An NDArray is a general purpose class for handling array data. An NDArray object is self-describing, +meaning it contains enough information to describe the data itself. It is not intended to +contain meta-data describing how the data was collected, etc. +

+An NDArray can have up to ND_ARRAY_MAX_DIMS dimensions, currently 10. A fixed maximum +number of dimensions is used to significantly simplify the code compared to +unlimited number of dimensions. Each dimension of the array is described +by an NDDimension_t structure. The fields in NDDimension_t are as follows: + +

+The first 3 data fields in the NDArray class, (node, referenceCount, owner) are used +by the NDArrayPool class discussed below. +The remaining data fields are as follows: + +The methods of the NDArray class are: + +