IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2005, 4:40:20 PM (21 years ago)
Author:
desonia
Message:

fixed some tests to match version mismatching in src.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/tst_psImageGeomManip.c

    r4547 r4558  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-07-13 02:47:00 $
     8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-07-15 02:40:20 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    10851085
    10861086    psImage* in = psImageAlloc(cols,rows,PS_TYPE_F32);
    1087     psImage* mask = psImageAlloc(cols,rows,PS_TYPE_MASK);
    10881087    for (psS32 row=0;row<rows;row++) {
    10891088        psF32* inRow = in->data.F32[row];
    1090         psMaskType* maskRow = mask->data.PS_TYPE_MASK_DATA[row];
    10911089        for (psS32 col=0;col<cols;col++) {
    10921090            inRow[col] = (psF32)row+(psF32)col/1000.0f;
    1093             maskRow[col] = 0;
    1094         }
    1095     }
    1096 
    1097 
    1098     // ********** check psImageTransform with minimum specified inputs.
     1091        }
     1092    }
    10991093
    11001094    psImage* out = psImageTransform(NULL,
     
    11441138    }
    11451139
    1146     // zero out buffer
    1147     memset(out->rawDataBuffer, 0, sizeof(psF32)*out->numRows*out->numCols);
    1148 
    1149     psPixels* blanks = psPixelsAlloc(10);
    1150     psPixels* mask = psPixelsAlloc(10);
    1151 
    1152     // perform the same transform, but this time, supply a psImage to recycle and a mask
    1153     out = psImageTransform(out,
    1154                            blanks,
    1155                            in,
    1156                            mask,
    1157                            1,
    1158                            trans,
    1159                            psRegionSet(0,0,0,0),
    1160                            NULL,
    1161                            PS_INTERPOLATE_FLAT,
    1162                            -1);
    1163 
    1164     if (out == NULL) {
    1165         psError(PS_ERR_UNKNOWN, false,
    1166                 "out == NULL");
    1167         return 1;
    1168     }
    1169     if (out->type.type != PS_TYPE_F32) {
    1170         psError(PS_ERR_UNKNOWN, false,
    1171                 "out->type.type != PS_TYPE_F32, out->type.type == %d",
    1172                 out->type.type);
    1173         return 2;
    1174     }
    1175     if (out->numRows != rows*2 || out->numCols != cols*2) {
    1176         psError(PS_ERR_UNKNOWN, false,
    1177                 "out size is %dx%d, not %dx%d",
    1178                 out->numCols, out->numRows, cols*2, rows);
    1179         return 3;
    1180     }
    1181 
    1182     for (psS32 row=0;row<out->numRows;row++) {
    1183         psF32* outRow = out->data.F32[row];
    1184         for (psS32 col=0;col<cols;col++) {
    1185             float inValue = p_psImagePixelInterpolateFLAT_F32(in,
    1186                             col*trans->x->coeff[1][0]+trans->x->coeff[0][0],
    1187                             row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
    1188                             NULL, 0,
    1189                             -1);
    1190             if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) {
    1191                 psError(PS_ERR_UNKNOWN, false,
    1192                         "out at %d,%d was %g, expected %g",
    1193                         col,row,outRow[col], inValue);
    1194                 return 4;
    1195             }
    1196         }
    1197     }
    1198 
    1199 
    12001140    psFree(out);
    12011141    psFree(in);
Note: See TracChangeset for help on using the changeset viewer.