- Timestamp:
- Jul 13, 2017, 11:01:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/include/nrmem2x.h
r772 r826 12 12 #define _NRMEM2X_H_ 13 13 14 #ifdef __cplusplus15 #ifdef PRAGMA_VERBOSE16 #pragma message ("C++")17 #endif18 extern "C" {19 #endif20 14 21 15 /* ------------------------------------------ */ … … 27 21 /* ------------------------------------------ */ 28 22 29 IMAGE_EXPORT(void) reset_endline_bmatrix (byte **m, long nrl, long nrh, long ncl, long nch); 30 IMAGE_EXPORT(void) reset_endline_i16matrix (int16 **m, long nrl, long nrh, long ncl, long nch); 31 IMAGE_EXPORT(void) reset_endline_ui16matrix(uint16 **m, long nrl, long nrh, long ncl, long nch); 32 IMAGE_EXPORT(void) reset_endline_imatrix (int **m, long nrl, long nrh, long ncl, long nch); 33 IMAGE_EXPORT(void) reset_endline_i32matrix (int32 **m, long nrl, long nrh, long ncl, long nch); 34 IMAGE_EXPORT(void) reset_endline_ui32matrix(uint32 **m, long nrl, long nrh, long ncl, long nch); 35 IMAGE_EXPORT(void) reset_endline_i64matrix (int64 **m, long nrl, long nrh, long ncl, long nch); 23 #define reset_endline_type_matrix(t) \ 24 void short_name(t,reset_endline_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); \ 25 void short_name(t,endline_,matrix)(t ** m, int32_t i, int32_t l); \ 26 void short_name(t,endline0_,matrix)(t ** m, int32_t i, int32_t l, int32_t ncl); \ 27 void short_name(t,endline1_,matrix)(t ** m, int32_t i, int32_t l, int32_t ncl); 36 28 37 IMAGE_EXPORT(void) endline_bmatrix (byte **m, long i, long l); 38 IMAGE_EXPORT(void) endline_i16matrix (int16 **m, long i, long l); 39 IMAGE_EXPORT(void) endline_ui16matrix(uint16 **m, long i, long l); 40 IMAGE_EXPORT(void) endline_imatrix (int **m, long i, long l); 41 IMAGE_EXPORT(void) endline_i32matrix (int32 **m, long i, long l); 42 IMAGE_EXPORT(void) endline_ui32matrix(uint32 **m, long i, long l); 43 IMAGE_EXPORT(void) endline_i64matrix (int64 **m, long i, long l); 29 reset_endline_type_matrix(int8_t); 30 reset_endline_type_matrix(uint8_t); 31 reset_endline_type_matrix(int16_t); 32 reset_endline_type_matrix(uint16_t); 33 reset_endline_type_matrix(int32_t); 34 reset_endline_type_matrix(uint32_t); 35 reset_endline_type_matrix(int64_t); 36 reset_endline_type_matrix(uint64_t); 44 37 45 IMAGE_EXPORT(void) endline0_bmatrix (byte **m, long i, long l, long ncl);46 IMAGE_EXPORT(void) endline0_i16matrix (int16 **m, long i, long l, long ncl);47 IMAGE_EXPORT(void) endline0_ui16matrix(uint16 **m, long i, long l, long ncl);48 IMAGE_EXPORT(void) endline0_imatrix (int **m, long i, long l, long ncl);49 IMAGE_EXPORT(void) endline0_i32matrix (int32 **m, long i, long l, long ncl);50 IMAGE_EXPORT(void) endline0_ui32matrix(uint32 **m, long i, long l, long ncl);51 IMAGE_EXPORT(void) endline0_i64matrix (int64 **m, long i, long l, long ncl);52 38 53 IMAGE_EXPORT(void) endline1_bmatrix (byte **m, long i, long l, long ncl); 54 IMAGE_EXPORT(void) endline1_i16matrix (int16 **m, long i, long l, long ncl); 55 IMAGE_EXPORT(void) endline1_ui16matrix(uint16 **m, long i, long l, long ncl); 56 IMAGE_EXPORT(void) endline1_imatrix (int **m, long i, long l, long ncl); 57 IMAGE_EXPORT(void) endline1_i32matrix (int32 **m, long i, long l, long ncl); 58 IMAGE_EXPORT(void) endline1_ui32matrix(uint32 **m, long i, long l, long ncl); 59 IMAGE_EXPORT(void) endline1_i64matrix (int64 **m, long i, long l, long ncl); 39 #undef resize_type_matrix 40 #define resize_type_matrix(t) \ 41 void short_name(t,resize_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); 60 42 61 IMAGE_EXPORT(void) resize_si16Pmatrix(si16Point **m, long nrl, long nrh, long ncl, long nch); 62 IMAGE_EXPORT(void) resize_ui16Pmatrix(ui16Point **m, long nrl, long nrh, long ncl, long nch); 63 IMAGE_EXPORT(void) resize_si32Pmatrix(si32Point **m, long nrl, long nrh, long ncl, long nch); 64 IMAGE_EXPORT(void) resize_ui32Pmatrix(ui32Point **m, long nrl, long nrh, long ncl, long nch); 65 IMAGE_EXPORT(void) resize_f32Pmatrix(f32Point **m, long nrl, long nrh, long ncl, long nch); 43 resize_type_matrix(si16Point); 44 resize_type_matrix(ui16Point); 45 resize_type_matrix(si32Point); 46 resize_type_matrix(ui32Point); 47 resize_type_matrix(f32Point); 48 resize_type_matrix(si16Triplet); 49 resize_type_matrix(ui16Triplet); 50 resize_type_matrix(si32Triplet); 51 resize_type_matrix(ui32Triplet); 52 resize_type_matrix(f32Triplet); 66 53 67 // Triplet Matrix 68 IMAGE_EXPORT(void) resize_si16Tmatrix(si16Triplet **m, long nrl, long nrh, long ncl, long nch); 69 IMAGE_EXPORT(void) resize_ui16Tmatrix(ui16Triplet **m, long nrl, long nrh, long ncl, long nch); 70 IMAGE_EXPORT(void) resize_si32Tmatrix(si32Triplet **m, long nrl, long nrh, long ncl, long nch); 71 IMAGE_EXPORT(void) resize_ui32Tmatrix(ui32Triplet **m, long nrl, long nrh, long ncl, long nch); 72 IMAGE_EXPORT(void) resize_f32Tmatrix (f32Triplet **m, long nrl, long nrh, long ncl, long nch); 54 55 #define type_matrix_reverse(t) \ 56 void short_name(t,,matrix_reverse)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); 57 58 type_matrix_reverse(int8_t); 59 type_matrix_reverse(uint8_t); 60 type_matrix_reverse(int16_t); 61 type_matrix_reverse(uint16_t); 62 type_matrix_reverse(int32_t); 63 type_matrix_reverse(uint32_t); 64 type_matrix_reverse(int64_t); 65 type_matrix_reverse(uint64_t); 66 type_matrix_reverse(float); 67 type_matrix_reverse(double); 73 68 74 69 75 70 71 #define desinterlace_type_matrix(t) \ 72 void short_name(t,desinterlace_,matrix)(t ** S, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** D0, t ** D1); 76 73 77 /* 78 * -------------- 79 * matrix_reverse 80 * -------------- 81 */ 74 desinterlace_type_matrix(int8_t); 75 desinterlace_type_matrix(uint8_t); 76 desinterlace_type_matrix(int16_t); 77 desinterlace_type_matrix(uint16_t); 78 desinterlace_type_matrix(int32_t); 79 desinterlace_type_matrix(uint32_t); 80 desinterlace_type_matrix(int64_t); 81 desinterlace_type_matrix(uint64_t); 82 desinterlace_type_matrix(float); 83 desinterlace_type_matrix(double); 84 desinterlace_type_matrix(rgb8); 85 desinterlace_type_matrix(rgbx8); 82 86 83 //IMAGE_EXPORT(void) bmatrix_reverse (byte **m, long nrl, long nrh, long ncl, long nch);84 //IMAGE_EXPORT(void) si16matrix_reverse (sint16 **m, long nrl, long nrh, long ncl, long nch);85 //IMAGE_EXPORT(void) usmatrix_reverse(uint16 **m, long nrl, long nrh, long ncl, long nch);86 87 87 /* copie */ 88 IMAGE_EXPORT(void) copyc_bmatrix(byte **src,long nrl,long nrh,long ncl, long nch, byte **cond, byte c, byte **dst);88 #define interlace_type_matrix(t) \ 89 void short_name(t,interlace_,matrix)(t ** S0, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** S1, t ** D); 89 90 90 IMAGE_EXPORT(void) complete_border_bmatrix (byte **m, long nrl,long nrh,long ncl, long nch, long n); 91 IMAGE_EXPORT(void) complete_border1_bmatrix(byte **m, long nrl,long nrh,long ncl, long nch); 92 IMAGE_EXPORT(void) complete_border2_bmatrix(byte **m, long nrl,long nrh,long ncl, long nch); 91 interlace_type_matrix(int8_t); 92 interlace_type_matrix(uint8_t); 93 interlace_type_matrix(int16_t); 94 interlace_type_matrix(uint16_t); 95 interlace_type_matrix(int32_t); 96 interlace_type_matrix(uint32_t); 97 interlace_type_matrix(int64_t); 98 interlace_type_matrix(uint64_t); 99 interlace_type_matrix(float); 100 interlace_type_matrix(double); 101 interlace_type_matrix(rgb8); 102 interlace_type_matrix(rgbx8); 93 103 94 IMAGE_EXPORT(void) copy1c_bmatrix (byte **X, long nc, byte **Y, long nrl, long nrh, long ncl, long nch); 95 IMAGE_EXPORT(void) copy1c_si16matrix (sint16 **X, long nc, sint16 **Y, long nrl, long nrh, long ncl, long nch); 96 IMAGE_EXPORT(void) copy1c_ui16matrix (uint16 **X, long nc, uint16 **Y, long nrl, long nrh, long ncl, long nch); 97 IMAGE_EXPORT(void) copy1c_si32matrix (sint32 **X, long nc, sint32 **Y, long nrl, long nrh, long ncl, long nch); 98 IMAGE_EXPORT(void) copy1c_ui32matrix (uint32 **X, long nc, uint32 **Y, long nrl, long nrh, long ncl, long nch); 99 IMAGE_EXPORT(void) copy1c_f32matrix (float32 **X, long nc, float32 **Y, long nrl, long nrh, long ncl, long nch); 100 IMAGE_EXPORT(void) copy1c_f64matrix (float64 **X, long nc, float64 **Y, long nrl, long nrh, long ncl, long nch); 101 IMAGE_EXPORT(void) copy1c_rgb8matrix (rgb8 **X, long nc, rgb8 **Y, long nrl, long nrh, long ncl, long nch); 102 IMAGE_EXPORT(void) copy1c_rgbx8matrix(rgbx8 **X, long nc, rgbx8 **Y, long nrl, long nrh, long ncl, long nch); 104 105 #define copyc_type_matrix(t) \ 106 void short_name(t,copyc_,matrix)(t ** src, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** cond, t c, t ** dst) \ 103 107 104 108 /* … … 106 110 * dst(i,j) = src(i,j) si cond(i,j) == c 107 111 */ 108 /*109 IMAGE_EXPORT(void) copy1r_bmatrix (byte **X, long nr, byte **Y, long nrl, long nrh, long ncl, long nch);110 IMAGE_EXPORT(void) copy1r_smatrix (sint16 **X, long nr, sint16 **Y, long nrl, long nrh, long ncl, long nch);111 IMAGE_EXPORT(void) copy1r_usmatrix (uint16 **X, long nr, uint16 **Y, long nrl, long nrh, long ncl, long nch);112 IMAGE_EXPORT(void) copy1r_imatrix (int **X, long nr, int **Y, long nrl, long nrh, long ncl, long nch);113 IMAGE_EXPORT(void) copy1r_uimatrix (uint **X, long nr, uint **Y, long nrl, long nrh, long ncl, long nch);114 IMAGE_EXPORT(void) copy1r_matrix (float **X, long nr, float **Y, long nrl, long nrh, long ncl, long nch);115 IMAGE_EXPORT(void) copy1r_dmatrix (double **X, long nr, double **Y, long nrl, long nrh, long ncl, long nch);116 IMAGE_EXPORT(void) copy1r_rgb8matrix (rgb8 **X, long nr, rgb8 **Y, long nrl, long nrh, long ncl, long nch);117 IMAGE_EXPORT(void) copy1r_rgbx8matrix(rgbx8 **X, long nr, rgbx8 **Y, long nrl, long nrh, long ncl, long nch);118 112 119 IMAGE_EXPORT(void) copy_bmatrix (byte **m1, long nrl1,long nrh1,long ncl1, long nch1, byte **m2, long nrl2, long nrh2, long ncl2, long nch2); 120 IMAGE_EXPORT(void) copy_smatrix (sint16 **m1, long nrl1,long nrh1,long ncl1, long nch1, sint16 **m2, long nrl2, long nrh2, long ncl2, long nch2); 121 IMAGE_EXPORT(void) copy_usmatrix (uint16 **m1, long nrl1,long nrh1,long ncl1, long nch1, uint16 **m2, long nrl2, long nrh2, long ncl2, long nch2); 122 IMAGE_EXPORT(void) copy_imatrix (int **m1, long nrl1,long nrh1,long ncl1, long nch1, int **m2, long nrl2, long nrh2, long ncl2, long nch2); 123 IMAGE_EXPORT(void) copy_uimatrix (uint **m1, long nrl1,long nrh1,long ncl1, long nch1, uint **m2, long nrl2, long nrh2, long ncl2, long nch2); 124 IMAGE_EXPORT(void) copy_matrix (float **m1, long nrl1,long nrh1,long ncl1, long nch1, float **m2, long nrl2, long nrh2, long ncl2, long nch2); 125 IMAGE_EXPORT(void) copy_dmatrix (double **m1, long nrl1,long nrh1,long ncl1, long nch1, double **m2, long nrl2, long nrh2, long ncl2, long nch2); 126 IMAGE_EXPORT(void) copy_rgb8matrix (rgb8 **m1, long nrl1,long nrh1,long ncl1, long nch1, rgb8 **m2, long nrl2, long nrh2, long ncl2, long nch2); 127 IMAGE_EXPORT(void) copy_rgbx8matrix(rgbx8 **m1, long nrl1,long nrh1,long ncl1, long nch1, rgbx8 **m2, long nrl2, long nrh2, long ncl2, long nch2); 128 129 IMAGE_EXPORT(void) copy_sub_bmatrix(byte **src, long nrl,long nrh,long ncl, long nch, byte **dst); 130 131 IMAGE_EXPORT(void) extract_bmatrix (byte **src, long nrl,long nrh,long ncl, long nch, byte **dst); 132 IMAGE_EXPORT(void) extract_smatrix (sint16 **src, long nrl,long nrh,long ncl, long nch, sint16 **dst); 133 IMAGE_EXPORT(void) extract_usmatrix(uint16 **src, long nrl,long nrh,long ncl, long nch, uint16 **dst); 134 IMAGE_EXPORT(void) extract_imatrix (int **src, long nrl,long nrh,long ncl, long nch, int **dst); 135 IMAGE_EXPORT(void) extract_uimatrix(uint **src, long nrl,long nrh,long ncl, long nch, uint **dst); 136 IMAGE_EXPORT(void) extract_matrix (float **src, long nrl,long nrh,long ncl, long nch, float **dst); 137 IMAGE_EXPORT(void) extract_dmatrix (double **src, long nrl,long nrh,long ncl, long nch, double **dst); 138 */ 139 IMAGE_EXPORT(void) copy_center_bmatrix(byte **src, long nrl0,long nrh0,long ncl0, long nch0, byte **dst, long nrl1,long nrh1,long ncl1, long nch1); 140 141 IMAGE_EXPORT(void) copy_sub_imatrix(int **src, long nrl,long nrh,long ncl, long nch, int **dst); 142 143 IMAGE_EXPORT(void) copy_sub_imatrix_index(int **src, long nrl,long nrh, long ncl, long nch, int **dst,int *index); 144 145 /* --------------------- */ 146 /* --- De-Interleave --- */ 147 /* --------------------- */ 148 149 IMAGE_EXPORT(void) desinterlace_bmatrix (byte **S, long nrl, long nrh, long ncl, long nch, byte **D0, byte **D1); 150 IMAGE_EXPORT(void) desinterlace_rgb8matrix(rgb8 **S, long nrl, long nrh, long ncl, long nch, rgb8 **D0, rgb8 **D1); 151 152 IMAGE_EXPORT(void) interlace_bmatrix (byte **S0, long nrl, long nrh, long ncl, long nch, byte **S1, byte **D); 153 IMAGE_EXPORT(void) interlace_rgb8matrix(rgb8 **S0, long nrl, long nrh, long ncl, long nch, rgb8 **S1, rgb8 **D); 113 copyc_type_matrix(int8_t); 114 copyc_type_matrix(uint8_t); 115 copyc_type_matrix(int16_t); 116 copyc_type_matrix(uint16_t); 117 copyc_type_matrix(int32_t); 118 copyc_type_matrix(uint32_t); 119 copyc_type_matrix(int64_t); 120 copyc_type_matrix(uint64_t); 121 copyc_type_matrix(float); 122 copyc_type_matrix(double); 123 copyc_type_matrix(rgb8); 124 copyc_type_matrix(rgbx8); 154 125 155 126 156 #ifdef __cplusplus 157 } 158 #endif 127 #define complete_border_type_matrix(t) \ 128 void short_name(t,complete_border_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t n); \ 129 void short_name(t,complete_border1_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); \ 130 void short_name(t,complete_border2_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); 159 131 160 #else 161 //#pragma message(" Warning : attemp to re-include nrmem2x.h") 132 complete_border_type_matrix(int8_t); 133 complete_border_type_matrix(uint8_t); 134 complete_border_type_matrix(int16_t); 135 complete_border_type_matrix(uint16_t); 136 complete_border_type_matrix(int32_t); 137 complete_border_type_matrix(uint32_t); 138 complete_border_type_matrix(int64_t); 139 complete_border_type_matrix(uint64_t); 140 complete_border_type_matrix(float); 141 complete_border_type_matrix(double); 142 complete_border_type_matrix(rgb8); 143 complete_border_type_matrix(rgbx8); 144 145 146 #define copy1c_type_matrix(t) \ 147 void short_name(t,copy1c_,matrix)(t ** X, int32_t nc, t ** Y, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); \ 148 void short_name(t,copy1r_,matrix)(t ** X, int32_t nr, t ** Y, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch); 149 150 copy1c_type_matrix(int8_t); 151 copy1c_type_matrix(uint8_t); 152 copy1c_type_matrix(int16_t); 153 copy1c_type_matrix(uint16_t); 154 copy1c_type_matrix(int32_t); 155 copy1c_type_matrix(uint32_t); 156 copy1c_type_matrix(int64_t); 157 copy1c_type_matrix(uint64_t); 158 copy1c_type_matrix(float); 159 copy1c_type_matrix(double); 160 copy1c_type_matrix(rgb8); 161 copy1c_type_matrix(rgbx8); 162 163 162 164 #endif /* _NRMEM2X_H_ */ 165
Note: See TracChangeset
for help on using the changeset viewer.