areaDetector  3-13
EPICS areaDetector framework
NDPluginCodec.h
Go to the documentation of this file.
1 #ifndef NDPluginCodec_H
2 #define NDPluginCodec_H
3 
4 #include "NDPluginDriver.h"
5 
6 #define NDCodecModeString "MODE" /* (NDCodecMode_t r/w) Mode: Compress/Decompress */
7 #define NDCodecCompressorString "COMPRESSOR" /* (NDCodecCompressor_t r/w) Which codec to use */
8 #define NDCodecCompFactorString "COMP_FACTOR" /* (double r/o) Compression percentage (0 = no compression) */
9 #define NDCodecCodecStatusString "CODEC_STATUS" /* (int r/o) Compression status: success or failure */
10 #define NDCodecCodecErrorString "CODEC_ERROR" /* (string r/o) Error message if compression fails */
11 #define NDCodecJPEGQualityString "JPEG_QUALITY" /* (int r/w) JPEG Compression quality */
12 #define NDCodecBloscCompressorString "BLOSC_COMPRESSOR" /* (NDCodecBloscComp_t r/w) Which Blosc compressor to use */
13 #define NDCodecBloscCLevelString "BLOSC_CLEVEL" /* (int r/w) Blosc compression level */
14 #define NDCodecBloscShuffleString "BLOSC_SHUFFLE" /* (bool r/w) Should Blosc apply shuffling? */
15 #define NDCodecBloscNumThreadsString "BLOSC_NUMTHREADS" /* (int r/w) Number of threads to be used by Blosc */
16 
28 typedef enum {
32 
33 typedef enum {
41 
42 typedef enum {
47 
48 
49 /*
50  * The [de]compress* functions below take an input array and return a
51  * pool-allocated output array on success or NULL on error. They are
52  * thread-safe.
53  */
54 
55 NDArray *compressJPEG(NDArray *input, int quality, NDCodecStatus_t *status, char *errorMessage);
56 NDArray *decompressJPEG(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
57 
58 NDArray *compressBlosc(NDArray *input, int clevel, int shuffle, NDCodecBloscComp_t compressor,
59  int numThreads, NDCodecStatus_t *status, char *errorMessage);
60 NDArray *decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status, char *errorMessage);
61 NDArray *compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
62 NDArray *decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
63 NDArray *compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
64 NDArray *decompressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage);
65 
66 
68 public:
69  NDPluginCodec(const char *portName, int queueSize, int blockingCallbacks,
70  const char *NDArrayPort, int NDArrayAddr,
71  int maxBuffers, size_t maxMemory,
72  int priority, int stackSize, int maxThreads);
73 
74  /* These methods override the virtual methods in the base class */
75  void processCallbacks(NDArray *pArray);
76  asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
77 
78 protected:
80  #define FIRST_NDCODEC_PARAM NDCodecMode
90 
91 };
92 
93 #endif
#define NDPLUGIN_API
Definition: NDPluginAPI.h:41
NDArray * compressJPEG(NDArray *input, int quality, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:328
NDArray * decompressBlosc(NDArray *input, int numThreads, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:447
NDArray * compressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:622
NDArray * compressBlosc(NDArray *input, int clevel, int shuffle, NDCodecBloscComp_t compressor, int numThreads, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:439
NDArray * decompressJPEG(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:334
NDCodecBloscComp_t
Definition: NDPluginCodec.h:33
@ NDCODEC_BLOSC_LZ4
Definition: NDPluginCodec.h:35
@ NDCODEC_BLOSC_BLOSCLZ
Definition: NDPluginCodec.h:34
@ NDCODEC_BLOSC_ZLIB
Definition: NDPluginCodec.h:38
@ NDCODEC_BLOSC_ZSTD
Definition: NDPluginCodec.h:39
@ NDCODEC_BLOSC_LZ4HC
Definition: NDPluginCodec.h:36
@ NDCODEC_BLOSC_SNAPPY
Definition: NDPluginCodec.h:37
NDCodecMode_t
Compress/decompress NDArrays according to available codecs.
Definition: NDPluginCodec.h:28
@ NDCODEC_DECOMPRESS
Definition: NDPluginCodec.h:30
@ NDCODEC_COMPRESS
Definition: NDPluginCodec.h:29
NDArray * compressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:608
NDArray * decompressLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:615
NDArray * decompressBSLZ4(NDArray *input, NDCodecStatus_t *status, char *errorMessage)
Definition: NDPluginCodec.cpp:629
NDCodecStatus_t
Definition: NDPluginCodec.h:42
@ NDCODEC_SUCCESS
Definition: NDPluginCodec.h:43
@ NDCODEC_WARNING
Definition: NDPluginCodec.h:44
@ NDCODEC_ERROR
Definition: NDPluginCodec.h:45
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
Definition: NDPluginCodec.h:67
int NDCodecJPEGQuality
Definition: NDPluginCodec.h:85
int NDCodecCompFactor
Definition: NDPluginCodec.h:82
int NDCodecCodecStatus
Definition: NDPluginCodec.h:83
int NDCodecMode
Definition: NDPluginCodec.h:79
int NDCodecCodecError
Definition: NDPluginCodec.h:84
int NDCodecBloscCLevel
Definition: NDPluginCodec.h:87
int NDCodecCompressor
Definition: NDPluginCodec.h:81
int NDCodecBloscCompressor
Definition: NDPluginCodec.h:86
int NDCodecBloscNumThreads
Definition: NDPluginCodec.h:89
int NDCodecBloscShuffle
Definition: NDPluginCodec.h:88
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
list value
Definition: makeDbAndEdl.py:234