IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageIO.c

    r1942 r2204  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-02 02:09:21 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-27 00:57:33 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#define GENIMAGE(img,c,r,TYP, valueFcn) \
    2626img = psImageAlloc(c,r,PS_TYPE_##TYP); \
    27 for (unsigned int row=0;row<r;row++) { \
     27for (psU32 row=0;row<r;row++) { \
    2828    ps##TYP* imgRow = img->data.TYP[row]; \
    29     for (unsigned int col=0;col<c;col++) { \
     29    for (psU32 col=0;col<c;col++) { \
    3030        imgRow[col] = (ps##TYP)(valueFcn); \
    3131    } \
    3232}
    3333
    34 static int testImageRead(void);
    35 static int testImageWrite(void);
     34static psS32 testImageRead(void);
     35static psS32 testImageWrite(void);
    3636
    3737testDescription tests[] = {
     
    4747                          };
    4848
    49 int main(int argc, char* argv[])
     49psS32 main(psS32 argc, char* argv[])
    5050{
    5151    psLogSetLevel(PS_LOG_INFO);
     
    5757}
    5858
    59 int testImageRead(void)
     59psS32 testImageRead(void)
    6060{
    61     int N = 256;
    62     int M = 128;
     61    psS32 N = 256;
     62    psS32 M = 128;
    6363    psImage* image = NULL;
    6464
     
    127127            return 6; \
    128128        } \
    129         for (unsigned int row = readN0; row < readN; row++) { \
     129        for (psU32 row = readN0; row < readN; row++) { \
    130130            ps##TYP* imgRow = img->data.TYP[row-readN0]; \
    131131            ps##TYP* img2Row = img2->data.TYP[row]; \
    132132            ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
    133133            ps##TYP* img4Row = img4->data.TYP[row]; \
    134             for (unsigned int col = readM0; col < readM; col++) { \
     134            for (psU32 col = readM0; col < readM; col++) { \
    135135                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
    136136                    psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
     
    155155            return 9; \
    156156        } \
    157         for (unsigned int row = readN0; row < readN; row++) { \
     157        for (psU32 row = readN0; row < readN; row++) { \
    158158            ps##TYP* imgRow = img->data.TYP[row-readN0]; \
    159159            ps##TYP* img2Row = img2->data.TYP[row]; \
    160160            ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
    161161            ps##TYP* img4Row = img4->data.TYP[row]; \
    162             for (unsigned int col = readM0; col < readM; col++) { \
     162            for (psU32 col = readM0; col < readM; col++) { \
    163163                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
    164164                    psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
     
    258258}
    259259
    260 int testImageWrite(void)
     260psS32 testImageWrite(void)
    261261{
    262262    psImage* img = NULL;
    263263    psImage* img2 = NULL;
    264     int m = 64;
    265     int n = 96;
     264    psS32 m = 64;
     265    psS32 n = 96;
    266266
    267267    /*
     
    318318        return 16;
    319319    }
    320     for (unsigned int row=0;row<n;row++) {
     320    for (psU32 row=0;row<n;row++) {
    321321        psF32* imgRow = img->data.F32[row];
    322         for (unsigned int col=0;col<m;col++) {
     322        for (psU32 col=0;col<m;col++) {
    323323            if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) {
    324324                psError(__func__,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
Note: See TracChangeset for help on using the changeset viewer.