areaDetector  3-14
EPICS areaDetector framework
NDPluginOverlay.h
Go to the documentation of this file.
1 #ifndef NDPluginOverlay_H
2 #define NDPluginOverlay_H
3 
4 #include <vector>
5 #include <algorithm>
6 #include "NDPluginDriver.h"
7 
8 typedef enum {
14 
15 typedef enum {
19 
20 typedef struct {
21  std::vector<int> addressOffset;
22  bool changed;
26 
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];
46 
47 
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 */
68 
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);
79 
80 protected:
82  #define FIRST_NDPLUGIN_OVERLAY_PARAM NDPluginOverlayMaxSizeX
102 
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 };
112 
113 #endif
#define NDPLUGIN_API
Definition: NDPluginAPI.h:41
NDOverlayDrawMode_t
Definition: NDPluginOverlay.h:15
@ NDOverlayXOR
Definition: NDPluginOverlay.h:17
@ NDOverlaySet
Definition: NDPluginOverlay.h:16
NDOverlayShape_t
Definition: NDPluginOverlay.h:8
@ NDOverlayEllipse
Definition: NDPluginOverlay.h:12
@ NDOverlayCross
Definition: NDPluginOverlay.h:9
@ NDOverlayRectangle
Definition: NDPluginOverlay.h:10
@ NDOverlayText
Definition: NDPluginOverlay.h:11
struct NDOverlay NDOverlay_t
Structure defining an overlay.
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:57
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:678
virtual void processCallbacks(NDArray *pArray)=0
Overlay graphics on top of an image.
Definition: NDPluginOverlay.h:70
int NDPluginOverlayMaxSizeX
Definition: NDPluginOverlay.h:81
int NDPluginOverlayRed
Definition: NDPluginOverlay.h:96
int NDPluginOverlayWidthY
Definition: NDPluginOverlay.h:93
int NDPluginOverlayFont
Definition: NDPluginOverlay.h:100
int NDPluginOverlayShape
Definition: NDPluginOverlay.h:94
int NDPluginOverlayWidthX
Definition: NDPluginOverlay.h:92
int NDPluginOverlayTimeStampFormat
Definition: NDPluginOverlay.h:99
int NDPluginOverlayPositionY
Definition: NDPluginOverlay.h:87
int NDPluginOverlayGreen
Definition: NDPluginOverlay.h:97
int NDPluginOverlayPositionX
Definition: NDPluginOverlay.h:86
int NDPluginOverlayDisplayText
Definition: NDPluginOverlay.h:101
int NDPluginOverlayUse
Definition: NDPluginOverlay.h:85
int NDPluginOverlaySizeY
Definition: NDPluginOverlay.h:91
int NDPluginOverlaySizeX
Definition: NDPluginOverlay.h:90
int NDPluginOverlayDrawMode
Definition: NDPluginOverlay.h:95
int NDPluginOverlayCenterX
Definition: NDPluginOverlay.h:88
int NDPluginOverlayCenterY
Definition: NDPluginOverlay.h:89
int NDPluginOverlayName
Definition: NDPluginOverlay.h:84
int NDPluginOverlayMaxSizeY
Definition: NDPluginOverlay.h:83
int NDPluginOverlayBlue
Definition: NDPluginOverlay.h:98
list value
Definition: makeDbAndEdl.py:234
Structure returned by NDArray::getInfo.
Definition: NDArray.h:78
Structure defining an overlay.
Definition: NDPluginOverlay.h:28
NDOverlayPvt_t pvt
Definition: NDPluginOverlay.h:44
NDOverlayDrawMode_t drawMode
Definition: NDPluginOverlay.h:37
int PositionX
Definition: NDPluginOverlay.h:30
int PositionY
Definition: NDPluginOverlay.h:31
int WidthY
Definition: NDPluginOverlay.h:35
int SizeX
Definition: NDPluginOverlay.h:32
int red
Definition: NDPluginOverlay.h:38
int green
Definition: NDPluginOverlay.h:39
int use
Definition: NDPluginOverlay.h:29
int Font
Definition: NDPluginOverlay.h:42
int WidthX
Definition: NDPluginOverlay.h:34
NDOverlayShape_t shape
Definition: NDPluginOverlay.h:36
char TimeStampFormat[64]
Definition: NDPluginOverlay.h:41
char DisplayText[256]
Definition: NDPluginOverlay.h:43
int SizeY
Definition: NDPluginOverlay.h:33
int blue
Definition: NDPluginOverlay.h:40
Definition: NDPluginOverlay.h:20
bool changed
Definition: NDPluginOverlay.h:22
bool freezePositionY
Definition: NDPluginOverlay.h:24
bool freezePositionX
Definition: NDPluginOverlay.h:23
std::vector< int > addressOffset
Definition: NDPluginOverlay.h:21