source: soft/giet_vm/applications/rosenfeld/nrc2/include/nrio2.h @ 817

Last change on this file since 817 was 798, checked in by meunier, 9 years ago
  • Bug fixes in Rosenfeld
File size: 15.9 KB
Line 
1/* --------------- */
2/* --- nrio2.h --- */
3/* --------------- */
4
5/*
6 * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved
7 * Univ Paris Sud XI, CNRS
8*/
9
10#ifndef _NR_IO2_H_
11#define _NR_IO2_H_
12
13#ifdef __cplusplus
14#pragma message ("C++")
15extern "C" {
16#endif
17   
18#ifdef VERBOSE_PRAGMA
19//#pragma message ("- *** include nrio2.h ***")
20#endif
21
22
23/*
24 * ----------------------
25 * --- display_matrix ---
26 * ----------------------
27 */
28
29IMAGE_EXPORT(void) display_si8matrix  (sint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
30IMAGE_EXPORT(void) display_ui8matrix  (uint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
31IMAGE_EXPORT(void) display_si16matrix (sint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
32IMAGE_EXPORT(void) display_ui16matrix (uint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
33IMAGE_EXPORT(void) display_si32matrix (sint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
34IMAGE_EXPORT(void) display_ui32matrix (uint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
35IMAGE_EXPORT(void) display_si64matrix (sint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
36IMAGE_EXPORT(void) display_ui64matrix (uint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
37
38IMAGE_EXPORT(void) display_f32matrix  (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
39IMAGE_EXPORT(void) display_f64matrix  (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
40
41IMAGE_EXPORT(void) display_rgb8matrix (rgb8    **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
42IMAGE_EXPORT(void) display_rgbx8matrix(rgbx8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
43
44/*
45 * ------------------------
46 * --- display_matrix_T ---
47 * ------------------------
48 */
49
50IMAGE_EXPORT(void) display_si8matrix_T (sint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
51IMAGE_EXPORT(void) display_ui8matrix_T (uint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
52IMAGE_EXPORT(void) display_si16matrix_T(sint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
53IMAGE_EXPORT(void) display_ui16matrix_T(uint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
54IMAGE_EXPORT(void) display_si32matrix_T(sint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
55IMAGE_EXPORT(void) display_ui32matrix_T(uint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
56IMAGE_EXPORT(void) display_si64matrix_T(sint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
57IMAGE_EXPORT(void) display_ui64matrix_T(uint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
58
59IMAGE_EXPORT(void) display_f32matrix_T (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
60IMAGE_EXPORT(void) display_f64matrix_T (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
61
62IMAGE_EXPORT(void) display_rgb8matrix_T (rgb8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
63IMAGE_EXPORT(void) display_rgbx8matrix_T(rgbx8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
64
65/*
66 * -----------------------------
67 * --- display_matrix_number ---
68 * -----------------------------
69 */
70
71IMAGE_EXPORT(void) display_si8matrix_number (sint8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
72IMAGE_EXPORT(void) display_ui8matrix_number (uint8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
73IMAGE_EXPORT(void) display_si16matrix_number(sint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
74IMAGE_EXPORT(void) display_ui16matrix_number(uint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
75IMAGE_EXPORT(void) display_i32matrix_number (sint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
76IMAGE_EXPORT(void) display_ui32matrix_number(uint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
77IMAGE_EXPORT(void) display_si64matrix_number(sint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
78IMAGE_EXPORT(void) display_ui64matrix_number(uint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
79
80IMAGE_EXPORT(void) display_f32matrix_number (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
81IMAGE_EXPORT(void) display_f64matrix_number (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
82
83IMAGE_EXPORT(void) display_rgb8matrix_number (rgb8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
84IMAGE_EXPORT(void) display_rgbx8matrix_number(rgbx8 **m,long nrl,long nrh,long ncl, long nch, char *format, char *name);
85
86/*
87 * --------------------
88 * --- write_matrix ---
89 * --------------------
90 */
91
92IMAGE_EXPORT(void) write_si8matrix  (sint8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
93IMAGE_EXPORT(void) write_ui8matrix  (uint8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
94IMAGE_EXPORT(void) write_si16matrix (sint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
95IMAGE_EXPORT(void) write_ui16matrix (uint16 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
96IMAGE_EXPORT(void) write_si32matrix (sint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
97IMAGE_EXPORT(void) write_ui32matrix (uint32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
98IMAGE_EXPORT(void) write_si64matrix (sint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
99IMAGE_EXPORT(void) write_ui64matrix (uint64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
100
101IMAGE_EXPORT(void) write_f32matrix (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
102IMAGE_EXPORT(void) write_f64matrix (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
103
104IMAGE_EXPORT(void) write_rgb8matrix (rgb8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
105IMAGE_EXPORT(void) write_rgbx8matrix(rgbx8  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
106
107/*
108 * ----------------------
109 * --- write_matrix_T ---
110 * ----------------------
111 */
112
113IMAGE_EXPORT(void) write_si8matrix_T  (sint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
114IMAGE_EXPORT(void) write_ui8matrix_T  (uint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
115IMAGE_EXPORT(void) write_si16matrix_T (sint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
116IMAGE_EXPORT(void) write_ui16matrix_T (uint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
117IMAGE_EXPORT(void) write_si32matrix_T (sint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
118IMAGE_EXPORT(void) write_ui32matrix_T (uint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
119IMAGE_EXPORT(void) write_si64matrix_T (sint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
120IMAGE_EXPORT(void) write_ui64matrix_T (uint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
121
122IMAGE_EXPORT(void) write_f32matrix_T  (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
123IMAGE_EXPORT(void) write_f64matrix_T  (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
124
125IMAGE_EXPORT(void) write_rgb8matrix_T (rgb8    **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
126IMAGE_EXPORT(void) write_rgbx8matrix_T(rgbx8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
127
128/*
129 * ---------------------------
130 * --- write_matrix_number ---
131 * ---------------------------
132 */
133
134IMAGE_EXPORT(void) write_si8matrix_number  (sint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
135IMAGE_EXPORT(void) write_ui8matrix_number  (uint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
136IMAGE_EXPORT(void) write_si16matrix_number (sint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
137IMAGE_EXPORT(void) write_ui16matrix_number (uint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
138IMAGE_EXPORT(void) write_si32matrix_number (sint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
139IMAGE_EXPORT(void) write_ui32matrix_number (uint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
140IMAGE_EXPORT(void) write_si64matrix_number (sint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
141IMAGE_EXPORT(void) write_ui64matrix_number (uint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
142
143IMAGE_EXPORT(void) write_f32matrix_number  (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
144IMAGE_EXPORT(void) write_f64matrix_number  (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
145
146IMAGE_EXPORT(void) write_rgb8matrix_number (rgb8    **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
147IMAGE_EXPORT(void) write_rgbx8matrix_number(rgbx8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
148
149/*
150 * -----------------------------
151 * --- write_matrix_T_number ---
152 * -----------------------------
153 */
154
155IMAGE_EXPORT(void) write_si8matrix_T_number  (sint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
156IMAGE_EXPORT(void) write_ui8matrix_T_number  (uint8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
157IMAGE_EXPORT(void) write_si16matrix_T_number (sint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
158IMAGE_EXPORT(void) write_ui16matrix_T_number (uint16  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
159IMAGE_EXPORT(void) write_si32matrix_T_number (sint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
160IMAGE_EXPORT(void) write_ui32matrix_T_number (uint32  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
161IMAGE_EXPORT(void) write_si64matrix_T_number (sint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
162IMAGE_EXPORT(void) write_ui64matrix_T_number (uint64  **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
163
164IMAGE_EXPORT(void) write_f32matrix_T_number  (float32 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
165IMAGE_EXPORT(void) write_f64matrix_T_number  (float64 **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
166
167IMAGE_EXPORT(void) write_rgb8matrix_T_number (rgb8    **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
168IMAGE_EXPORT(void) write_rgbx8matrix_T_number(rgbx8   **m,long nrl,long nrh,long ncl, long nch, char *format, char *filename);
169
170/*
171 * ---------------------
172 * --- fwrite_matrix ---
173 * ---------------------
174 */
175
176IMAGE_EXPORT(void) fwrite_si8matrix  (sint8  **m,long nrl,long nrh,long ncl, long nch, char *filename);
177IMAGE_EXPORT(void) fwrite_ui8matrix  (uint8  **m,long nrl,long nrh,long ncl, long nch, char *filename);
178IMAGE_EXPORT(void) fwrite_si16matrix (sint16 **m,long nrl,long nrh,long ncl, long nch, char *filename);
179IMAGE_EXPORT(void) fwrite_ui16matrix (uint16 **m,long nrl,long nrh,long ncl, long nch, char *filename);
180IMAGE_EXPORT(void) fwrite_si32matrix (sint32 **m,long nrl,long nrh,long ncl, long nch, char *filename);
181IMAGE_EXPORT(void) fwrite_ui32matrix (uint32 **m,long nrl,long nrh,long ncl, long nch, char *filename);
182IMAGE_EXPORT(void) fwrite_si64matrix (sint64 **m,long nrl,long nrh,long ncl, long nch, char *filename);
183IMAGE_EXPORT(void) fwrite_ui64matrix (uint64 **m,long nrl,long nrh,long ncl, long nch, char *filename);
184
185IMAGE_EXPORT(void) fwrite_f32matrix (float32 **m,long nrl,long nrh,long ncl, long nch, char *filename);
186IMAGE_EXPORT(void) fwrite_f64matrix (float64 **m,long nrl,long nrh,long ncl, long nch, char *filename);
187
188IMAGE_EXPORT(void) fwrite_rgb8matrix(rgb8    **m,long nrl,long nrh,long ncl, long nch, char *filename);
189IMAGE_EXPORT(void) fwrite_rgbx8matrix(rgbx8  **m,long nrl,long nrh,long ncl, long nch, char *filename);
190
191/*
192 * --------------------
193 * --- fread_matrix ---
194 * --------------------
195 */
196
197IMAGE_EXPORT(void) fread_si8matrix  (char *filename, sint8    **m,long nrl,long nrh,long ncl, long nch);
198IMAGE_EXPORT(void) fread_ui8matrix  (char *filename, uint8    **m,long nrl,long nrh,long ncl, long nch);
199IMAGE_EXPORT(void) fread_si16matrix (char *filename, sint16   **m,long nrl,long nrh,long ncl, long nch);
200IMAGE_EXPORT(void) fread_ui16matrix (char *filename, uint16   **m,long nrl,long nrh,long ncl, long nch);
201IMAGE_EXPORT(void) fread_si32matrix (char *filename, sint32   **m,long nrl,long nrh,long ncl, long nch);
202IMAGE_EXPORT(void) fread_ui32matrix (char *filename, uint32   **m,long nrl,long nrh,long ncl, long nch);
203IMAGE_EXPORT(void) fread_si64matrix (char *filename, sint64   **m,long nrl,long nrh,long ncl, long nch);
204IMAGE_EXPORT(void) fread_ui64matrix (char *filename, uint64   **m,long nrl,long nrh,long ncl, long nch);
205IMAGE_EXPORT(void) fread_f32matrix  (char *filename, float32  **m,long nrl,long nrh,long ncl, long nch);
206IMAGE_EXPORT(void) fread_f64matrix  (char *filename, float64  **m,long nrl,long nrh,long ncl, long nch);
207
208IMAGE_EXPORT(void) fread_rgb8matrix (char *filename, rgb8     **m,long nrl,long nrh,long ncl, long nch);
209IMAGE_EXPORT(void) fread_rgbx8matrix(char *filename, rgbx8    **m,long nrl,long nrh,long ncl, long nch);
210
211/*
212 * -------------------------------
213 * --- display_matrix_positive ---
214 * -------------------------------
215 */
216
217void display_si8matrix_positive (sint8 * *m, int i0, int i1, int j0, int j1, int iformat, char *name);
218void display_ui8matrix_positive (uint8 * *m, int i0, int i1, int j0, int j1, int iformat, char *name);
219void display_si16matrix_positive(sint16 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
220void display_ui16matrix_positive(uint16 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
221void display_si32matrix_positive(sint32 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
222void display_ui32matrix_positive(uint32 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
223void display_si64matrix_positive(sint64 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
224void display_ui64matrix_positive(uint64 **m, int i0, int i1, int j0, int j1, int iformat, char *name);
225
226// -------------------------------
227// --- write_matrix_positive ---
228// -------------------------------
229
230void write_ui8matrix_positive (uint8  **m,int i0, int i1, int j0, int j1, int iformat, char *filename);
231void write_ui16matrix_positive(uint16 **m,int i0, int i1, int j0, int j1, int iformat, char *filename);
232void write_ui32matrix_positive(uint32 **m,int i0, int i1, int j0, int j1, int iformat, char *filename);
233
234/* ------------------------ */
235/* -- PGM IO for bmatrix -- */
236/* ------------------------ */
237
238IMAGE_EXPORT(uint8 **) LoadPGM_ui8matrix(char *filename, int *nrl, int *nrh, int *ncl, int *nch);
239IMAGE_EXPORT(uint8 **) LoadPGM_bmatrix  (char *filename, int *nrl, int *nrh, int *ncl, int *nch);
240IMAGE_EXPORT(void)     LoadPGM_bmatrix2 (char *filename, int *nrl, int *nrh, int *ncl, int *nch, uint8 **m);
241IMAGE_EXPORT(void)     MLoadPGM_bmatrix (char *filename, int nrl, int nrh, int ncl, int nch, uint8 **m);
242
243IMAGE_EXPORT(void)     SavePGM_bmatrix  (uint8 **m, int nrl, int nrh, int ncl, int nch, char *filename);
244IMAGE_EXPORT(void)     SavePGM_ui8matrix(uint8 **m, int nrl, int nrh, int ncl, int nch, char *filename);
245
246IMAGE_EXPORT(rgb8 **)  LoadPPM_rgb8matrix (char *filename, int *nrl, int *nrh, int *ncl, int *nch);
247IMAGE_EXPORT(void)     LoadPPM_rgb8matrix2(char *filename, int *nrl, int *nrh, int *ncl, int *nch, rgb8 **m);
248
249IMAGE_EXPORT(void)     SavePPM_rgb8matrix(rgb8 **m, int nrl, int nrh, int ncl, int nch, char *filename);
250
251
252
253#ifdef __cplusplus
254}
255#endif
256
257#endif // _NR_IO2_H_
258
Note: See TracBrowser for help on using the repository browser.