Add USE_BUNDLED_LIBS
This commit is contained in:
@@ -25,7 +25,10 @@
|
||||
#include <variant>
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
#include "variant.h"
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <ctime>
|
||||
|
||||
namespace LibXISF
|
||||
{
|
||||
@@ -64,6 +67,103 @@ public:
|
||||
void decodeHex();
|
||||
};
|
||||
|
||||
struct Complex32
|
||||
{
|
||||
float real;
|
||||
float imag;
|
||||
};
|
||||
|
||||
struct Complex64
|
||||
{
|
||||
double real;
|
||||
double imag;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Matrix
|
||||
{
|
||||
int _rows = 0;
|
||||
int _cols = 0;
|
||||
std::vector<T> _elem;
|
||||
public:
|
||||
using value_type = T;
|
||||
|
||||
Matrix() = default;
|
||||
Matrix(int rows, int cols) : _rows(rows), _cols(cols), _elem(rows * cols) {}
|
||||
void resize(int rows, int cols) { _rows = rows; _cols = cols; _elem.resize(rows * cols); }
|
||||
T& operator()(int row, int col) { return _elem[row * _cols + col]; }
|
||||
const T& operator()(int row, int col) const { return _elem[row * _cols + col]; }
|
||||
int rows() const { return _rows; }
|
||||
int cols() const { return _cols; }
|
||||
};
|
||||
|
||||
typedef bool Boolean;
|
||||
typedef int8_t Int8;
|
||||
typedef uint8_t UInt8;
|
||||
typedef int16_t Int16;
|
||||
typedef uint16_t UInt16;
|
||||
typedef int32_t Int32;
|
||||
typedef uint32_t UInt32;
|
||||
typedef int64_t Int64;
|
||||
typedef uint64_t UInt64;
|
||||
typedef float Float32;
|
||||
typedef double Float64;
|
||||
typedef std::string String;
|
||||
typedef std::tm TimePoint;
|
||||
typedef std::vector<int8_t> I8Vector;
|
||||
typedef std::vector<uint8_t> UI8Vector;
|
||||
typedef std::vector<int16_t> I16Vector;
|
||||
typedef std::vector<uint16_t> UI16Vector;
|
||||
typedef std::vector<int32_t> I32Vector;
|
||||
typedef std::vector<uint32_t> UI32Vector;
|
||||
typedef std::vector<int64_t> I64Vector;
|
||||
typedef std::vector<uint64_t> UI64Vector;
|
||||
typedef std::vector<float> F32Vector;
|
||||
typedef std::vector<double> F64Vector;
|
||||
typedef std::vector<Complex32> C32Vector;
|
||||
typedef std::vector<Complex64> C64Vector;
|
||||
typedef Matrix<Int8> I8Matrix;
|
||||
typedef Matrix<UInt8> UI8Matrix;
|
||||
typedef Matrix<Int16> I16Matrix;
|
||||
typedef Matrix<UInt16> UI16Matrix;
|
||||
typedef Matrix<Int32> I32Matrix;
|
||||
typedef Matrix<UInt32> UI32Matrix;
|
||||
typedef Matrix<Int64> I64Matrix;
|
||||
typedef Matrix<UInt64> UI64Matrix;
|
||||
typedef Matrix<float> F32Matrix;
|
||||
typedef Matrix<double> F64Matrix;
|
||||
typedef Matrix<Complex32> C32Matrix;
|
||||
typedef Matrix<Complex64> C64Matrix;
|
||||
|
||||
class Variant
|
||||
{
|
||||
using StdVariant = std::variant<std::monostate, Boolean, Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float32, Float64,
|
||||
Complex32, Complex64, String, TimePoint,
|
||||
I8Vector, UI8Vector, I16Vector, UI16Vector, I32Vector, UI32Vector, I64Vector, UI64Vector, F32Vector, F64Vector, C32Vector, C64Vector,
|
||||
I8Matrix, UI8Matrix, I16Matrix, UI16Matrix, I32Matrix, UI32Matrix, I64Matrix, UI64Matrix, F32Matrix, F64Matrix, C32Matrix, C64Matrix>;
|
||||
StdVariant _value;
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
Monostate, Boolean, Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float32, Float64,
|
||||
Complex32, Complex64, String, TimePoint,
|
||||
I8Vector, UI8Vector, I16Vector, UI16Vector, I32Vector, UI32Vector, I64Vector, UI64Vector, F32Vector, F64Vector, C32Vector, C64Vector,
|
||||
I8Matrix, UI8Matrix, I16Matrix, UI16Matrix, I32Matrix, UI32Matrix, I64Matrix, UI64Matrix, F32Matrix, F64Matrix, C32Matrix, C64Matrix
|
||||
};
|
||||
|
||||
Variant() = default;
|
||||
template<typename T>
|
||||
Variant(const T &t) : _value(t) {}
|
||||
Type type() const;
|
||||
const char *typeName() const;
|
||||
template<typename T>
|
||||
T& value() { return std::get<T>(_value); }
|
||||
template<typename T>
|
||||
const T& value() const { return std::get<T>(_value); }
|
||||
template<typename T>
|
||||
void setValue(const T& val) { _value = val; }
|
||||
};
|
||||
|
||||
struct LIBXISF_EXPORT DataBlock
|
||||
{
|
||||
enum CompressionCodec
|
||||
|
||||
Reference in New Issue
Block a user