1 #ifndef CFP_ARRAY_3F 2 #define CFP_ARRAY_3F 3 4 #include <stddef.h> 5 #include "zfp/types.h" 6 7 struct cfp_array3f; 8 typedef struct cfp_array3f cfp_array3f; 9 10 typedef struct { 11 cfp_array3f* (*ctor_default)(); 12 cfp_array3f* (*ctor)(uint nx, uint ny, uint nz, double rate, const float* p, size_t csize); 13 cfp_array3f* (*ctor_copy)(const cfp_array3f* src); 14 void (*dtor)(cfp_array3f* self); 15 16 void (*deep_copy)(cfp_array3f* self, const cfp_array3f* src); 17 18 double (*rate)(const cfp_array3f* self); 19 double (*set_rate)(cfp_array3f* self, double rate); 20 size_t (*cache_size)(const cfp_array3f* self); 21 void (*set_cache_size)(cfp_array3f* self, size_t csize); 22 void (*clear_cache)(const cfp_array3f* self); 23 void (*flush_cache)(const cfp_array3f* self); 24 size_t (*compressed_size)(const cfp_array3f* self); 25 uchar* (*compressed_data)(const cfp_array3f* self); 26 size_t (*size)(const cfp_array3f* self); 27 uint (*size_x)(const cfp_array3f* self); 28 uint (*size_y)(const cfp_array3f* self); 29 uint (*size_z)(const cfp_array3f* self); 30 void (*resize)(cfp_array3f* self, uint nx, uint ny, uint nz, int clear); 31 32 void (*get_array)(const cfp_array3f* self, float* p); 33 void (*set_array)(cfp_array3f* self, const float* p); 34 float (*get_flat)(const cfp_array3f* self, uint i); 35 void (*set_flat)(cfp_array3f* self, uint i, float val); 36 float (*get)(const cfp_array3f* self, uint i, uint j, uint k); 37 void (*set)(cfp_array3f* self, uint i, uint j, uint k, float val); 38 } cfp_array3f_api; 39 40 #endif 41