Changeset 2156
- Timestamp:
- Oct 15, 2004, 10:00:56 AM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 4 edited
-
psLib.kdevelop.pcs (modified) ( previous)
-
psLib.kdevses (modified) (1 diff)
-
test/image/tst_psImageExtraction.c (modified) (5 diffs)
-
test/image/verified/tst_psImageExtraction.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/psLib.kdevses
r2144 r2156 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 1" >4 <DocsAndViews NumberOfDocuments="3" > 5 5 <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/Doxyfile" > 6 <View0 line="2 5" Type="???" >7 <AdditionalSettings Top="2" Width="1 165" Attach="1" Height="926" Left="2" MinMaxMode="0" />6 <View0 line="27" Type="???" > 7 <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1027" Left="2" MinMaxMode="0" /> 8 8 </View0> 9 9 </Doc0> 10 <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.c" > 11 <View0 line="311" Type="???" > 12 <AdditionalSettings Top="2" Width="1212" Attach="1" Height="752" Left="2" MinMaxMode="0" /> 13 </View0> 14 </Doc1> 15 <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageErrors.dat" > 16 <View0 line="21" Type="???" > 17 <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1001" Left="2" MinMaxMode="0" /> 18 </View0> 19 </Doc2> 10 20 </DocsAndViews> 11 21 <pluginList> -
trunk/psLib/test/image/tst_psImageExtraction.c
r2093 r2156 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-1 3 23:34:58$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-15 20:00:56 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 int testImageSlice(void) 45 45 { 46 const int r = 1000;47 const int c = 2000;46 const int r = 200; 47 const int c = 300; 48 48 const int m = r / 2 -1; 49 49 const int n = r / 4 -1; … … 99 99 \ 100 100 for (int i=0;i<out->n;i++) { \ 101 if (fabs(out->data.F64[i]-image->data. F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF32)r) { \101 if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \ 102 102 psError(__func__,"Improper result at position %d. Got %g, expected %g",i, \ 103 out->data.F64[i],image->data. F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \103 out->data.F64[i],image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \ 104 104 return TESTNUM*4+3; \ 105 105 } \ … … 120 120 psFree(image); 121 121 122 // test MxN case 123 PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_POS, m, i, n / 2, 0 ); 124 PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 ); 125 PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 ); 126 PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 ); 127 128 // test Mx1 case 129 PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_POS, m, i, 0, 4 ); 130 PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 ); 131 PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 ); 132 PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 ); 133 134 // test 1xN case 135 PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 ); 136 PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 ); 137 PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_POS, n, 0, i, 10 ); 138 PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 ); 139 140 // test 1x1 case 141 PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 ); 142 PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 ); 143 PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 ); 144 PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 ); 122 #define PSIMAGESLICE_TEST(TYPE) \ 123 /* test MxN case */ \ 124 PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_POS, m, i, n / 2, 0 ); \ 125 PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 ); \ 126 PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 ); \ 127 PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 ); \ 128 \ 129 /* test Mx1 case */ \ 130 PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_POS, m, i, 0, 4 ); \ 131 PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 ); \ 132 PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 ); \ 133 PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 ); \ 134 \ 135 /* test 1xN case */ \ 136 PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 ); \ 137 PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 ); \ 138 PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_POS, n, 0, i, 10 ); \ 139 PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 ); \ 140 \ 141 /* test 1x1 case */ \ 142 PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 ); \ 143 PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 ); \ 144 PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 ); \ 145 PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 ); \ 146 147 PSIMAGESLICE_TEST(F32); 148 PSIMAGESLICE_TEST(F64); 149 PSIMAGESLICE_TEST(U16); 150 151 image = psImageAlloc( c, r, PS_TYPE_F32 ); 145 152 146 153 /* … … 180 187 return 102; 181 188 } 182 183 189 /* 184 190 -
trunk/psLib/test/image/verified/tst_psImageExtraction.stderr
r2105 r2156 138 138 Following should be an error. 139 139 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 140 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.141 <DATE><TIME>|<HOST>|I|testImageSlice 142 Following should be an error. 143 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 144 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.145 <DATE><TIME>|<HOST>|I|testImageSlice 146 Following should be an error. 147 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 148 Specified subset range, [ 200:<LINENO>,100:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].149 <DATE><TIME>|<HOST>|I|testImageSlice 150 Following should be an error. 151 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 152 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.153 <DATE><TIME>|<HOST>|I|testImageSlice 154 Following should be an error. 155 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 156 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.157 <DATE><TIME>|<HOST>|I|testImageSlice 158 Following should be an error. 159 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 160 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.161 <DATE><TIME>|<HOST>|I|testImageSlice 162 Following should be an error. 163 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 164 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.165 <DATE><TIME>|<HOST>|I|testImageSlice 166 Following should be an error. 167 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 168 Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.140 Specified statistic can not be NULL. 141 <DATE><TIME>|<HOST>|I|testImageSlice 142 Following should be an error. 143 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 144 Specified slice direction, 5, is invalid. 145 <DATE><TIME>|<HOST>|I|testImageSlice 146 Following should be an error. 147 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 148 Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 149 <DATE><TIME>|<HOST>|I|testImageSlice 150 Following should be an error. 151 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 152 Specified subset range, [301:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 153 <DATE><TIME>|<HOST>|I|testImageSlice 154 Following should be an error. 155 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 156 Specified subset range, [30:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 157 <DATE><TIME>|<HOST>|I|testImageSlice 158 Following should be an error. 159 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 160 Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 161 <DATE><TIME>|<HOST>|I|testImageSlice 162 Following should be an error. 163 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 164 Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 165 <DATE><TIME>|<HOST>|I|testImageSlice 166 Following should be an error. 167 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 168 Specified statistic option, 0, is not valid. Must specify one and only one statistic type. 169 169 <DATE><TIME>|<HOST>|I|testImageSlice 170 170 Following should be an error mask size != image size. 171 171 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 172 Input psImage mask size, 200x300, does not match psImage input size, 300x200. 173 <DATE><TIME>|<HOST>|I|testImageSlice 174 Following should be an error invalid mask type. 175 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 176 Input psImage mask type, psS8, is not the supported mask datatype of psU8. 177 <DATE><TIME>|<HOST>|I|testImageSlice 178 Following should be an error invalid image type. 179 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 172 180 Specified psImage type, psU8, is not supported. 173 <DATE><TIME>|<HOST>|I|testImageSlice174 Following should be an error invalid mask type.175 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice176 Input psImage mask size, 2000x1000, does not match psImage input size, 1000x2000.177 <DATE><TIME>|<HOST>|I|testImageSlice178 Following should be an error invalid image type.179 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice180 Specified psImage type, psU8, is not supported.181 <DATE><TIME>|<HOST>|E|psLib.sysUtils.psFree182 Block 12148, allocated at psImage.c:<LINENO>, freed multiple times at tst_psImageExtraction.c:<LINENO>.183 181 184 182 ---> TESTPOINT PASSED (psImage{psImageSlice} | tst_psImageExtraction.c)
Note:
See TracChangeset
for help on using the changeset viewer.
