IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 17, 2004, 4:34:00 PM (22 years ago)
Author:
desonia
Message:

modified psImage to match currect IfA input and added copy function.

File:
1 edited

Legend:

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

    r694 r714  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-05-15 00:16:31 $
     8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-05-18 02:34:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    116116                    for (int r=0;r<rows;r++) {
    117117                        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) {
    124124                                psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);
    125125                                psImageFree(image);
     
    136136                    for (int r=0;r<rows;r++) {
    137137                        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) {
    144144                                psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r);
    145145                                psImageFree(image);
     
    156156                    for (int r=0;r<rows;r++) {
    157157                        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) {
    164164                                psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r);
    165165                                psImageFree(image);
     
    176176                    for (int r=0;r<rows;r++) {
    177177                        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 ) {
    185185                                psError(__func__,"Could not set all pixels in complex image at (%d,%d)",c,r);
    186186                                psImageFree(image);
     
    198198                    for (int r=0;r<rows;r++) {
    199199                        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)) {
    206206                                psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)",
    207207                                        type[t],c,r);
Note: See TracChangeset for help on using the changeset viewer.