Changeset 11725
- Timestamp:
- Feb 8, 2007, 3:26:31 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/imageops/tap_psImageConvolve2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tap_psImageConvolve2.c
r11703 r11725 60 60 int main(int argc, char *argv[]) 61 61 { 62 plan_tests(1 6);62 plan_tests(10); 63 63 64 64 diag("psImageConvolve tests"); 65 65 66 66 { 67 // Direct convolution 67 // Direct convolution: 5 tests 68 68 psMemId id = psMemGetId(); 69 69 … … 88 88 89 89 { 90 // FFT forward, then back --- do I get what I started with? 91 psMemId id = psMemGetId(); 92 93 psImage *old = generateImage(); 94 psImage *fftReal = NULL, *fftImag = NULL; 95 bool result = psImageForwardFFT(&fftReal, &fftImag, old); 96 ok(result, "forward fft result"); 97 skip_start(!result, 3, "forward fft failed"); 98 ok(fftReal->type.type == PS_TYPE_F32 && fftImag->type.type == PS_TYPE_F32, "forward fft types"); 99 psImage *new = NULL; 100 result = psImageBackwardFFT(&new, fftReal, fftImag, old->numCols); 101 ok(result, "backward fft result"); 102 skip_start(!result, 2, "backward fft failed"); 103 ok(new->type.type == PS_TYPE_F32, "backward fft type"); 104 bool correct = true; 105 for (int y = 0; y < old->numRows; y++) { 106 for (int x = 0; x < old->numCols; x++) { 107 if (fabs(new->data.F32[y][x] / IMAGE_SIZE / IMAGE_SIZE - old->data.F32[y][x]) > TOL) { 108 correct = false; 109 } 110 } 111 } 112 ok(correct, "new matches old"); 113 psFree(new); 114 skip_end(); 115 skip_end(); 116 117 psFree(fftReal); 118 psFree(fftImag); 119 psFree(old); 120 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 121 122 } 123 124 { 125 // FFT convolution 90 // FFT convolution: 5 tests 126 91 psMemId id = psMemGetId(); 127 92
Note:
See TracChangeset
for help on using the changeset viewer.
