17 template<
typename returnT,
typename dataT>
22 return (returnT) ((dataT*) imdata)[idx];
26 template<
typename returnT,
int imageStructDataT>
29 return &getPix<returnT, typename imageStructDataType<imageStructDataT>::type>;
32 template<
typename returnT>
35 switch(imageStructDataT)
38 return getPixPointer<returnT, IMAGESTRUCT_UINT8>();
40 return getPixPointer<returnT, IMAGESTRUCT_INT8>();
42 return getPixPointer<returnT, IMAGESTRUCT_UINT16>();
45 return getPixPointer<returnT, IMAGESTRUCT_INT16>();
47 return getPixPointer<returnT, IMAGESTRUCT_UINT32>();
49 return getPixPointer<returnT, IMAGESTRUCT_INT32>();
51 return getPixPointer<returnT, IMAGESTRUCT_UINT64>();
53 return getPixPointer<returnT, IMAGESTRUCT_INT64>();
55 return getPixPointer<returnT, IMAGESTRUCT_FLOAT>();
57 return getPixPointer<returnT, IMAGESTRUCT_DOUBLE>();
59 std::cerr <<
"getPixPointer: Unknown or unsupported data type. " << __FILE__ <<
" " << __LINE__ <<
"\n";
#define IMAGESTRUCT_UINT16
#define IMAGESTRUCT_INT64
#define IMAGESTRUCT_FLOAT
#define IMAGESTRUCT_INT32
#define IMAGESTRUCT_UINT32
#define IMAGESTRUCT_DOUBLE
#define IMAGESTRUCT_UINT8
#define IMAGESTRUCT_INT16
#define IMAGESTRUCT_UINT64
returnT getPix(void *imdata, size_t idx)
Function to cast the data type to float.
returnT(*)(void *, size_t) getPixPointer()
Get the function pointer for getPix for the type.