Index: soft/giet_vm/applications/rosenfeld/nrc2/include/nrmem2.h
===================================================================
--- soft/giet_vm/applications/rosenfeld/nrc2/include/nrmem2.h	(revision 772)
+++ soft/giet_vm/applications/rosenfeld/nrc2/include/nrmem2.h	(revision 826)
@@ -11,12 +11,4 @@
 #define _NRMEM2_H_
 
-#ifdef __cplusplus
-#ifdef PRAGMA_VERBOSE
-#pragma message ("C++")
-#endif
-extern "C" {
-#endif
-
-
 /*
  * ------------------
@@ -25,18 +17,20 @@
  */
 
-IMAGE_EXPORT(void) dup_si8matrix    (sint8  **X, long nrl,long nrh,long ncl, long nch,  sint8   **Y);
-IMAGE_EXPORT(void) dup_ui8matrix    (uint8  **X, long nrl,long nrh,long ncl, long nch,  uint8   **Y);
-IMAGE_EXPORT(void) dup_si16matrix   (sint16 **X, long nrl,long nrh,long ncl, long nch,  sint16  **Y);
-IMAGE_EXPORT(void) dup_ui16matrix   (uint16 **X, long nrl,long nrh,long ncl, long nch,  uint16  **Y);
-IMAGE_EXPORT(void) dup_si32matrix   (sint32 **X, long nrl,long nrh,long ncl, long nch,  sint32  **Y);
-IMAGE_EXPORT(void) dup_ui32matrix   (uint32 **X, long nrl,long nrh,long ncl, long nch,  uint32  **Y);
-IMAGE_EXPORT(void) dup_si64matrix   (sint64 **X, long nrl,long nrh,long ncl, long nch,  sint64  **Y);
-IMAGE_EXPORT(void) dup_ui64matrix   (uint64 **X, long nrl,long nrh,long ncl, long nch,  uint64  **Y);
+#define dup_type_matrix(t) \
+void short_name(t,dup_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y);
 
-IMAGE_EXPORT(void) dup_f32matrix   (float32 **X, long nrl,long nrh,long ncl, long nch,  float32 **Y);
-IMAGE_EXPORT(void) dup_f64matrix   (float64 **X, long nrl,long nrh,long ncl, long nch,  float64 **Y);
+dup_type_matrix(int8_t);
+dup_type_matrix(uint8_t);
+dup_type_matrix(int16_t);
+dup_type_matrix(uint16_t);
+dup_type_matrix(int32_t);
+dup_type_matrix(uint32_t);
+dup_type_matrix(int64_t);
+dup_type_matrix(uint64_t);
+dup_type_matrix(float);
+dup_type_matrix(double);
+dup_type_matrix(rgb8);
+dup_type_matrix(rgbx8);
 
-IMAGE_EXPORT(void) dup_rgb8matrix  (rgb8    **X, long nrl,long nrh,long ncl, long nch,  rgb8    **Y);
-IMAGE_EXPORT(void) dup_rgbx8matrix (rgbx8   **X, long nrl,long nrh,long ncl, long nch,  rgbx8   **Y);
 
 
@@ -47,16 +41,21 @@
  */
 
-IMAGE_EXPORT(void) resize_si8matrix  (sint8   **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_ui8matrix  (uint8   **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_si16matrix (sint16  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_ui16matrix (uint16  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_si32matrix (sint32  **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_ui32matrix (uint32  **m, long nrl, long nrh, long ncl, long nch);
+#undef resize_type_matrix
+#define resize_type_matrix(t) \
+void short_name(t,resize_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
 
-IMAGE_EXPORT(void) resize_f32matrix  (float32 **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_f64matrix  (float64 **m, long nrl, long nrh, long ncl, long nch);
+resize_type_matrix(int8_t);
+resize_type_matrix(uint8_t);
+resize_type_matrix(int16_t);
+resize_type_matrix(uint16_t);
+resize_type_matrix(int32_t);
+resize_type_matrix(uint32_t);
+resize_type_matrix(int64_t);
+resize_type_matrix(uint64_t);
+resize_type_matrix(float);
+resize_type_matrix(double);
+resize_type_matrix(rgb8);
+resize_type_matrix(rgbx8);
 
-IMAGE_EXPORT(void) resize_rgb8matrix (rgb8    **m, long nrl, long nrh, long ncl, long nch);
-IMAGE_EXPORT(void) resize_rgbx8matrix(rgbx8   **m, long nrl, long nrh, long ncl, long nch);
 
 
@@ -67,48 +66,50 @@
  */
 
-/* new versions UP */
-IMAGE_EXPORT(void) convert_si8matrix_si16matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, sint16  **Y);
-IMAGE_EXPORT(void) convert_si8matrix_si32matrix(sint8 **X, int nrl, int nrh, int ncl, int nch, sint32  **Y);
-IMAGE_EXPORT(void) convert_si8matrix_f32matrix (sint8 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_si8matrix_f64matrix (sint8 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
+#define convert_type_matrix(t1,t2) \
+void short_name(t1,convert_,short_name(t2,matrix_,matrix))(t1 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t2 ** Y);
 
-IMAGE_EXPORT(void) convert_ui8matrix_ui32matrix (uint8 **X, int nrl, int nrh, int ncl, int nch, uint32  **Y);
-IMAGE_EXPORT(void) convert_ui8matrix_ui16matrix (uint8 **X, int nrl, int nrh, int ncl, int nch, uint16  **Y);
-IMAGE_EXPORT(void) convert_ui8matrix_f32matrix  (uint8 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_ui8matrix_f64matrix  (uint8 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
+convert_type_matrix(int8_t,int16_t);
+convert_type_matrix(int8_t,int32_t);
+convert_type_matrix(int8_t,float);
+convert_type_matrix(int8_t,double);
+convert_type_matrix(uint8_t,uint16_t);
+convert_type_matrix(uint8_t,uint32_t);
+convert_type_matrix(uint8_t,float);
+convert_type_matrix(uint8_t,double);
+convert_type_matrix(uint8_t,rgb8);
+convert_type_matrix(uint8_t,rgbx8);
+convert_type_matrix(int16_t,int32_t);
+convert_type_matrix(int16_t,float);
+convert_type_matrix(int16_t,double);
+convert_type_matrix(uint16_t,uint32_t);
+convert_type_matrix(uint16_t,float);
+convert_type_matrix(uint16_t,double);
+convert_type_matrix(int32_t,float);
+convert_type_matrix(int32_t,double);
+convert_type_matrix(uint32_t,float);
+convert_type_matrix(uint32_t,double);
 
-IMAGE_EXPORT(void) convert_ui8matrix_rgb8matrix (uint8 **X, int nrl, int nrh, int ncl, int nch, rgb8    **Y);
-IMAGE_EXPORT(void) convert_ui8matrix_rgbx8matrix(uint8 **X, int nrl, int nrh, int ncl, int nch, rgbx8   **Y);
-
-IMAGE_EXPORT(void) convert_si16matrix_si32matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, sint32  **Y);
-IMAGE_EXPORT(void) convert_si16matrix_f32matrix (sint16 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_si16matrix_f64matrix (sint16 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
-
-IMAGE_EXPORT(void) convert_ui16matrix_ui32matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, uint32  **Y);
-IMAGE_EXPORT(void) convert_ui16matrix_f32matrix (uint16 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_ui16matrix_f64matrix (uint16 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
-
-IMAGE_EXPORT(void) convert_si32matrix_f32matrix (sint32 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_si32matrix_f64matrix (sint32 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
-
-IMAGE_EXPORT(void) convert_ui32matrix_f32matrix (uint32 **X, int nrl, int nrh, int ncl, int nch, float32 **Y);
-IMAGE_EXPORT(void) convert_ui32matrix_f64matrix (uint32 **X, int nrl, int nrh, int ncl, int nch, float64 **Y);
+convert_type_matrix(int16_t,int8_t);
+convert_type_matrix(uint16_t,uint8_t);
+convert_type_matrix(int32_t,int8_t);
+convert_type_matrix(uint32_t,uint8_t);
+convert_type_matrix(int32_t,int16_t);
+convert_type_matrix(uint32_t,uint16_t);
+convert_type_matrix(float,int8_t);
+convert_type_matrix(float,uint8_t);
+convert_type_matrix(float,int16_t);
+convert_type_matrix(float,uint16_t);
+convert_type_matrix(float,int32_t);
+convert_type_matrix(float,uint32_t);
+convert_type_matrix(double,int8_t);
+convert_type_matrix(double,uint8_t);
+convert_type_matrix(double,int16_t);
+convert_type_matrix(double,uint16_t);
+convert_type_matrix(double,int32_t);
+convert_type_matrix(double,uint32_t);
+convert_type_matrix(double,float);
+convert_type_matrix(rgb8,uint8_t);
 
 
-/* new versions DOWN */
-IMAGE_EXPORT(void) convert_ui16matrix_ui8matrix(uint16 **X, int nrl, int nrh, int ncl, int nch, uint8 **y);
-IMAGE_EXPORT(void) convert_si16matrix_si8matrix(sint16 **X, int nrl, int nrh, int ncl, int nch, sint8 **y);
-IMAGE_EXPORT(void) convert_ui32matrix_ui8matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, uint8 **y);
-IMAGE_EXPORT(void) convert_si32matrix_si8matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, sint8 **y);
-IMAGE_EXPORT(void) convert_f32matrix_ui8matrix (float32 **X, int nrl, int nrh, int ncl, int nch, uint8 **y);
-IMAGE_EXPORT(void) convert_f32matrix_si8matrix (float32 **X, int nrl, int nrh, int ncl, int nch, sint8 **y);
-
-IMAGE_EXPORT(void) convert_ui32matrix_ui16matrix(uint32 **X, int nrl, int nrh, int ncl, int nch, uint16 **y);
-IMAGE_EXPORT(void) convert_si32matrix_si16matrix(sint32 **X, int nrl, int nrh, int ncl, int nch, sint16 **y);
-IMAGE_EXPORT(void) convert_f32matrix_ui16matrix (float32 **X, int nrl, int nrh, int ncl, int nch, uint16 **y);
-IMAGE_EXPORT(void) convert_f32matrix_si16matrix (float32 **X, int nrl, int nrh, int ncl, int nch, sint16 **y);
-
-IMAGE_EXPORT(void) convert_f32matrix_ui32matrix (float32 **X, int nrl, int nrh, int ncl, int nch, uint32 **y);
-IMAGE_EXPORT(void) convert_f32matrix_si32matrix (float32 **X, int nrl, int nrh, int ncl, int nch, sint32 **y);
 
 /*
@@ -118,6 +119,7 @@
  */
 
-IMAGE_EXPORT(void) lowpart_ui32matrix_ui8matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint8  **Y);
-IMAGE_EXPORT(void) lowpart_ui32matrix_ui16matrix(uint32 **X, long nrl,long nrh,long ncl, long nch, uint16 **Y);
+void lowpart_ui16matrix_ui8matrix(uint16_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y);
+void lowpart_ui32matrix_ui8matrix(uint32_t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** Y);
+
 
 /*
@@ -127,13 +129,16 @@
  */
 
-IMAGE_EXPORT(void) split_rgb8matrix(rgb8 **X, long nrl, long nrh, long ncl, long nch, uint8 **R, uint8 **G, uint8 **B);
-IMAGE_EXPORT(void) merge_rgb8matrix(uint8 **R, uint8 **G, uint8 **B, long nrl, long nrh, long ncl, long nch, rgb8 **X);
+void split_rgb8matrix(rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, uint8_t ** R, uint8_t ** G, uint8_t ** B);
+void merge_rgb8matrix(uint8_t ** R, uint8_t ** G, uint8_t ** B, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 ** X);
 
+#endif /* _NRMEM2_H_ */
 
-#ifdef __cplusplus
-}
-#endif
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
 
-#else
-//#pragma message(" Warning : attemp to re-include nrmem2.h")
-#endif /* _NRMEM2_H_ */
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
