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