-
Notifications
You must be signed in to change notification settings - Fork 3
/
z5wrapper.h
116 lines (85 loc) · 5.33 KB
/
z5wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// Created by Kevin Paul on 2019-04-24.
//
#ifndef CZ5TEST_Z5WRAPPER_H
#define CZ5TEST_Z5WRAPPER_H
#include <stddef.h>
#ifdef __cplusplus
#include "z5/multiarray/xtensor_access.hxx"
#endif
#ifdef __cplusplus
#include "z5/dataset_factory.hxx"
#include "z5/file.hxx"
#include "z5/groups.hxx"
#include "z5/attributes.hxx"
#include "z5/compression/zlib_compressor.hxx"
#include "z5/types/types.hxx"
#endif
#include <stdint.h>
#ifdef __cplusplus
namespace z5 {
extern "C" {
#endif
void z5CreateFile(char* path);
void z5CreateGroup(char* path);
// float 32
void z5CreateFloat32Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteFloat32Subarray(char *path, float *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadFloat32Subarray(char *path, float *array, unsigned int ndim, size_t *count, size_t *start);
// float 64 / double
void z5CreateFloat64Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteFloat64Subarray(char *path, double *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadFloat64Subarray(char *path, double *array, unsigned int ndim, size_t *count, size_t *start);
// int8_t
void z5CreateInt8Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteInt8Subarray(char *path, int8_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadInt8Subarray(char *path, int8_t *array, unsigned int ndim, size_t *count, size_t *start);
// int16_t
void z5CreateInt16Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteInt16Subarray(char *path, int16_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadInt16Subarray(char *path, int16_t *array, unsigned int ndim, size_t *count, size_t *start);
// int32_t
void z5CreateInt32Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteInt32Subarray(char *path, int32_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadInt32Subarray(char *path, int32_t *array, unsigned int ndim, size_t *count, size_t *start);
// int64
void z5CreateInt64Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteInt64Subarray(char *path, long long int *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadInt64Subarray(char *path, long long int *array, unsigned int ndim, size_t *count, size_t *start);
// uint8_t
void z5CreateUInt8Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteUInt8Subarray(char *path, uint8_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadUInt8Subarray(char *path, uint8_t *array, unsigned int ndim, size_t *count, size_t *start);
// uint16_t
void z5CreateUInt16Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteUInt16Subarray(char *path, uint16_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadUInt16Subarray(char *path, uint16_t *array, unsigned int ndim, size_t *count, size_t *start);
// uint32_t
void z5CreateUInt32Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteUInt32Subarray(char *path, uint32_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadUInt32Subarray(char *path, uint32_t *array, unsigned int ndim, size_t *count, size_t *start);
// uint64
void z5CreateUInt64Dataset(char *path, unsigned int ndim, size_t *shape, size_t *count, int cuseZlib, int level);
void z5WriteUInt64Subarray(char *path, uint64_t *array, unsigned int ndim, size_t *count, size_t *start);
void z5ReadUInt64Subarray(char *path, uint64_t *array, unsigned int ndim, size_t *count, size_t *start);
size_t z5GetFileSize(char *path);
void z5Delete(char *path );
void z5writeAttributesString(char *path, const char *name, const char *value);
void z5writeAttributesshort(char *path, const char *name, const short *value);
void z5writeAttributesint(char *path, const char *name, const int *value);
void z5writeAttributeslong(char *path, const char *name, const long *value);
void z5writeAttributesfloat(char *path, const char *name, const float *value);
void z5writeAttributesdouble(char *path, const char *name, const double *value);
void z5writeAttributesushort(char *path, const char *name, const unsigned short *value);
void z5writeAttributesusint(char *path, const char *name, const unsigned short int *value);
void z5writeAttributeslonglong(char *path, const char *name, const long long *value);
void z5writeAttributesulonglong(char *path, const char *name, const unsigned long long *value);
void z5writeAttributesuint(char *path, const char *name, const unsigned int *value);
// read attributes //
void z5readAttributesWithKeys(char *path, char *keys[], int keys_sz);
void z5readAttributes(char *path);
#ifdef __cplusplus
}
}
#endif
#endif //CZ5TEST_Z5WRAPPER_H