- Timestamp:
- May 6, 2016, 3:06:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc1.h
r772 r821 11 11 #define __NRALLOC1_H__ 12 12 13 #ifdef __cplusplus 14 #pragma message ("C++") 15 extern "C" { 16 #endif 17 18 #ifdef VERBOSE_PRAGMA 19 //#pragma message ("- *** include nralloc1.h ***") 20 #endif 13 #include <stdint.h> 21 14 22 23 //NR_END est maintenant defini dans nrutil.h 24 25 #define NR_END 0 26 #define FREE_ARG char* 27 28 //long nr_end = NR_END; 29 30 //void nrerror(char error_text[]); 31 //void nrerror(char *format, ...); 32 //void Error (char *format, ...); 33 //void Warning(char *format, ...); 15 #include "nrc_os_config.h" 16 #include "nrtype.h" 34 17 35 18 /* … … 39 22 */ 40 23 41 // do: allocate a float vector with subscript range v[nl..nh] 24 #define type_vector(t) \ 25 t * short_name(t,,vector)(int32_t nl, int32_t nh) 42 26 43 //IMAGE_EXPORT(byte*) bvector(long nl, long nh); 44 IMAGE_EXPORT(sint8*) si8vector(long nl, long nh); 45 IMAGE_EXPORT(uint8*) ui8vector(long nl, long nh); 46 IMAGE_EXPORT(sint16*) si16vector(long nl, long nh); 47 IMAGE_EXPORT(uint16*) ui16vector(long nl, long nh); 48 IMAGE_EXPORT(sint32*) si32vector(long nl, long nh); 49 IMAGE_EXPORT(uint32*) ui32vector(long nl, long nh); 50 IMAGE_EXPORT(sint64*) si64vector(long nl, long nh); 51 IMAGE_EXPORT(uint64*) ui64vector(long nl, long nh); 27 type_vector(int8_t); 28 type_vector(uint8_t); 29 type_vector(int16_t); 30 type_vector(uint16_t); 31 type_vector(int32_t); 32 type_vector(uint32_t); 33 type_vector(int64_t); 34 type_vector(uint64_t); 35 type_vector(float); 36 type_vector(double); 37 type_vector(rgb8); 38 type_vector(rgbx8); 39 type_vector(rgb32); 40 type_vector(void_p); 52 41 53 IMAGE_EXPORT(float32*) f32vector(long nl, long nh);54 IMAGE_EXPORT(float64*) f64vector(long nl, long nh);55 42 56 IMAGE_EXPORT(rgb8*) rgb8vector(long nl, long nh);57 IMAGE_EXPORT(rgbx8*) rgbx8vector(long nl, long nh);58 IMAGE_EXPORT(rgb32*) rgb32vector(long nl, long nh);59 43 60 IMAGE_EXPORT(void**) vvector(long nl, long nh); 44 #if TARGET_OS == GIETVM 45 #define remote_type_vector(t) \ 46 t * short_name(t,remote_,vector)(int32_t nl, int32_t nh, int32_t x, int32_t y) 47 48 remote_type_vector(int8_t); 49 remote_type_vector(uint8_t); 50 remote_type_vector(int16_t); 51 remote_type_vector(uint16_t); 52 remote_type_vector(int32_t); 53 remote_type_vector(uint32_t); 54 remote_type_vector(int64_t); 55 remote_type_vector(uint64_t); 56 remote_type_vector(float); 57 remote_type_vector(double); 58 remote_type_vector(rgb8); 59 remote_type_vector(rgbx8); 60 remote_type_vector(rgb32); 61 remote_type_vector(void_p); 62 63 //void ** remote_vvector(long nl, long nh, int x, int y); 64 #endif 65 66 #define type_vector0(t) \ 67 t * short_name(t,,vector0)(int32_t nl, int32_t nh) 68 69 type_vector0(int8_t); 70 type_vector0(uint8_t); 71 type_vector0(int16_t); 72 type_vector0(uint16_t); 73 type_vector0(int32_t); 74 type_vector0(uint32_t); 75 type_vector0(int64_t); 76 type_vector0(uint64_t); 77 type_vector0(float); 78 type_vector0(double); 79 type_vector0(rgb8); 80 type_vector0(rgbx8); 81 type_vector0(rgb32); 82 type_vector0(void_p); 83 84 #define realloc_type_vector(t) \ 85 t * short_name(t,realloc_,vector)(t * v, int32_t nl, int32_t nh) 86 87 realloc_type_vector(int8_t); 88 realloc_type_vector(uint8_t); 89 realloc_type_vector(int16_t); 90 realloc_type_vector(uint16_t); 91 realloc_type_vector(int32_t); 92 realloc_type_vector(uint32_t); 93 realloc_type_vector(int64_t); 94 realloc_type_vector(uint64_t); 95 realloc_type_vector(float); 96 realloc_type_vector(double); 97 realloc_type_vector(rgb8); 98 realloc_type_vector(rgbx8); 99 realloc_type_vector(rgb32); 100 realloc_type_vector(void_p); 101 102 103 #define free_type_vector(t) \ 104 void short_name(t,free_,vector)(t * v, long nl, long nh) 105 106 free_type_vector(int8_t); 107 free_type_vector(uint8_t); 108 free_type_vector(int16_t); 109 free_type_vector(uint16_t); 110 free_type_vector(int32_t); 111 free_type_vector(uint32_t); 112 free_type_vector(int64_t); 113 free_type_vector(uint64_t); 114 free_type_vector(float); 115 free_type_vector(double); 116 free_type_vector(rgb8); 117 free_type_vector(rgbx8); 118 free_type_vector(rgb32); 119 free_type_vector(void_p); 120 121 61 122 62 123 /* 63 * --------------- 64 * --- vector0 --- 65 * --------------- 66 */ 67 68 // do: allocate a vector and set it to 0 69 70 //IMAGE_EXPORT(byte*) bvector0(long nl, long nh); 71 IMAGE_EXPORT(sint8*) si8vector0(long nl, long nh); 72 IMAGE_EXPORT(uint8*) ui8vector0(long nl, long nh); 73 IMAGE_EXPORT(sint16*) si16vector0(long nl, long nh); 74 IMAGE_EXPORT(uint16*) ui16vector0(long nl, long nh); 75 IMAGE_EXPORT(sint32*) si32vector0(long nl, long nh); 76 IMAGE_EXPORT(uint32*) ui32vector0(long nl, long nh); 77 78 IMAGE_EXPORT(float32*) f32vector0(long nl, long nh); 79 IMAGE_EXPORT(float64*) f64vector0(long nl, long nh); 80 81 IMAGE_EXPORT(rgb8*) rgb8vector0(long nl, long nh); 82 IMAGE_EXPORT(rgbx8*) rgbx8vector0(long nl, long nh); 83 IMAGE_EXPORT(rgb32*) rgb32vector0(long nl, long nh); 84 85 IMAGE_EXPORT(void**) vvector0(long nl, long nh); 86 /* 87 * ---------------------- 88 * --- realloc_vector --- 89 * ---------------------- 90 */ 91 92 // realloc a vector to [nl..nh] 93 IMAGE_EXPORT(void**) realloc_vvector(void **v, long nl, long nh); 94 95 /* 96 * ------------------- 97 * --- free_vector --- 98 * ------------------- 99 */ 100 101 //IMAGE_EXPORT(void) free_bvector (byte *v, long nl, long nh); 102 IMAGE_EXPORT(void) free_si8vector (sint8 *v, long nl, long nh); 103 IMAGE_EXPORT(void) free_ui8vector (uint8 *v, long nl, long nh); 104 IMAGE_EXPORT(void) free_si16vector (sint16 *v, long nl, long nh); 105 IMAGE_EXPORT(void) free_ui16vector (uint16 *v, long nl, long nh); 106 IMAGE_EXPORT(void) free_si32vector (sint32 *v, long nl, long nh); 107 IMAGE_EXPORT(void) free_ui32vector (uint32 *v, long nl, long nh); 108 IMAGE_EXPORT(void) free_si64vector (sint64 *v, long nl, long nh); 109 IMAGE_EXPORT(void) free_ui64vector (uint64 *v, long nl, long nh); 110 111 IMAGE_EXPORT(void) free_f32vector (float32 *v, long nl, long nh); 112 IMAGE_EXPORT(void) free_f64vector (float64 *v, long nl, long nh); 113 114 IMAGE_EXPORT(void) free_rgb8vector (rgb8 *v, long nl, long nh); 115 IMAGE_EXPORT(void) free_rgbx8vector(rgbx8 *v, long nl, long nh); 116 IMAGE_EXPORT(void) free_rgb32vector(rgb32 *v, long nl, long nh); 117 118 IMAGE_EXPORT(void) free_vvector (void **v, long nl, long nh); 119 120 #ifdef __cplusplus 121 } 122 #endif 124 void ** vvector(long nl, long nh); 125 void ** vvector0(long nl, long nh); 126 void ** realloc_vvector(void ** v, long nl, long nh); 127 void free_vvector(void ** v, long nl, long nh); 128 */ 123 129 124 130 #endif /* __NRALLOC1_H__ */ 131
Note: See TracChangeset
for help on using the changeset viewer.