1 | /* ------------------ */ |
---|
2 | /* --- nralloc1.c --- */ |
---|
3 | /* ------------------ */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
7 | * Univ Paris Sud XI, CNRS |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __NRALLOC1_H__ |
---|
11 | #define __NRALLOC1_H__ |
---|
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 |
---|
21 | |
---|
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, ...); |
---|
34 | |
---|
35 | /* |
---|
36 | * -------------- |
---|
37 | * --- vector --- |
---|
38 | * -------------- |
---|
39 | */ |
---|
40 | |
---|
41 | // do: allocate a float vector with subscript range v[nl..nh] |
---|
42 | |
---|
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); |
---|
52 | |
---|
53 | IMAGE_EXPORT(float32*) f32vector(long nl, long nh); |
---|
54 | IMAGE_EXPORT(float64*) f64vector(long nl, long nh); |
---|
55 | |
---|
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 | |
---|
60 | IMAGE_EXPORT(void**) vvector(long nl, long nh); |
---|
61 | |
---|
62 | /* |
---|
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 |
---|
123 | |
---|
124 | #endif /* __NRALLOC1_H__ */ |
---|