1 | /* --------------- */ |
---|
2 | /* --- nrio2.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 <stdio.h> |
---|
15 | #include <stddef.h> |
---|
16 | #include <stdlib.h> |
---|
17 | |
---|
18 | #include "nrc_os_config.h" |
---|
19 | #include "mypredef.h" |
---|
20 | #include "nrtype.h" |
---|
21 | #include "nrdef.h" |
---|
22 | #include "nrmacro.h" |
---|
23 | #include "nrkernel.h" |
---|
24 | |
---|
25 | #include "nralloc1.h" |
---|
26 | #include "nralloc2.h" |
---|
27 | #include "nrio0.h" |
---|
28 | #include "nrio1.h" |
---|
29 | #include "nrio2.h" |
---|
30 | |
---|
31 | /* |
---|
32 | * ---------------------- |
---|
33 | * --- display_matrix --- |
---|
34 | * ---------------------- |
---|
35 | */ |
---|
36 | |
---|
37 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
38 | IMAGE_EXPORT(void) display_ui8matrix(uint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
39 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
40 | { |
---|
41 | long i,j; |
---|
42 | |
---|
43 | if(name != NULL) printf(name); |
---|
44 | |
---|
45 | for(i=nrl; i<=nrh; i++) { |
---|
46 | for(j=ncl; j<=nch; j++) { |
---|
47 | printf(format, m[i][j]); |
---|
48 | } |
---|
49 | printf("\n"); |
---|
50 | } |
---|
51 | } |
---|
52 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
53 | IMAGE_EXPORT(void) display_si8matrix(sint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
54 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
55 | { |
---|
56 | long i,j; |
---|
57 | |
---|
58 | if(name != NULL) printf(name); |
---|
59 | |
---|
60 | for(i=nrl; i<=nrh; i++) { |
---|
61 | for(j=ncl; j<=nch; j++) { |
---|
62 | printf(format, m[i][j]); |
---|
63 | } |
---|
64 | printf("\n"); |
---|
65 | } |
---|
66 | } |
---|
67 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
68 | IMAGE_EXPORT(void) display_si16matrix(sint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
69 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
70 | { |
---|
71 | long i,j; |
---|
72 | |
---|
73 | if(name != NULL) printf(name); |
---|
74 | |
---|
75 | for(i=nrl; i<=nrh; i++) { |
---|
76 | for(j=ncl; j<=nch; j++) { |
---|
77 | printf(format, m[i][j]); |
---|
78 | } |
---|
79 | printf("\n"); |
---|
80 | } |
---|
81 | } |
---|
82 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
83 | IMAGE_EXPORT(void) display_ui16matrix(uint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
84 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
85 | { |
---|
86 | long i,j; |
---|
87 | |
---|
88 | if(name != NULL) printf(name); |
---|
89 | |
---|
90 | for(i=nrl; i<=nrh; i++) { |
---|
91 | for(j=ncl; j<=nch; j++) { |
---|
92 | printf(format, m[i][j]); |
---|
93 | } |
---|
94 | printf("\n"); |
---|
95 | } |
---|
96 | } |
---|
97 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
98 | IMAGE_EXPORT(void) display_si32matrix(sint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
99 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
100 | { |
---|
101 | long i,j; |
---|
102 | |
---|
103 | if(name != NULL) printf(name); |
---|
104 | |
---|
105 | for(i=nrl; i<=nrh; i++) { |
---|
106 | for(j=ncl; j<=nch; j++) { |
---|
107 | printf(format, m[i][j]); |
---|
108 | } |
---|
109 | printf("\n"); |
---|
110 | } |
---|
111 | } |
---|
112 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
113 | IMAGE_EXPORT(void) display_ui32matrix(uint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
114 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
115 | { |
---|
116 | long i,j; |
---|
117 | |
---|
118 | if(name != NULL) printf(name); |
---|
119 | |
---|
120 | for(i=nrl; i<=nrh; i++) { |
---|
121 | for(j=ncl; j<=nch; j++) { |
---|
122 | printf(format, m[i][j]); |
---|
123 | } |
---|
124 | printf("\n"); |
---|
125 | } |
---|
126 | } |
---|
127 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
128 | IMAGE_EXPORT(void) display_si64matrix(sint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
129 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
130 | { |
---|
131 | long i,j; |
---|
132 | |
---|
133 | if(name != NULL) printf(name); |
---|
134 | |
---|
135 | for(i=nrl; i<=nrh; i++) { |
---|
136 | for(j=ncl; j<=nch; j++) { |
---|
137 | printf(format, m[i][j]); |
---|
138 | } |
---|
139 | printf("\n"); |
---|
140 | } |
---|
141 | } |
---|
142 | /* --------------------------------------------------------------------------------------------------------- */ |
---|
143 | IMAGE_EXPORT(void) display_i64matrix(uint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
144 | /* --------------------------------------------------------------------------------------------------------- */ |
---|
145 | { |
---|
146 | long i,j; |
---|
147 | |
---|
148 | if(name != NULL) printf(name); |
---|
149 | |
---|
150 | for(i=nrl; i<=nrh; i++) { |
---|
151 | for(j=ncl; j<=nch; j++) { |
---|
152 | printf(format, m[i][j]); |
---|
153 | } |
---|
154 | printf("\n"); |
---|
155 | } |
---|
156 | } |
---|
157 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
158 | IMAGE_EXPORT(void) display_f32matrix(float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
159 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
160 | { |
---|
161 | long i,j; |
---|
162 | |
---|
163 | if(name != NULL) printf(name); |
---|
164 | |
---|
165 | for(i=nrl; i<=nrh; i++) { |
---|
166 | for(j=ncl; j<=nch; j++) { |
---|
167 | printf(format, m[i][j]); |
---|
168 | } |
---|
169 | printf("\n"); |
---|
170 | } |
---|
171 | } |
---|
172 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
173 | IMAGE_EXPORT(void) display_f64matrix(float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
174 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
175 | { |
---|
176 | long i,j; |
---|
177 | |
---|
178 | if(name != NULL) printf(name); |
---|
179 | |
---|
180 | for(i=nrl; i<=nrh; i++) { |
---|
181 | for(j=ncl; j<=nch; j++) { |
---|
182 | printf(format, m[i][j]); |
---|
183 | } |
---|
184 | printf("\n"); |
---|
185 | } |
---|
186 | } |
---|
187 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
188 | IMAGE_EXPORT(void) display_rgb8matrix(rgb8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
189 | /* -------------------------------------------------------------------------------------------------------- */ |
---|
190 | { |
---|
191 | long i,j; |
---|
192 | |
---|
193 | if(name != NULL) printf(name); |
---|
194 | |
---|
195 | for(i=nrl; i<=nrh; i++) { |
---|
196 | for(j=ncl; j<=nch; j++) { |
---|
197 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b); |
---|
198 | } |
---|
199 | printf("\n"); |
---|
200 | } |
---|
201 | } |
---|
202 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
203 | IMAGE_EXPORT(void) display_rgbx8matrix(rgbx8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
204 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
205 | { |
---|
206 | long i,j; |
---|
207 | |
---|
208 | if(name != NULL) printf(name); |
---|
209 | |
---|
210 | for(i=nrl; i<=nrh; i++) { |
---|
211 | for(j=ncl; j<=nch; j++) { |
---|
212 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b, m[i][j].x); |
---|
213 | } |
---|
214 | printf("\n"); |
---|
215 | } |
---|
216 | } |
---|
217 | /* |
---|
218 | * ---------------------- |
---|
219 | * --- display_matrix --- |
---|
220 | * ---------------------- |
---|
221 | */ |
---|
222 | |
---|
223 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
224 | IMAGE_EXPORT(void) display_si8matrix_T(sint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
225 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
226 | { |
---|
227 | long i,j; |
---|
228 | |
---|
229 | if(name != NULL) printf(name); |
---|
230 | |
---|
231 | for(j=ncl; j<=nch; j++) { |
---|
232 | for(i=nrl; i<=nrh; i++) { |
---|
233 | printf(format, m[i][j]); |
---|
234 | } |
---|
235 | printf("\n"); |
---|
236 | } |
---|
237 | } |
---|
238 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
239 | IMAGE_EXPORT(void) display_ui8matrix_T(uint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
240 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
241 | { |
---|
242 | long i,j; |
---|
243 | |
---|
244 | if(name != NULL) printf(name); |
---|
245 | |
---|
246 | for(j=ncl; j<=nch; j++) { |
---|
247 | for(i=nrl; i<=nrh; i++) { |
---|
248 | printf(format, m[i][j]); |
---|
249 | } |
---|
250 | printf("\n"); |
---|
251 | } |
---|
252 | } |
---|
253 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
254 | IMAGE_EXPORT(void) display_si16matrix_T(sint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
255 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
256 | { |
---|
257 | long i,j; |
---|
258 | |
---|
259 | if(name != NULL) printf(name); |
---|
260 | |
---|
261 | for(j=ncl; j<=nch; j++) { |
---|
262 | for(i=nrl; i<=nrh; i++) { |
---|
263 | printf(format, m[i][j]); |
---|
264 | } |
---|
265 | printf("\n"); |
---|
266 | } |
---|
267 | } |
---|
268 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
269 | IMAGE_EXPORT(void) display_ui16matrix_T(uint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
270 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
271 | { |
---|
272 | long i,j; |
---|
273 | |
---|
274 | if(name != NULL) printf(name); |
---|
275 | |
---|
276 | for(j=ncl; j<=nch; j++) { |
---|
277 | for(i=nrl; i<=nrh; i++) { |
---|
278 | printf(format, m[i][j]); |
---|
279 | } |
---|
280 | printf("\n"); |
---|
281 | } |
---|
282 | } |
---|
283 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
284 | IMAGE_EXPORT(void) display_si32matrix_T(sint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
285 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
286 | { |
---|
287 | long i,j; |
---|
288 | |
---|
289 | if(name != NULL) printf(name); |
---|
290 | |
---|
291 | for(j=ncl; j<=nch; j++) { |
---|
292 | for(i=nrl; i<=nrh; i++) { |
---|
293 | printf(format, m[i][j]); |
---|
294 | } |
---|
295 | printf("\n"); |
---|
296 | } |
---|
297 | } |
---|
298 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
299 | IMAGE_EXPORT(void) display_ui32matrix_T(uint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
300 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
301 | { |
---|
302 | long i,j; |
---|
303 | |
---|
304 | if(name != NULL) printf(name); |
---|
305 | |
---|
306 | for(j=ncl; j<=nch; j++) { |
---|
307 | for(i=nrl; i<=nrh; i++) { |
---|
308 | printf(format, m[i][j]); |
---|
309 | } |
---|
310 | printf("\n"); |
---|
311 | } |
---|
312 | } |
---|
313 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
314 | IMAGE_EXPORT(void) display_si64matrix_T(sint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
315 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
316 | { |
---|
317 | long i,j; |
---|
318 | |
---|
319 | if(name != NULL) printf(name); |
---|
320 | |
---|
321 | for(j=ncl; j<=nch; j++) { |
---|
322 | for(i=nrl; i<=nrh; i++) { |
---|
323 | printf(format, m[i][j]); |
---|
324 | } |
---|
325 | printf("\n"); |
---|
326 | } |
---|
327 | } |
---|
328 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
329 | IMAGE_EXPORT(void) display_ui64matrix_T(uint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
330 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
331 | { |
---|
332 | long i,j; |
---|
333 | |
---|
334 | if(name != NULL) printf(name); |
---|
335 | |
---|
336 | for(j=ncl; j<=nch; j++) { |
---|
337 | for(i=nrl; i<=nrh; i++) { |
---|
338 | printf(format, m[i][j]); |
---|
339 | } |
---|
340 | printf("\n"); |
---|
341 | } |
---|
342 | } |
---|
343 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
344 | IMAGE_EXPORT(void) display_f32matrix_T(float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
345 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
346 | { |
---|
347 | long i,j; |
---|
348 | |
---|
349 | if(name != NULL) printf(name); |
---|
350 | |
---|
351 | for(j=ncl; j<=nch; j++) { |
---|
352 | for(i=nrl; i<=nrh; i++) { |
---|
353 | printf(format, m[i][j]); |
---|
354 | } |
---|
355 | printf("\n"); |
---|
356 | } |
---|
357 | } |
---|
358 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
359 | IMAGE_EXPORT(void) display_f64matrix_T(float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
360 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
361 | { |
---|
362 | long i,j; |
---|
363 | |
---|
364 | if(name != NULL) printf(name); |
---|
365 | |
---|
366 | for(j=ncl; j<=nch; j++) { |
---|
367 | for(i=nrl; i<=nrh; i++) { |
---|
368 | printf(format, m[i][j]); |
---|
369 | } |
---|
370 | printf("\n"); |
---|
371 | } |
---|
372 | } |
---|
373 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
374 | IMAGE_EXPORT(void) display_rgb8matrix_T(rgb8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
375 | /* ---------------------------------------------------------------------------------------------------------- */ |
---|
376 | { |
---|
377 | long i,j; |
---|
378 | |
---|
379 | if(name != NULL) printf(name); |
---|
380 | |
---|
381 | for(j=ncl; j<=nch; j++) { |
---|
382 | for(i=nrl; i<=nrh; i++) { |
---|
383 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b); |
---|
384 | } |
---|
385 | printf("\n"); |
---|
386 | } |
---|
387 | } |
---|
388 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
389 | IMAGE_EXPORT(void) display_rgbx8matrix_T(rgbx8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
390 | /* ------------------------------------------------------------------------------------------------------------ */ |
---|
391 | { |
---|
392 | long i,j; |
---|
393 | |
---|
394 | if(name != NULL) printf(name); |
---|
395 | |
---|
396 | for(j=ncl; j<=nch; j++) { |
---|
397 | for(i=nrl; i<=nrh; i++) { |
---|
398 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b, m[i][j].x); |
---|
399 | } |
---|
400 | printf("\n"); |
---|
401 | } |
---|
402 | } |
---|
403 | |
---|
404 | /* |
---|
405 | * ------------------------ |
---|
406 | * --- display_matrix_T --- |
---|
407 | * ------------------------ |
---|
408 | */ |
---|
409 | |
---|
410 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
411 | IMAGE_EXPORT(void) display_si8matrix_number(sint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
412 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
413 | { |
---|
414 | int i,j; |
---|
415 | |
---|
416 | if(name != NULL) printf(name); |
---|
417 | |
---|
418 | // 1ere ligne |
---|
419 | printf("%5c", '#'); |
---|
420 | for(j=ncl; j<=nch; j++) { |
---|
421 | printf(format, j); |
---|
422 | } |
---|
423 | printf("\n"); |
---|
424 | for(i=nrl; i<=nrh; i++) { |
---|
425 | printf("[%3d]", i); |
---|
426 | for(j=ncl; j<=nch; j++) { |
---|
427 | printf(format, m[i][j]); |
---|
428 | } |
---|
429 | printf("\n"); |
---|
430 | } |
---|
431 | printf("\n"); |
---|
432 | } |
---|
433 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
434 | IMAGE_EXPORT(void) display_ui8matrix_number(uint8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
435 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
436 | { |
---|
437 | int i,j; |
---|
438 | |
---|
439 | if(name != NULL) printf(name); |
---|
440 | |
---|
441 | // 1ere ligne |
---|
442 | printf("%5c", '#'); |
---|
443 | for(j=ncl; j<=nch; j++) { |
---|
444 | printf(format, j); |
---|
445 | } |
---|
446 | printf("\n"); |
---|
447 | for(i=nrl; i<=nrh; i++) { |
---|
448 | printf("[%3d]", i); |
---|
449 | for(j=ncl; j<=nch; j++) { |
---|
450 | printf(format, m[i][j]); |
---|
451 | } |
---|
452 | printf("\n"); |
---|
453 | } |
---|
454 | printf("\n"); |
---|
455 | } |
---|
456 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
457 | IMAGE_EXPORT(void) display_si16matrix_number(sint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
458 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
459 | { |
---|
460 | int i,j; |
---|
461 | |
---|
462 | if(name != NULL) printf(name); |
---|
463 | |
---|
464 | // 1ere ligne |
---|
465 | printf("%5c", '#'); |
---|
466 | for(j=ncl; j<=nch; j++) { |
---|
467 | printf(format, j); |
---|
468 | } |
---|
469 | printf("\n"); |
---|
470 | for(i=nrl; i<=nrh; i++) { |
---|
471 | printf("[%3d]", i); |
---|
472 | for(j=ncl; j<=nch; j++) { |
---|
473 | printf(format, m[i][j]); |
---|
474 | } |
---|
475 | printf("\n"); |
---|
476 | } |
---|
477 | printf("\n"); |
---|
478 | } |
---|
479 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
480 | IMAGE_EXPORT(void) display_ui16matrix_number(uint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
481 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
482 | { |
---|
483 | int i,j; |
---|
484 | |
---|
485 | if(name != NULL) printf(name); |
---|
486 | |
---|
487 | // 1ere ligne |
---|
488 | printf("%5c", '#'); |
---|
489 | for(j=ncl; j<=nch; j++) { |
---|
490 | printf(format, j); |
---|
491 | } |
---|
492 | printf("\n"); |
---|
493 | for(i=nrl; i<=nrh; i++) { |
---|
494 | printf("[%3d]", i); |
---|
495 | for(j=ncl; j<=nch; j++) { |
---|
496 | printf(format, m[i][j]); |
---|
497 | } |
---|
498 | printf("\n"); |
---|
499 | } |
---|
500 | printf("\n"); |
---|
501 | } |
---|
502 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
503 | IMAGE_EXPORT(void) display_si32matrix_number(sint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
504 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
505 | { |
---|
506 | int i,j; |
---|
507 | |
---|
508 | if(name != NULL) printf(name); |
---|
509 | |
---|
510 | // 1ere ligne |
---|
511 | printf("%5c", '#'); |
---|
512 | for(j=ncl; j<=nch; j++) { |
---|
513 | printf(format, j); |
---|
514 | } |
---|
515 | printf("\n"); |
---|
516 | for(i=nrl; i<=nrh; i++) { |
---|
517 | printf("[%3d]", i); |
---|
518 | for(j=ncl; j<=nch; j++) { |
---|
519 | printf(format, m[i][j]); |
---|
520 | } |
---|
521 | printf("\n"); |
---|
522 | } |
---|
523 | printf("\n"); |
---|
524 | } |
---|
525 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
526 | IMAGE_EXPORT(void) display_ui32matrix_number(uint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
527 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
528 | { |
---|
529 | int i,j; |
---|
530 | |
---|
531 | if(name != NULL) printf(name); |
---|
532 | |
---|
533 | // 1ere ligne |
---|
534 | printf("%5c", '#'); |
---|
535 | for(j=ncl; j<=nch; j++) { |
---|
536 | printf(format, j); |
---|
537 | } |
---|
538 | printf("\n"); |
---|
539 | for(i=nrl; i<=nrh; i++) { |
---|
540 | printf("[%3d]", i); |
---|
541 | for(j=ncl; j<=nch; j++) { |
---|
542 | printf(format, m[i][j]); |
---|
543 | } |
---|
544 | printf("\n"); |
---|
545 | } |
---|
546 | printf("\n"); |
---|
547 | } |
---|
548 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
549 | IMAGE_EXPORT(void) display_si64matrix_number(sint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
550 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
551 | { |
---|
552 | int i,j; |
---|
553 | |
---|
554 | if(name != NULL) printf(name); |
---|
555 | |
---|
556 | // 1ere ligne |
---|
557 | printf("%5c", '#'); |
---|
558 | for(j=ncl; j<=nch; j++) { |
---|
559 | printf(format, j); |
---|
560 | } |
---|
561 | printf("\n"); |
---|
562 | for(i=nrl; i<=nrh; i++) { |
---|
563 | printf("[%3d]", i); |
---|
564 | for(j=ncl; j<=nch; j++) { |
---|
565 | printf(format, m[i][j]); |
---|
566 | } |
---|
567 | printf("\n"); |
---|
568 | } |
---|
569 | printf("\n"); |
---|
570 | } |
---|
571 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
572 | IMAGE_EXPORT(void) display_ui64matrix_number(uint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
573 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
574 | { |
---|
575 | int i,j; |
---|
576 | |
---|
577 | if(name != NULL) printf(name); |
---|
578 | |
---|
579 | // 1ere ligne |
---|
580 | printf("%5c", '#'); |
---|
581 | for(j=ncl; j<=nch; j++) { |
---|
582 | printf(format, j); |
---|
583 | } |
---|
584 | printf("\n"); |
---|
585 | for(i=nrl; i<=nrh; i++) { |
---|
586 | printf("[%3d]", i); |
---|
587 | for(j=ncl; j<=nch; j++) { |
---|
588 | printf(format, m[i][j]); |
---|
589 | } |
---|
590 | printf("\n"); |
---|
591 | } |
---|
592 | printf("\n"); |
---|
593 | } |
---|
594 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
595 | IMAGE_EXPORT(void) display_f32matrix_number(float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
596 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
597 | { |
---|
598 | int i,j; |
---|
599 | |
---|
600 | if(name != NULL) printf(name); |
---|
601 | |
---|
602 | // 1ere ligne |
---|
603 | printf("%5c", '#'); |
---|
604 | for(j=ncl; j<=nch; j++) { |
---|
605 | printf(format, j); |
---|
606 | } |
---|
607 | printf("\n"); |
---|
608 | for(i=nrl; i<=nrh; i++) { |
---|
609 | printf("[%3d]", i); |
---|
610 | for(j=ncl; j<=nch; j++) { |
---|
611 | printf(format, m[i][j]); |
---|
612 | } |
---|
613 | printf("\n"); |
---|
614 | } |
---|
615 | printf("\n"); |
---|
616 | } |
---|
617 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
618 | IMAGE_EXPORT(void) display_f64matrix_number(float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
619 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
620 | { |
---|
621 | int i,j; |
---|
622 | |
---|
623 | if(name != NULL) printf(name); |
---|
624 | |
---|
625 | // 1ere ligne |
---|
626 | printf("%5c", '#'); |
---|
627 | for(j=ncl; j<=nch; j++) { |
---|
628 | printf(format, j); |
---|
629 | } |
---|
630 | printf("\n"); |
---|
631 | for(i=nrl; i<=nrh; i++) { |
---|
632 | printf("[%3d]", i); |
---|
633 | for(j=ncl; j<=nch; j++) { |
---|
634 | printf(format, m[i][j]); |
---|
635 | } |
---|
636 | printf("\n"); |
---|
637 | } |
---|
638 | printf("\n"); |
---|
639 | } |
---|
640 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
641 | IMAGE_EXPORT(void) display_rgb8matrix_number(rgb8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
642 | /* --------------------------------------------------------------------------------------------------------------- */ |
---|
643 | { |
---|
644 | int i,j; |
---|
645 | |
---|
646 | if(name != NULL) printf(name); |
---|
647 | |
---|
648 | // 1ere ligne |
---|
649 | printf("%5c", '#'); |
---|
650 | for(j=ncl; j<=nch; j++) { |
---|
651 | printf(format, j); |
---|
652 | } |
---|
653 | printf("\n"); |
---|
654 | for(i=nrl; i<=nrh; i++) { |
---|
655 | printf("[%3d]", i); |
---|
656 | for(j=ncl; j<=nch; j++) { |
---|
657 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b); |
---|
658 | } |
---|
659 | printf("\n"); |
---|
660 | } |
---|
661 | printf("\n"); |
---|
662 | } |
---|
663 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
664 | IMAGE_EXPORT(void) display_rgbx8matrix_number(rgbx8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name) |
---|
665 | /* ----------------------------------------------------------------------------------------------------------------- */ |
---|
666 | { |
---|
667 | int i,j; |
---|
668 | |
---|
669 | if(name != NULL) printf(name); |
---|
670 | |
---|
671 | // 1ere ligne |
---|
672 | printf("%5c", '#'); |
---|
673 | for(j=ncl; j<=nch; j++) { |
---|
674 | printf(format, j); |
---|
675 | } |
---|
676 | printf("\n"); |
---|
677 | for(i=nrl; i<=nrh; i++) { |
---|
678 | printf("[%3d]", i); |
---|
679 | for(j=ncl; j<=nch; j++) { |
---|
680 | printf(format, m[i][j].r, m[i][j].g, m[i][j].b, m[i][j].x); |
---|
681 | } |
---|
682 | printf("\n"); |
---|
683 | } |
---|
684 | printf("\n"); |
---|
685 | } |
---|
686 | |
---|
687 | /* |
---|
688 | * ------------------------------- |
---|
689 | * --- display_matrix_positive --- |
---|
690 | * ------------------------------- |
---|
691 | */ |
---|
692 | |
---|
693 | // ------------------------------------------------------------------------------------------------ |
---|
694 | void display_si8matrix_positive(sint8 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
695 | // ------------------------------------------------------------------------------------------------ |
---|
696 | { |
---|
697 | int i, j; |
---|
698 | |
---|
699 | char *format, *str; |
---|
700 | |
---|
701 | select_display_positive_parameters(iformat, &format, &str); |
---|
702 | |
---|
703 | if(name != NULL) printf(name); |
---|
704 | |
---|
705 | for(i=i0; i<=i1; i++) { |
---|
706 | for(j=j0; j<=j1; j++) { |
---|
707 | if(m[i][j]) { |
---|
708 | printf(format, m[i][j]); |
---|
709 | } else { |
---|
710 | printf("%s", str); |
---|
711 | } |
---|
712 | } |
---|
713 | printf("\n"); |
---|
714 | } |
---|
715 | } |
---|
716 | // ------------------------------------------------------------------------------------------------ |
---|
717 | void display_ui8matrix_positive(uint8 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
718 | // ------------------------------------------------------------------------------------------------ |
---|
719 | { |
---|
720 | int i, j; |
---|
721 | |
---|
722 | char *format, *str; |
---|
723 | |
---|
724 | select_display_positive_parameters(iformat, &format, &str); |
---|
725 | |
---|
726 | if(name != NULL) printf(name); |
---|
727 | |
---|
728 | for(i=i0; i<=i1; i++) { |
---|
729 | for(j=j0; j<=j1; j++) { |
---|
730 | if(m[i][j]) { |
---|
731 | printf(format, m[i][j]); |
---|
732 | } else { |
---|
733 | printf("%s", str); |
---|
734 | } |
---|
735 | } |
---|
736 | printf("\n"); |
---|
737 | } |
---|
738 | } |
---|
739 | // -------------------------------------------------------------------------------------------------- |
---|
740 | void display_si16matrix_positive(sint16 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
741 | // -------------------------------------------------------------------------------------------------- |
---|
742 | { |
---|
743 | int i, j; |
---|
744 | |
---|
745 | char *format, *str; |
---|
746 | |
---|
747 | select_display_positive_parameters(iformat, &format, &str); |
---|
748 | |
---|
749 | if(name != NULL) printf(name); |
---|
750 | |
---|
751 | for(i=i0; i<=i1; i++) { |
---|
752 | for(j=j0; j<=j1; j++) { |
---|
753 | if(m[i][j]) { |
---|
754 | printf(format, m[i][j]); |
---|
755 | } else { |
---|
756 | printf("%s", str); |
---|
757 | } |
---|
758 | } |
---|
759 | printf("\n"); |
---|
760 | } |
---|
761 | } |
---|
762 | // -------------------------------------------------------------------------------------------------- |
---|
763 | void display_ui16matrix_positive(uint16 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
764 | // -------------------------------------------------------------------------------------------------- |
---|
765 | { |
---|
766 | int i, j; |
---|
767 | char *format, *str; |
---|
768 | |
---|
769 | select_display_positive_parameters(iformat, &format, &str); |
---|
770 | |
---|
771 | if(name != NULL) printf(name); |
---|
772 | |
---|
773 | for(i=i0; i<=i1; i++) { |
---|
774 | for(j=j0; j<=j1; j++) { |
---|
775 | if(m[i][j]) { |
---|
776 | printf(format, m[i][j]); |
---|
777 | } else { |
---|
778 | printf("%s", str); |
---|
779 | } |
---|
780 | } |
---|
781 | printf("\n"); |
---|
782 | } |
---|
783 | } |
---|
784 | // -------------------------------------------------------------------------------------------------- |
---|
785 | void display_si32matrix_positive(sint32 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
786 | // -------------------------------------------------------------------------------------------------- |
---|
787 | { |
---|
788 | int i, j; |
---|
789 | char *format, *str; |
---|
790 | |
---|
791 | select_display_positive_parameters(iformat, &format, &str); |
---|
792 | |
---|
793 | if(name != NULL) printf(name); |
---|
794 | |
---|
795 | for(i=i0; i<=i1; i++) { |
---|
796 | for(j=j0; j<=j1; j++) { |
---|
797 | if(m[i][j]) { |
---|
798 | printf(format, m[i][j]); |
---|
799 | } else { |
---|
800 | printf("%s", str); |
---|
801 | } |
---|
802 | } |
---|
803 | printf("\n"); |
---|
804 | } |
---|
805 | } |
---|
806 | // -------------------------------------------------------------------------------------------------- |
---|
807 | void display_ui32matrix_positive(uint32 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
808 | // -------------------------------------------------------------------------------------------------- |
---|
809 | { |
---|
810 | int i, j; |
---|
811 | char *format, *str; |
---|
812 | |
---|
813 | select_display_positive_parameters(iformat, &format, &str); |
---|
814 | |
---|
815 | if(name != NULL) printf(name); |
---|
816 | |
---|
817 | for(i=i0; i<=i1; i++) { |
---|
818 | for(j=j0; j<=j1; j++) { |
---|
819 | if(m[i][j]) { |
---|
820 | printf(format, m[i][j]); |
---|
821 | } else { |
---|
822 | printf("%s", str); |
---|
823 | } |
---|
824 | } |
---|
825 | printf("\n"); |
---|
826 | } |
---|
827 | } |
---|
828 | // -------------------------------------------------------------------------------------------------- |
---|
829 | void display_si64matrix_positive(sint64 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
830 | // -------------------------------------------------------------------------------------------------- |
---|
831 | { |
---|
832 | int i, j; |
---|
833 | char *format, *str; |
---|
834 | |
---|
835 | select_display_positive_parameters(iformat, &format, &str); |
---|
836 | |
---|
837 | if(name != NULL) printf(name); |
---|
838 | |
---|
839 | for(i=i0; i<=i1; i++) { |
---|
840 | for(j=j0; j<=j1; j++) { |
---|
841 | if(m[i][j]) { |
---|
842 | printf(format, m[i][j]); |
---|
843 | } else { |
---|
844 | printf("%s", str); |
---|
845 | } |
---|
846 | } |
---|
847 | printf("\n"); |
---|
848 | } |
---|
849 | } |
---|
850 | // -------------------------------------------------------------------------------------------------- |
---|
851 | void display_ui64matrix_positive(uint64 **m, int i0, int i1, int j0, int j1, int iformat, char *name) |
---|
852 | // -------------------------------------------------------------------------------------------------- |
---|
853 | { |
---|
854 | int i, j; |
---|
855 | char *format, *str; |
---|
856 | |
---|
857 | select_display_positive_parameters(iformat, &format, &str); |
---|
858 | |
---|
859 | if(name != NULL) printf(name); |
---|
860 | |
---|
861 | for(i=i0; i<=i1; i++) { |
---|
862 | for(j=j0; j<=j1; j++) { |
---|
863 | if(m[i][j]) { |
---|
864 | printf(format, m[i][j]); |
---|
865 | } else { |
---|
866 | printf("%s", str); |
---|
867 | } |
---|
868 | } |
---|
869 | printf("\n"); |
---|
870 | } |
---|
871 | } |
---|