Changeset 826 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrset2x.c
- Timestamp:
- Jul 13, 2017, 11:01:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrset2x.c
r772 r826 16 16 #include <stddef.h> 17 17 #include <stdlib.h> 18 #include <math.h> // fabs19 18 20 19 #include "mypredef.h" … … 30 29 31 30 32 /* --------------------------------------------------------------------------------- */ 33 IMAGE_EXPORT(void) zero_si32Pmatrix(si32Point **m, long nrl,long nrh,long ncl,long nch) 34 /* --------------------------------------------------------------------------------- */ 35 { 36 long i,j; 37 si32Point *mi; 38 39 for(i=nrl; i<=nrh; i++) { 40 mi = m[i]; 41 for(j=ncl; j<=nch; j++) { 42 mi[j].x = 0; 43 mi[j].y = 0; 44 } 45 } 31 #undef zero_type_matrix 32 #define zero_type_matrix(t) \ 33 void short_name(t,zero_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) \ 34 { \ 35 t * mi; \ 36 for (int32_t i = nrl; i <= nrh; i++) { \ 37 mi = m[i]; \ 38 for (int32_t j = ncl; j <= nch; j++) { \ 39 mi[j].x = 0; \ 40 mi[j].y = 0; \ 41 INIT_Z; \ 42 } \ 43 } \ 46 44 } 47 /* ------------------------------------------------------------------------------- */ 48 IMAGE_EXPORT(void) zero_f32Pmatrix(f32Point **m, long nrl,long nrh,long ncl,long nch) 49 /* ------------------------------------------------------------------------------- */ 50 { 51 long i,j; 52 f32Point *mi; 53 54 for(i=nrl; i<=nrh; i++) { 55 mi = m[i]; 56 for(j=ncl; j<=nch; j++) { 57 mi[j].x = 0; 58 mi[j].y = 0; 59 } 60 } 61 } 62 /* ----------------------------------------------------------------------------------- */ 63 IMAGE_EXPORT(void) zero_si32Tmatrix(si32Triplet **m, long nrl,long nrh,long ncl,long nch) 64 /* ----------------------------------------------------------------------------------- */ 65 { 66 long i,j; 67 si32Triplet *mi; 68 69 for(i=nrl; i<=nrh; i++) { 70 mi = m[i]; 71 for(j=ncl; j<=nch; j++) { 72 mi[j].x = 0; 73 mi[j].y = 0; 74 mi[j].z = 0; 75 } 76 } 77 } 78 /* --------------------------------------------------------------------------------- */ 79 IMAGE_EXPORT(void) zero_f32Tmatrix(f32Triplet **m, long nrl,long nrh,long ncl,long nch) 80 /* --------------------------------------------------------------------------------- */ 81 { 82 long i,j; 83 f32Triplet *mi; 84 85 for(i=nrl; i<=nrh; i++) { 86 mi = m[i]; 87 for(j=ncl; j<=nch; j++) { 88 mi[j].x = 0; 89 mi[j].y = 0; 90 mi[j].z = 0; 91 } 92 } 93 } 45 46 #define INIT_Z 47 zero_type_matrix(si16Point); 48 zero_type_matrix(ui16Point); 49 zero_type_matrix(si32Point); 50 zero_type_matrix(ui32Point); 51 zero_type_matrix(f32Point); 52 #undef INIT_Z 53 #define INIT_Z ({ mi[j].z = 0; }) 54 zero_type_matrix(si16Triplet); 55 zero_type_matrix(ui16Triplet); 56 zero_type_matrix(si32Triplet); 57 zero_type_matrix(ui32Triplet); 58 zero_type_matrix(f32Triplet); 59 60 61 62 // Local Variables: 63 // tab-width: 4 64 // c-basic-offset: 4 65 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 66 // indent-tabs-mode: nil 67 // End: 68 69 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 70
Note: See TracChangeset
for help on using the changeset viewer.