diff --git a/documentation/areaDetectorDoc.html b/documentation/areaDetectorDoc.html index d0fc018..48b0ade 100755 --- a/documentation/areaDetectorDoc.html +++ b/documentation/areaDetectorDoc.html @@ -7,7 +7,7 @@
The use of plugins is optional, and it is only plugins that require the driver to @@ -449,6 +456,8 @@ public: data from drivers to plugins. The NDArray class is defined as follows:
#define ND_ARRAY_MAX_DIMS 10
+#define ND_SUCCESS 0
+#define ND_ERROR -1
/* Enumeration of array data types */
typedef enum
@@ -463,6 +472,26 @@ typedef enum
NDFloat64
} NDDataType_t;
+/* Enumeration of color modes */
+typedef enum
+{
+ NDColorModeMono,
+ NDColorModeBayer,
+ NDColorModeRGB1,
+ NDColorModeRGB2,
+ NDColorModeRGB3,
+ NDColorModeYUV444,
+ NDColorModeYUV422,
+ NDColorModeYUV421
+} NDColorMode_t;
+
+typedef enum
+{
+ NDBayerRGGB = 0, /* First line RGRG, second line GBGB... */
+ NDBayerGBRG = 1, /* First line GBGB, second line RGRG... */
+ NDBayerGRBG = 2, /* First line GRGR, second line BGBG... */
+ NDBayerBGGR = 3 /* First line BGBG, second line GRGR... */
+} NDBayerPattern_t;
typedef struct NDDimension {
int size;
@@ -491,6 +520,8 @@ public:
int ndims;
NDDimension_t dims[ND_ARRAY_MAX_DIMS];
NDDataType_t dataType;
+ NDColorMode_t colorMode;
+ NDBayerPattern_t bayerPattern;
int dataSize;
void *pData;
@@ -498,12 +529,9 @@ public:
NDArray();
int initDimension (NDDimension_t *pDimension, int size);
int getInfo (NDArrayInfo_t *pInfo);
- int copy (NDArray *pOut);
int reserve();
int release();
};
-
-
An NDArray is a general purpose class for handling array data. An NDArray object @@ -554,6 +582,41 @@ public:
dataType The data type of this array, one of the NDDataType_t enum
values. The data types supported are signed and unsigned 8, 16, and 32-bit integers,
and 32 and 64-bit floats. colorMode The color mode this array, one of the NDColorMode_t enum
+ values. The following are the supported color modes:
+ NDColorModeMono: Monochromatic data, i.e. a single value at each
+ pixel.NDColorModeBayer: Bayer color. There is a single value at each pixel,
+ but the pixels have a color filter array in front of them. The supported Bayer filter
+ is the most common one, a repeating 2x2 array of
+ + Blue Green + Green Red ++ Transmitting data from the camera using the Bayer format consumes 3 times less bandwidth + than transmitting one of the RGB formats. However, it requires more computation + on the host to convert the data to an RGB format that most clients can display.
NDColorModeRGB1: Red, green, blue data with pixel interlace, i.e.
+ the data array is [3, NX, NY], with the color being the fastest varying array index.NDColorModeRGB2: Red, green, blue data with row interlace, i.e. the
+ data array is [NX, 3, NY], with the color being the second fastest varying array
+ index.NDColorModeRGB3: Red, green, blue data with planar interlace, i.e.
+ the data array is [NX, NY, 3], with the color being the slowest varying array index.NDColorModeYUV444: YUV data with 96 bits for 4 pixels, or 24 bits
+ per pixel. This is the same number of bits as 8-bit RGB.NDColorModeYUV422: YUV data with 64 bits for 4 pixels, or 16 bits
+ per pixel. This is 2/3 of the number of bits required for 8-bit RGB.NDColorModeYUV421: YUV data with 48 bits for 4 pixels, or 12 bits
+ per pixel. This is 1/2 of the number of bits required for 8-bit RGB.bayerPattern The Bayer pattern for this array, one of the NDBayerPattern_t
+ enum values. This value is only meaningful if colorMode is NDColorModeBayer. The
+ Bayer pattern values are explained in the comments above. This value is needed because
+ the Bayer pattern will change when reading out a subset of the chip, for example
+ if the X or Y offset values are not even numbers.dataSize The size of the memory buffer pointed to by pData
in bytes. This may be larger than the amount actually required to hold the data
for this array.getInfo. This convenience method returns information about an NDArray,
including the total number of elements, the number of byte per element, and the
total number of bytes in the array.copy. This method makes a copy of an NDArray object. If the output
- array pointer is NULL then it is first allocated. If the output array object already
- exists (pOut!=NULL) then it must have sufficient memory allocated to it to hold
- the data.reserve. This method calls NDArrayPool->reserve() for this object.
It increases the reference count for this array.release. This method calls NDArrayPool->release() for this object.
@@ -594,13 +653,14 @@ public:
public:
NDArrayPool (int maxBuffers, size_t maxMemory);
NDArray* alloc (int ndims, int *dims, NDDataType_t dataType, int dataSize, void *pData);
+ NDArray* copy (NDArray *pIn, NDArray *pOut, int copyData);
int reserve (NDArray *pArray);
int release (NDArray *pArray);
int convert (NDArray *pIn,
NDArray **ppOut,
NDDataType_t dataTypeOut,
NDDimension_t *outDims);
- int report (int details);
+ int report (int details);
The methods of the NDArrayPool class are: @@ -608,8 +668,10 @@ public:
NDArrayPool This is the constructor for the class. The maxBuffers
argument is the maximum number of NDArray objects that the pool is allowed to contain.
+ If this value is negative then there is no limit on the number of NDArray objects.
The maxMemory argument is the maxiumum number of bytes of memory the the pool is
- allowed to use, summed over all of the NDArray objects.alloc This method allocates a new NDArray object. The first 3 arguments
are required. ndims is the number of dimensions in the NDArray. dims is an array
of dimensions, whose size must be at least ndims. dataType is the data type of the
@@ -625,6 +687,12 @@ public:
NDArray would cause the cumulative memory allocated for the pool to exceed maxMemory
then an error will be returned. alloc() sets the reference count for the returned
NDArray to 1.copy. This method makes a copy of an NDArray object. If the output
+ array pointer is NULL then it is first allocated. If the output array object already
+ exists (pOut!=NULL) then it must have sufficient memory allocated to it to hold
+ the data. If the copyData flag is 1 then the array data is copied. If the copyData
+ flag is 0 then all array fields except the data itself are copied, and the data
+ will be initialized to 0.reserve. This method increases the reference count for the NDArray
object. Plugins must call reserve() when an NDArray is placed on a queue for later
processing.setShutter This method will open (1) or close (0) the shutter if
- ADShutterMode==ADShutterModeEPICS. Drivers will implement setShutter if they support
- ADShutterModeDetector. If ADShutterMode=ADShutterModeDetector they will control
+ ADShutterMode==ADShutterModeEPICS. Drivers will implement setShutter if they support
+ ADShutterModeDetector. If ADShutterMode=ADShutterModeDetector they will control
the shutter directly, else they will call this method.In addition to these drivers, Brian Tieman from the APS is writing a driver for - the Perkin-Elmer flat-panel amorphous silicon detector. Ulrik Pedersen from Diamond - is writing a driver for the Flea Firewire cameras. I plan to write a driver for - the MAR-345 online image plate.
+ the Perkin-Elmer flat-panel amorphous silicon detector. I plan to write a driver + for the MAR-345 online image plate.