IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5556


Ignore:
Timestamp:
Nov 21, 2005, 9:04:47 AM (21 years ago)
Author:
magnier
Message:

added U32 and S32 support to psImageInit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel8_b0/psLib/src/mathtypes/psImage.c

    r5216 r5556  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.89 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-10-01 02:22:12 $
     11 *  @version $Revision: 1.89.4.1 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-11-21 19:04:47 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    221221    va_list argp;
    222222    psU8  vU8;
     223    psU32 vU32;
     224    psS32 vS32;
    223225    psF32 vF32;
    224226    psF64 vF64;
     
    242244            for (int ix = 0; ix < image->numCols; ix++) {
    243245                image->data.U8[iy][ix] = vU8;
     246            }
     247        }
     248        return (true);
     249
     250    case PS_TYPE_U32:
     251        temp = va_arg (argp, psU32);
     252        if ( temp >= PS_MIN_U32 && temp <= PS_MAX_U32 )
     253            vU32 = temp;
     254        else {
     255            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error:  U32 Value out of Range.\n");
     256            return false;
     257        }
     258        for (int iy = 0; iy < image->numRows; iy++) {
     259            for (int ix = 0; ix < image->numCols; ix++) {
     260                image->data.U32[iy][ix] = vU32;
     261            }
     262        }
     263        return (true);
     264
     265    case PS_TYPE_S32:
     266        temp = va_arg (argp, psS32);
     267        if ( temp >= PS_MIN_S32 && temp <= PS_MAX_S32 )
     268            vS32 = temp;
     269        else {
     270            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error:  S32 Value out of Range.\n");
     271            return false;
     272        }
     273        for (int iy = 0; iy < image->numRows; iy++) {
     274            for (int ix = 0; ix < image->numCols; ix++) {
     275                image->data.S32[iy][ix] = vS32;
    244276            }
    245277        }
Note: See TracChangeset for help on using the changeset viewer.