1 | /* ---------------- */ |
---|
2 | /* --- nrset3.c --- */ |
---|
3 | /* ---------------- */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
7 | * Univ Paris Sud XI, CNRS |
---|
8 | * |
---|
9 | * Distributed under the Boost Software License, Version 1.0 |
---|
10 | * see accompanying file LICENSE.txt or copy it at |
---|
11 | * http://www.boost.org/LICENSE_1_0.txt |
---|
12 | */ |
---|
13 | |
---|
14 | #include "mypredef.h" |
---|
15 | #include "nrtype.h" |
---|
16 | #include "nrdef.h" |
---|
17 | #include "nrmacro.h" |
---|
18 | #include "nrkernel.h" |
---|
19 | |
---|
20 | #include "nrset2.h" |
---|
21 | #include "nrset3.h" |
---|
22 | |
---|
23 | /* ------------------------------------------------------------------------------------- */ |
---|
24 | IMAGE_EXPORT(void) zero_si8cube(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
25 | /* ------------------------------------------------------------------------------------- */ |
---|
26 | { |
---|
27 | int k; |
---|
28 | for(k=k0; k<=k1; k++) { |
---|
29 | zero_si8matrix(c[k], i0, i1, j0, j1); |
---|
30 | } |
---|
31 | } |
---|
32 | /* ------------------------------------------------------------------------------------- */ |
---|
33 | IMAGE_EXPORT(void) zero_ui8cube(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
34 | /* ------------------------------------------------------------------------------------- */ |
---|
35 | { |
---|
36 | int k; |
---|
37 | for(k=k0; k<=k1; k++) { |
---|
38 | zero_ui8matrix(c[k], i0, i1, j0, j1); |
---|
39 | } |
---|
40 | } |
---|
41 | /* --------------------------------------------------------------------------------------- */ |
---|
42 | IMAGE_EXPORT(void) zero_si16cube(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
43 | /* --------------------------------------------------------------------------------------- */ |
---|
44 | { |
---|
45 | int k; |
---|
46 | for(k=k0; k<=k1; k++) { |
---|
47 | zero_si16matrix(c[k], i0, i1, j0, j1); |
---|
48 | } |
---|
49 | } |
---|
50 | /* --------------------------------------------------------------------------------------- */ |
---|
51 | IMAGE_EXPORT(void) zero_ui16cube(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
52 | /* --------------------------------------------------------------------------------------- */ |
---|
53 | { |
---|
54 | int k; |
---|
55 | for(k=k0; k<=k1; k++) { |
---|
56 | zero_ui16matrix(c[k], i0, i1, j0, j1); |
---|
57 | } |
---|
58 | } |
---|
59 | /* --------------------------------------------------------------------------------------- */ |
---|
60 | IMAGE_EXPORT(void) zero_si32cube(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
61 | /* --------------------------------------------------------------------------------------- */ |
---|
62 | { |
---|
63 | int k; |
---|
64 | for(k=k0; k<=k1; k++) { |
---|
65 | zero_si32matrix(c[k], i0, i1, j0, j1); |
---|
66 | } |
---|
67 | } |
---|
68 | /* ---------------------------------------------------------------------------------------- */ |
---|
69 | IMAGE_EXPORT(void) zero_ui32cube( uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
70 | /* ---------------------------------------------------------------------------------------- */ |
---|
71 | { |
---|
72 | int k; |
---|
73 | for(k=k0; k<=k1; k++) { |
---|
74 | zero_ui32matrix(c[k], i0, i1, j0, j1); |
---|
75 | } |
---|
76 | } |
---|
77 | /* --------------------------------------------------------------------------------------- */ |
---|
78 | IMAGE_EXPORT(void) zero_si64cube(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
79 | /* --------------------------------------------------------------------------------------- */ |
---|
80 | { |
---|
81 | int k; |
---|
82 | for(k=k0; k<=k1; k++) { |
---|
83 | zero_si64matrix(c[k], i0, i1, j0, j1); |
---|
84 | } |
---|
85 | } |
---|
86 | /* --------------------------------------------------------------------------------------- */ |
---|
87 | IMAGE_EXPORT(void) zero_ui64cube(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
88 | /* --------------------------------------------------------------------------------------- */ |
---|
89 | { |
---|
90 | int k; |
---|
91 | for(k=k0; k<=k1; k++) { |
---|
92 | zero_ui64matrix(c[k], i0, i1, j0, j1); |
---|
93 | } |
---|
94 | } |
---|
95 | /* --------------------------------------------------------------------------------------- */ |
---|
96 | IMAGE_EXPORT(void) zero_f32cube(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
97 | /* --------------------------------------------------------------------------------------- */ |
---|
98 | { |
---|
99 | int k; |
---|
100 | for(k=k0; k<=k1; k++) { |
---|
101 | zero_f32matrix(c[k], i0, i1, j0, j1); |
---|
102 | } |
---|
103 | } |
---|
104 | /* --------------------------------------------------------------------------------------- */ |
---|
105 | IMAGE_EXPORT(void) zero_f64cube(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1) |
---|
106 | /* --------------------------------------------------------------------------------------- */ |
---|
107 | { |
---|
108 | int k; |
---|
109 | for(k=k0; k<=k1; k++) { |
---|
110 | zero_f64matrix(c[k], i0, i1, j0, j1); |
---|
111 | } |
---|
112 | } |
---|
113 | /* ------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
114 | IMAGE_EXPORT(void) set_si8cube_param(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint8 x, sint8 xstep, sint8 ystep, sint8 zstep) |
---|
115 | /* ------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
116 | { |
---|
117 | int k; |
---|
118 | for(k=k0; k<=k1; k++) { |
---|
119 | set_si8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
120 | x += zstep; |
---|
121 | } |
---|
122 | } |
---|
123 | /* ------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
124 | IMAGE_EXPORT(void) set_ui8cube_param(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint8 x, uint8 xstep, uint8 ystep, uint8 zstep) |
---|
125 | /* ------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
126 | { |
---|
127 | int k; |
---|
128 | for(k=k0; k<=k1; k++) { |
---|
129 | set_ui8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
130 | x += zstep; |
---|
131 | } |
---|
132 | } |
---|
133 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
134 | IMAGE_EXPORT(void) set_si16cube_param(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint16 x, sint16 xstep, sint16 ystep, sint16 zstep) |
---|
135 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
136 | { |
---|
137 | int k; |
---|
138 | for(k=k0; k<=k1; k++) { |
---|
139 | set_si16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
140 | x += zstep; |
---|
141 | } |
---|
142 | } |
---|
143 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
144 | IMAGE_EXPORT(void) set_ui16cube_param(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint16 x, uint16 xstep, uint16 ystep, uint16 zstep) |
---|
145 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
146 | { |
---|
147 | int k; |
---|
148 | for(k=k0; k<=k1; k++) { |
---|
149 | set_ui16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
150 | x += zstep; |
---|
151 | } |
---|
152 | } |
---|
153 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
154 | IMAGE_EXPORT(void) set_si32cube_param(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint32 x, sint32 xstep, sint32 ystep, sint32 zstep) |
---|
155 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
156 | { |
---|
157 | int k; |
---|
158 | for(k=k0; k<=k1; k++) { |
---|
159 | set_si32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
160 | x += zstep; |
---|
161 | } |
---|
162 | } |
---|
163 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
164 | IMAGE_EXPORT(void) set_ui32cube_param(uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint32 x, uint32 xstep, uint32 ystep, uint32 zstep) |
---|
165 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
166 | { |
---|
167 | int k; |
---|
168 | for(k=k0; k<=k1; k++) { |
---|
169 | set_ui32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
170 | x += zstep; |
---|
171 | } |
---|
172 | } |
---|
173 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
174 | IMAGE_EXPORT(void) set_si64cube_param(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint64 x, sint64 xstep, sint64 ystep, sint64 zstep) |
---|
175 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
176 | { |
---|
177 | int k; |
---|
178 | for(k=k0; k<=k1; k++) { |
---|
179 | set_si64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
180 | x += zstep; |
---|
181 | } |
---|
182 | } |
---|
183 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
184 | IMAGE_EXPORT(void) set_ui64cube_param(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint64 x, uint64 xstep, uint64 ystep, uint64 zstep) |
---|
185 | /* ------------------------------------------------------------------------------------------------------------------------------------------------ */ |
---|
186 | { |
---|
187 | int k; |
---|
188 | for(k=k0; k<=k1; k++) { |
---|
189 | set_ui64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
190 | x += zstep; |
---|
191 | } |
---|
192 | } |
---|
193 | /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
194 | IMAGE_EXPORT(void) set_f32cube_param(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float32 x, float32 xstep, float32 ystep, float32 zstep) |
---|
195 | /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
196 | { |
---|
197 | int k; |
---|
198 | for(k=k0; k<=k1; k++) { |
---|
199 | set_f32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
200 | x += zstep; |
---|
201 | } |
---|
202 | } |
---|
203 | /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
204 | IMAGE_EXPORT(void) set_f64cube_param(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float64 x, float64 xstep, float64 ystep, float64 zstep) |
---|
205 | /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
206 | { |
---|
207 | int k; |
---|
208 | for(k=k0; k<=k1; k++) { |
---|
209 | set_f64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
210 | x += zstep; |
---|
211 | } |
---|
212 | } |
---|
213 | /* --------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
214 | IMAGE_EXPORT(void) set_rgb8cube_param(rgb8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgb8 x, rgb8 xstep, rgb8 ystep, rgb8 zstep) |
---|
215 | /* --------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
216 | { |
---|
217 | int k; |
---|
218 | for(k=k0; k<=k1; k++) { |
---|
219 | set_rgb8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
220 | RGB8_ADD(x,xstep,x); |
---|
221 | } |
---|
222 | } |
---|
223 | /* -------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
224 | IMAGE_EXPORT(void) set_rgbx8cube_param(rgbx8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgbx8 x, rgbx8 xstep, rgbx8 ystep, rgbx8 zstep) |
---|
225 | /* -------------------------------------------------------------------------------------------------------------------------------------------- */ |
---|
226 | { |
---|
227 | int k; |
---|
228 | for(k=k0; k<=k1; k++) { |
---|
229 | set_rgbx8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep); |
---|
230 | RGBX8_ADD(x,xstep,x); |
---|
231 | } |
---|
232 | } |
---|