areaDetector  3-5-0
EPICS areaDetector framework
NDPluginCodec.h
Go to the documentation of this file.
1 #ifndef NDPluginCodec_H
2 #define NDPluginCodec_H
3 
4 #include <epicsTypes.h>
5 
6 #include "NDPluginDriver.h"
7 
8 #define NDCodecModeString "MODE" /* (NDCodecMode_t r/w) Mode: Compress/Decompress */
9 #define NDCodecCompressorString "COMPRESSOR" /* (NDCodecCompressor_t r/w) Which codec to use */
10 #define NDCodecCompFactorString "COMP_FACTOR" /* (double r/o) Compression percentage (0 = no compression) */
11 #define NDCodecCodecStatusString "CODEC_STATUS" /* (int r/o) Compression status: success or failure */
12 #define NDCodecCodecErrorString "CODEC_ERROR" /* (string r/o) Error message if compression fails */
13 #define NDCodecJPEGQualityString "JPEG_QUALITY" /* (int r/w) JPEG Compression quality */
14 #define NDCodecBloscCompressorString "BLOSC_COMPRESSOR" /* (NDCodecBloscComp_t r/w) Which Blosc compressor to use */
15 #define NDCodecBloscCLevelString "BLOSC_CLEVEL" /* (int r/w) Blosc compression level */
16 #define NDCodecBloscShuffleString "BLOSC_SHUFFLE" /* (bool r/w) Should Blosc apply shuffling? */
17 #define NDCodecBloscNumThreadsString "BLOSC_NUMTHREADS" /* (int r/w) Number of threads to be used by Blosc */
18 
30 typedef enum {
34 
35 typedef enum {
43 
44 typedef enum {
49 
50 
51 /*
52  * The [de]compress* functions below take an input array and return a
53  * pool-allocated output array on success or NULL on error. They are
54  * thread-safe.
55  */
56 
57 NDArray *compressJPEG(NDArray *input, int quality, NDCodecStatus_t *status, char *errorMessage);
58 NDArray *decompressJPEG(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
59 
60 NDArray *compressBlosc(NDArray *input, int clevel, int shuffle, NDCodecBloscComp_t compressor,
61  int numThreads, NDCodecStatus_t *status, char *errorMessage);
62 NDArray *decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status, char *errorMessage);
63 NDArray *compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
64 NDArray *decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
65 NDArray *compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
66 NDArray *decompressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
67 
68 
69 class epicsShareClass NDPluginCodec : public NDPluginDriver {
70 public:
71  NDPluginCodec(const char *portName, int queueSize, int blockingCallbacks,
72  const char *NDArrayPort, int NDArrayAddr,
73  int maxBuffers, size_t maxMemory,
74  int priority, int stackSize, int maxThreads);
75 
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_NDCODEC_PARAM NDCodecMode
92 
93 };
94 
95 #endif
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:56
int NDCodecCodecStatus
Definition: NDPluginCodec.h:85
Definition: NDPluginCodec.h:40
Definition: NDPluginCodec.h:46
NDArray * decompressJPEG(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:340
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:684
int NDCodecCodecError
Definition: NDPluginCodec.h:86
NDArray * compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:614
NDCodecBloscComp_t
Definition: NDPluginCodec.h:35
Definition: NDPluginCodec.h:36
list value
Definition: makeDbAndEdl.py:234
Definition: NDPluginCodec.h:31
int NDCodecCompressor
Definition: NDPluginCodec.h:83
int NDCodecBloscCLevel
Definition: NDPluginCodec.h:89
NDArray * compressBlosc(NDArray *input, int clevel, int shuffle, NDCodecBloscComp_t compressor, int numThreads, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:445
Definition: NDPluginCodec.h:69
Definition: NDPluginCodec.h:38
NDArray * decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:453
NDArray * decompressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:635
NDCodecMode_t
Compress/decompress NDArrays according to available codecs.
Definition: NDPluginCodec.h:30
NDArray * compressJPEG(NDArray *input, int quality, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:334
int NDCodecJPEGQuality
Definition: NDPluginCodec.h:87
int NDCodecBloscShuffle
Definition: NDPluginCodec.h:90
int NDCodecBloscCompressor
Definition: NDPluginCodec.h:88
Definition: NDPluginCodec.h:37
virtual void processCallbacks(NDArray *pArray)=0
NDCodecStatus_t
Definition: NDPluginCodec.h:44
NDArray * decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:621
int NDCodecMode
Definition: NDPluginCodec.h:81
NDArray * compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:628
Definition: NDPluginCodec.h:39
int NDCodecCompFactor
Definition: NDPluginCodec.h:84
Definition: NDPluginCodec.h:32
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
Definition: NDPluginCodec.h:41
int NDCodecBloscNumThreads
Definition: NDPluginCodec.h:91
Definition: NDPluginCodec.h:45
Definition: NDPluginCodec.h:47