28 #ifndef VISIR_CPL_COMPAT_H
29 #define VISIR_CPL_COMPAT_H
45 #if !defined CPL_VERSION_CODE || CPL_VERSION_CODE < CPL_VERSION(6, 0, 0)
47 #error CPL too old, at least cpl 6 required
50 #if CPL_VERSION_CODE < CPL_VERSION(6, 1, 0)
51 #define CPL_FFT_FIND_MEASURE 0
54 #if CPL_VERSION_CODE < CPL_VERSION(6, 1, 0)
55 #define CPL_FITS_START_CACHING
56 #define CPL_FITS_RESTART_CACHING
57 #define CPL_FITS_STOP_CACHING
58 #define cpl_fits_set_mode(x)
61 #if CPL_VERSION_CODE < CPL_VERSION(6, 3, 0)
62 #define CPL_IO_COMPRESS_RICE 0
80 static inline cpl_frame *
81 visir_frameset_get_frame(cpl_frameset *
self, cpl_size position)
83 #if CPL_VERSION_CODE >= CPL_VERSION(6, 3, 0)
84 return cpl_frameset_get_position(
self, position);
86 return cpl_frameset_get_frame(
self, position);
99 visir_vector_sum(
const cpl_vector * vs)
101 #if CPL_VERSION_CODE >= CPL_VERSION(6, 3, 0)
102 double sum = cpl_vector_get_sum(vs);
104 const size_t n = cpl_vector_get_size(vs);
105 const double * data = cpl_vector_get_data_const(vs);
107 for (
size_t j = 0; j < n; j++)
122 visir_imagelist_unwrap(cpl_imagelist * list)
124 #if CPL_VERSION_CODE >= CPL_VERSION(6, 1, 0)
125 cpl_imagelist_unwrap(list);
127 for (cpl_size i = cpl_imagelist_get_size(list); i-- > 0;)
128 cpl_imagelist_unset(list, i);
129 cpl_imagelist_delete(list);