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

Last change on this file since 827 was 822, checked in by meunier, 8 years ago

In rosenfeld:

  • Updated nrio0, nrio1, nrio2, nrio1f, nrio2f, nrio1x, nrbool1, nrbool2 and nralloc1 in the nrc2 lib in order to use macro-typed functions
  • Updated the simulation script to include performance evaluation with random images, and a script to generate graphs
  • Updated the clock.h to use 64-bit integers, which potentially breaks the printing on the giet
File size: 3.8 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
14/*
15 * ----------------------
16 * --- display_matrix ---
17 * --- display_matrix_T ---
18 * --- display_matrix_number ---
19 * --- display_matrix_positive ---
20 * ----------------------
21 */
22
23#define display_type_matrix(t) \
24void short_name(t,display_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * name); \
25void short_name(t,display_,matrix_T)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * name); \
26void short_name(t,display_,matrix_number)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * name); \
27void short_name(t,display_,matrix_positive)(t ** m, int32_t i0, int32_t i1, int32_t j0, int32_t j1, int32_t iformat, char * name)
28
29
30display_type_matrix(int8_t);
31display_type_matrix(uint8_t);
32display_type_matrix(int16_t);
33display_type_matrix(uint16_t);
34display_type_matrix(int32_t);
35display_type_matrix(uint32_t);
36display_type_matrix(int64_t);
37display_type_matrix(uint64_t);
38display_type_matrix(float);
39display_type_matrix(double);
40display_type_matrix(rgb8);
41display_type_matrix(rgbx8);
42
43
44/*
45 * --------------------
46 * --- write_matrix ---
47 * --- write_matrix_T ---
48 * --- write_matrix_number ---
49 * --- write_matrix_T_number ---
50 * --- fwrite_matrix ---
51 * --- fread_matrix ---
52 * --------------------
53 */
54
55#define write_type_matrix(t) \
56void short_name(t,write_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * filename); \
57void short_name(t,write_,matrix_T)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * filename); \
58void short_name(t,write_,matrix_number)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * filename); \
59void short_name(t,write_,matrix_T_number)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * format, char * filename); \
60void short_name(t,fwrite_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * filename); \
61void short_name(t,fread_,matrix)(char * filename, t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)  \
62
63write_type_matrix(int8_t);
64write_type_matrix(uint8_t);
65write_type_matrix(int16_t);
66write_type_matrix(uint16_t);
67write_type_matrix(int32_t);
68write_type_matrix(uint32_t);
69write_type_matrix(int64_t);
70write_type_matrix(uint64_t);
71write_type_matrix(float);
72write_type_matrix(double);
73write_type_matrix(rgb8);
74write_type_matrix(rgbx8);
75
76
77// -------------------------------
78// --- write_matrix_positive ---
79// -------------------------------
80
81#define write_type_matrix_positive(t) \
82void short_name(t,write_,matrix_positive)(t ** m, int32_t i0, int32_t i1, int32_t j0, int32_t j1, int32_t iformat, char * filename)
83
84write_type_matrix_positive(uint8_t);
85write_type_matrix_positive(uint16_t);
86write_type_matrix_positive(uint32_t);
87
88/* ------------------------ */
89/* -- PGM IO for bmatrix -- */
90/* ------------------------ */
91
92uint8_t ** LoadPGM_ui8matrix  (char * filename, int32_t * nrl, int32_t * nrh, int32_t * ncl, int32_t * nch);
93void       LoadPGM_ui8matrix2 (char * filename, int32_t * nrl, int32_t * nrh, int32_t * ncl, int32_t * nch, uint8_t ** m);
94rgb8 **    LoadPPM_rgb8matrix (char * filename, int32_t * nrl, int32_t * nrh, int32_t * ncl, int32_t * nch);
95void       LoadPPM_rgb8matrix2(char * filename, int32_t * nrl, int32_t * nrh, int32_t * ncl, int32_t * nch, rgb8 ** m);
96
97void MLoadPGM_ui8matrix(char * filename, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8 ** m);
98void SavePGM_ui8matrix    (uint8_t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * filename);
99void SavePPM_rgb8matrix      (rgb8 ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, char * filename);
100
101
102
103#endif // _NR_IO2_H_
104
Note: See TracBrowser for help on using the repository browser.