Changeset 714 for trunk/psLib/test/image/tst_psImage.c
- Timestamp:
- May 17, 2004, 4:34:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImage.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r694 r714 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-05-1 5 00:16:31$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-05-18 02:34:00 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 116 116 for (int r=0;r<rows;r++) { 117 117 for (int c=0;c<cols;c++) { 118 image->data. ui16[r][c] = 2*c+r;119 } 120 } 121 for (int r=0;r<rows;r++) { 122 for (int c=0;c<cols;c++) { 123 if (image->data. ui16[r][c] != 2*c+r) {118 image->data.U16[r][c] = 2*c+r; 119 } 120 } 121 for (int r=0;r<rows;r++) { 122 for (int c=0;c<cols;c++) { 123 if (image->data.U16[r][c] != 2*c+r) { 124 124 psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r); 125 125 psImageFree(image); … … 136 136 for (int r=0;r<rows;r++) { 137 137 for (int c=0;c<cols;c++) { 138 image->data. f32[r][c] = 2.0f*c+r;139 } 140 } 141 for (int r=0;r<rows;r++) { 142 for (int c=0;c<cols;c++) { 143 if (fabsf(image->data. f32[r][c] - (2.0f*c+r)) > FLT_EPSILON) {138 image->data.F32[r][c] = 2.0f*c+r; 139 } 140 } 141 for (int r=0;r<rows;r++) { 142 for (int c=0;c<cols;c++) { 143 if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) { 144 144 psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r); 145 145 psImageFree(image); … … 156 156 for (int r=0;r<rows;r++) { 157 157 for (int c=0;c<cols;c++) { 158 image->data. f64[r][c] = 2.0f*c+r;159 } 160 } 161 for (int r=0;r<rows;r++) { 162 for (int c=0;c<cols;c++) { 163 if (fabs(image->data. f64[r][c] - (2.0f*c+r)) > DBL_EPSILON) {158 image->data.F64[r][c] = 2.0f*c+r; 159 } 160 } 161 for (int r=0;r<rows;r++) { 162 for (int c=0;c<cols;c++) { 163 if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) { 164 164 psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r); 165 165 psImageFree(image); … … 176 176 for (int r=0;r<rows;r++) { 177 177 for (int c=0;c<cols;c++) { 178 image->data. c32[r][c] = r + I * c;179 } 180 } 181 for (int r=0;r<rows;r++) { 182 for (int c=0;c<cols;c++) { 183 if (fabsf(crealf(image->data. c32[r][c]) - r) > FLT_EPSILON ||184 fabsf(cimagf(image->data. c32[r][c]) - c) > FLT_EPSILON ) {178 image->data.C32[r][c] = r + I * c; 179 } 180 } 181 for (int r=0;r<rows;r++) { 182 for (int c=0;c<cols;c++) { 183 if (fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON || 184 fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) { 185 185 psError(__func__,"Could not set all pixels in complex image at (%d,%d)",c,r); 186 186 psImageFree(image); … … 198 198 for (int r=0;r<rows;r++) { 199 199 for (int c=0;c<cols;c++) { 200 image->data. ui8[r][c] = (uint8_t)(r + c);201 } 202 } 203 for (int r=0;r<rows;r++) { 204 for (int c=0;c<cols;c++) { 205 if (image->data. ui8[r][c] != (uint8_t)(r + c)) {200 image->data.U8[r][c] = (uint8_t)(r + c); 201 } 202 } 203 for (int r=0;r<rows;r++) { 204 for (int c=0;c<cols;c++) { 205 if (image->data.U8[r][c] != (uint8_t)(r + c)) { 206 206 psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)", 207 207 type[t],c,r);
Note:
See TracChangeset
for help on using the changeset viewer.
