NDPluginColorConvert Class Reference

Convert NDArrays from one NDColorMode to another. More...

#include <NDPluginColorConvert.h>

Inheritance diagram for NDPluginColorConvert:

NDPluginDriver asynNDArrayDriver

List of all members.

Public Member Functions

 NDPluginColorConvert (const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 Constructor for NDPluginColorConvert; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
void processCallbacks (NDArray *pArray)
 Callback function that is called by the NDArray driver with new NDArray data.
asynStatus drvUserCreate (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize)
 Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it.


Detailed Description

Convert NDArrays from one NDColorMode to another.

This plugin is as source of NDArray callbacks, passing the (possibly converted) NDArray data to clients that register for callbacks. The plugin currently supports the following conversions

If the conversion required by the input color mode and output color mode are not in this supported list then the NDArray is passed on without conversion.

Constructor & Destructor Documentation

NDPluginColorConvert::NDPluginColorConvert ( const char *  portName,
int  queueSize,
int  blockingCallbacks,
const char *  NDArrayPort,
int  NDArrayAddr,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)

Constructor for NDPluginColorConvert; most parameters are simply passed to NDPluginDriver::NDPluginDriver.

After calling the base class constructor this method sets reasonable default values for all of the ROI parameters.

Parameters:
[in] portName The name of the asyn port driver to be created.
[in] queueSize The number of NDArrays that the input queue for this plugin can hold when NDPluginDriverBlockingCallbacks=0. Larger queues can decrease the number of dropped arrays, at the expense of more NDArray buffers being allocated from the underlying driver's NDArrayPool.
[in] blockingCallbacks Initial setting for the NDPluginDriverBlockingCallbacks flag. 0=callbacks are queued and executed by the callback thread; 1 callbacks execute in the thread of the driver doing the callbacks.
[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.


Member Function Documentation

asynStatus NDPluginColorConvert::drvUserCreate ( asynUser *  pasynUser,
const char *  drvInfo,
const char **  pptypeName,
size_t *  psize 
) [virtual]

Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it.

If the parameter is not recognized by this class then calls NDPluginDriver::drvUserCreate. Uses asynPortDriver::drvUserCreateParam.

Parameters:
[in] pasynUser pasynUser structure that driver modifies
[in] drvInfo String containing information about what driver function is being referenced
[out] pptypeName Location in which driver puts a copy of drvInfo.
[out] psize Location where driver puts size of param
Returns:
Returns asynSuccess if a matching string was found, asynError if not found.

Reimplemented from NDPluginDriver.

void NDPluginColorConvert::processCallbacks ( NDArray pArray  )  [virtual]

Callback function that is called by the NDArray driver with new NDArray data.

Looks for the NDArray attribute called "ColorMode" to determine the color mode of the input array. Uses the parameter NDPluginColorConvertColorModeOut to determine the desired color mode of the output array. The NDArray is converted between these color modes if possible. If not the input array is passed on without being changed. Does callbacks to all registered clients on the asynGenericPointer interface with the output array.

Parameters:
[in] pArray The NDArray from the callback.

Reimplemented from NDPluginDriver.


The documentation for this class was generated from the following files:

Generated on Tue Aug 25 16:53:04 2009 for areaDetector by  doxygen 1.5.7.1