IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2005, 11:20:45 PM (21 years ago)
Author:
eugene
Message:

further basic concepts

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

    • Property svn:ignore set to
      bin
  • trunk/psphot/src/psUtils.c

    r4114 r4129  
    261261}
    262262   
     263bool psImageInit (psImage *image,...) {
     264
     265  va_list argp;
     266  psU8  vU8;
     267  psF32 vF32;
     268  psF64 vF64;
     269
     270  if (image == NULL) return (false);
     271
     272  va_start (argp, image);
     273
     274  switch (image->type.type) {
     275    case PS_TYPE_U8:
     276      vU8 = va_arg (argp, psU32);
     277
     278      for (int iy = 0; iy < image->numRows; iy++) {
     279        for (int ix = 0; ix < image->numCols; ix++) {
     280          image->data.U8[iy][ix] = vU8;
     281        }
     282      }
     283      break;
     284
     285    case PS_TYPE_F32:
     286      vF32 = va_arg (argp, psF64);
     287     
     288      for (int iy = 0; iy < image->numRows; iy++) {
     289        for (int ix = 0; ix < image->numCols; ix++) {
     290          image->data.F32[iy][ix] = vF32;
     291        }
     292      }
     293      return (true);
     294
     295    case PS_TYPE_F64:
     296      vF64 = va_arg (argp, psF64);
     297
     298      for (int iy = 0; iy < image->numRows; iy++) {
     299        for (int ix = 0; ix < image->numCols; ix++) {
     300          image->data.F64[iy][ix] = vF64;
     301        }
     302      }
     303      return (true);
     304
     305    default:
     306      psAbort ("psphot.psUtils", "datatype %d not defined in psImageInit\n", image->type);
     307      return (false);
     308  }
     309  return (false);
     310}           
Note: See TracChangeset for help on using the changeset viewer.