areaDetector  3-12-1
EPICS areaDetector framework
Go to the documentation of this file.
1 #ifndef NDPluginOverlay_H
2 #define NDPluginOverlay_H
4 #include <vector>
5 #include <algorithm>
6 #include "NDPluginDriver.h"
8 typedef enum {
15 typedef enum {
20 typedef struct {
21  std::vector<int> addressOffset;
22  bool changed;
28 typedef struct NDOverlay {
29  int use;
30  int PositionX;
31  int PositionY;
32  int SizeX;
33  int SizeY;
34  int WidthX;
35  int WidthY;
38  int red;
39  int green;
40  int blue;
41  char TimeStampFormat[64];
42  int Font;
43  char DisplayText[256];
45 } NDOverlay_t;
48 #define NDPluginOverlayMaxSizeXString "MAX_SIZE_X" /* (asynInt32, r/o) Maximum size of overlay in X dimension */
49 #define NDPluginOverlayMaxSizeYString "MAX_SIZE_Y" /* (asynInt32, r/o) Maximum size of overlay in Y dimension */
50 #define NDPluginOverlayNameString "NAME" /* (asynOctet, r/w) Name of this overlay */
51 #define NDPluginOverlayUseString "USE" /* (asynInt32, r/w) Use this overlay? */
52 #define NDPluginOverlayPositionXString "OVERLAY_POSITION_X" /* (asynInt32, r/w) X position (upper left) of overlay */
53 #define NDPluginOverlayPositionYString "OVERLAY_POSITION_Y" /* (asynInt32, r/w) Y position (upper left) of overlay */
54 #define NDPluginOverlayCenterXString "OVERLAY_CENTER_X" /* (asynInt32, r/w) X center of overlay */
55 #define NDPluginOverlayCenterYString "OVERLAY_CENTER_Y" /* (asynInt32, r/w) Y center of overlay */
56 #define NDPluginOverlaySizeXString "OVERLAY_SIZE_X" /* (asynInt32, r/o) X size of overlay */
57 #define NDPluginOverlaySizeYString "OVERLAY_SIZE_Y" /* (asynInt32, r/w) Y size of overlay */
58 #define NDPluginOverlayWidthXString "OVERLAY_WIDTH_X" /* (asynInt32, r/o) X width of overlay */
59 #define NDPluginOverlayWidthYString "OVERLAY_WIDTH_Y" /* (asynInt32, r/w) Y width of overlay */
60 #define NDPluginOverlayShapeString "OVERLAY_SHAPE" /* (asynInt32, r/w) Shape of overlay */
61 #define NDPluginOverlayDrawModeString "OVERLAY_DRAW_MODE" /* (asynInt32, r/w) Drawing mode for overlay */
62 #define NDPluginOverlayRedString "OVERLAY_RED" /* (asynInt32, r/w) Red value for overlay */
63 #define NDPluginOverlayGreenString "OVERLAY_GREEN" /* (asynInt32, r/w) Green value for overlay */
64 #define NDPluginOverlayBlueString "OVERLAY_BLUE" /* (asynInt32, r/w) Blue value for overlay */
65 #define NDPluginOverlayTimeStampFormatString "OVERLAY_TIMESTAMP_FORMAT" /* (asynOctet,r/w) Time stamp format */
66 #define NDPluginOverlayFontString "OVERLAY_FONT" /* (asynInt32, r/w) Type of Time Stamp to show (if any) */
67 #define NDPluginOverlayDisplayTextString "OVERLAY_DISPLAY_TEXT" /* (asynOctet, r/w) The text to display */
71 public:
72  NDPluginOverlay(const char *portName, int queueSize, int blockingCallbacks,
73  const char *NDArrayPort, int NDArrayAddr, int maxOverlays,
74  int maxBuffers, size_t maxMemory,
75  int priority, int stackSize, int maxThreads);
76  /* These methods override the virtual methods in the base class */
77  void processCallbacks(NDArray *pArray);
78  asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
80 protected:
82  #define FIRST_NDPLUGIN_OVERLAY_PARAM NDPluginOverlayMaxSizeX
103 private:
104  int maxOverlays_;
105  NDArrayInfo prevArrayInfo_;
106  std::vector<NDOverlay_t> prevOverlays_; /* Vector of NDOverlay structures */
107  inline void addPixel(NDOverlay_t *pOverlay, int ix, int iy, NDArrayInfo_t *pArrayInfo);
108  template <typename epicsType> void doOverlayT(NDArray *pArray, NDOverlay_t *pOverlay, NDArrayInfo_t *pArrayInfo);
109  int doOverlay(NDArray *pArray, NDOverlay_t *pOverlay, NDArrayInfo_t *pArrayInfo);
110  template <typename epicsType> void setPixel(epicsType *pValue, NDOverlay_t *pOverlay, NDArrayInfo_t *pArrayInfo);
111 };
113 #endif
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:58
int NDPluginOverlayUse
Definition: NDPluginOverlay.h:85
Definition: NDPluginOverlay.h:15
bool changed
Definition: NDPluginOverlay.h:22
std::vector< int > addressOffset
Definition: NDPluginOverlay.h:21
int NDPluginOverlayCenterX
Definition: NDPluginOverlay.h:88
int NDPluginOverlaySizeY
Definition: NDPluginOverlay.h:91
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:678
Definition: NDPluginOverlay.h:20
int NDPluginOverlayRed
Definition: NDPluginOverlay.h:96
int PositionX
Definition: NDPluginOverlay.h:30
int NDPluginOverlayMaxSizeY
Definition: NDPluginOverlay.h:83
Definition: NDPluginOverlay.h:11
Structure returned by NDArray::getInfo.
Definition: NDArray.h:73
int PositionY
Definition: NDPluginOverlay.h:31
NDOverlayDrawMode_t drawMode
Definition: NDPluginOverlay.h:37
int NDPluginOverlayWidthY
Definition: NDPluginOverlay.h:93
Definition: NDPluginOverlay.h:10
int red
Definition: NDPluginOverlay.h:38
int NDPluginOverlayMaxSizeX
Definition: NDPluginOverlay.h:81
list value
int NDPluginOverlayPositionX
Definition: NDPluginOverlay.h:86
int NDPluginOverlayTimeStampFormat
Definition: NDPluginOverlay.h:99
int NDPluginOverlayShape
Definition: NDPluginOverlay.h:94
Structure defining an overlay.
Definition: NDPluginOverlay.h:28
int NDPluginOverlayName
Definition: NDPluginOverlay.h:84
int NDPluginOverlayCenterY
Definition: NDPluginOverlay.h:89
int blue
Definition: NDPluginOverlay.h:40
int NDPluginOverlayGreen
Definition: NDPluginOverlay.h:97
int NDPluginOverlaySizeX
Definition: NDPluginOverlay.h:90
int use
Definition: NDPluginOverlay.h:29
int WidthX
Definition: NDPluginOverlay.h:34
Definition: NDPluginOverlay.h:17
int NDPluginOverlayDisplayText
Definition: NDPluginOverlay.h:101
int WidthY
Definition: NDPluginOverlay.h:35
bool freezePositionX
Definition: NDPluginOverlay.h:23
int SizeY
Definition: NDPluginOverlay.h:33
int NDPluginOverlayDrawMode
Definition: NDPluginOverlay.h:95
Definition: NDPluginOverlay.h:12
int green
Definition: NDPluginOverlay.h:39
virtual void processCallbacks(NDArray *pArray)=0
char TimeStampFormat[64]
Definition: NDPluginOverlay.h:41
bool freezePositionY
Definition: NDPluginOverlay.h:24
Definition: NDPluginAPI.h:41
Overlay graphics on top of an image.
Definition: NDPluginOverlay.h:70
int NDPluginOverlayWidthX
Definition: NDPluginOverlay.h:92
NDOverlayPvt_t pvt
Definition: NDPluginOverlay.h:44
Definition: NDPluginOverlay.h:8
NDOverlayShape_t shape
Definition: NDPluginOverlay.h:36
struct NDOverlay NDOverlay_t
Structure defining an overlay.
int Font
Definition: NDPluginOverlay.h:42
int SizeX
Definition: NDPluginOverlay.h:32
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:94
char DisplayText[256]
Definition: NDPluginOverlay.h:43
Definition: NDPluginOverlay.h:16
int NDPluginOverlayFont
Definition: NDPluginOverlay.h:100
int NDPluginOverlayPositionY
Definition: NDPluginOverlay.h:87
int NDPluginOverlayBlue
Definition: NDPluginOverlay.h:98
Definition: NDPluginOverlay.h:9