# areaDetector Plugin NDPluginColorConvert

## August 17, 2009

## Mark Rivers

## University of Chicago

## Contents

- Overview
- Configuration
- Screen shots
- Restrictions

## Overview

NDPluginColorConvert is a tool for converting the color mode of NDArray data. It receives an input NDArray with one color mode and outputs another NDArray with a (potentially) different color mode. All other attributes of the array are preserved.

NDPluginColorConvert inherits from NDPluginDriver. The NDPluginColorConvert class documentation describes this class in detail.

NDPluginColorConvert defines the following parameters. It also implements all of the standard plugin parameters from NDPluginDriver . The EPICS database NDColorConvert.template provides access to these parameters, listed in the following table.

Parameter Definitions in NDPluginColorConvert.h and EPICS Record Definitions in NDColorConvert.template
Parameter index variable | asyn interface | Access | Description | drvInfo string | EPICS record name | EPICS record type
--- | --- | --- | --- | --- | --- | ---
NDPluginColorConvertColorModeOut | asynInt32 | r/w | The output color mode (NDColorMode_t). | COLOR_MODE_OUT | $(P)$(R)ColorModeOut $(P)$(R)ColorModeOut_RBV | mbbo mbbi

NDPluginColorConvert currently supports the following conversions:

- Bayer to RGB1, RGB2, or RGB3
- RGB1 to RGB2 or RGB3
- RGB2 to RGB1 or RGB3
- RGB3 to RGB1 or RGB2

The Bayer color conversion supports the 4 Bayer formats (NDBayerRGGB, NDBayerGBRG, NDBayerGRBG, NDBayerBGGR) defined in NDArray.h. If the input color mode and output color mode are not one of these supported conversion combinations then the output array is simply a copy of the input array and no conversion is performed.

## Configuration

The NDPluginColorConvert plugin is created with the following command, either from C/C++ or from the EPICS IOC shell.

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

For details on the meaning of the parameters to this function refer to the detailed documentation on the NDColorConvertConfigure function in the NDPluginColorConvert.cpp documentation and in the documentation for the constructor for the NDPluginColorConvert class.

## Screen shots

The following is the MEDM screen that provides access to the parameters in NDPluginDriver.h and NDPluginColorConvert.h through records in NDPluginBase.template and NDColorConvert.template.

### NDColorConvert.adl

## Restrictions

- The Bayer color conversion is done using a library function provided in the Prosilica library. The source code for this function is not provided, and the binaries are only available on Linux and Windows.
- YUV color conversion is not supported. This may be added in a future release.