IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5064


Ignore:
Timestamp:
Sep 16, 2005, 1:56:51 PM (21 years ago)
Author:
drobbin
Message:

Relatively minor changes from new SDRS rev16

Location:
trunk/psLib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImagePixelManip.c

    r4938 r5064  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-09-01 01:05:41 $
     12 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-09-16 23:56:48 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    399399// the region is defined wrt the parent image
    400400void psImageMaskRegion(psImage *image,
    401                        psRegion *region,
     401                       psRegion region,
    402402                       const char *op,
    403403                       psMaskType maskValue)
     
    406406    for (int iy = 0; iy < image->numRows; iy++) {
    407407        for (int ix = 0; ix < image->numCols; ix++) {
    408             if (ix + image->col0 <  region->x0)
     408            if (ix + image->col0 <  region.x0)
    409409                continue;
    410             if (ix + image->col0 >= region->x1)
     410            if (ix + image->col0 >= region.x1)
    411411                continue;
    412             if (iy + image->row0 <  region->y0)
     412            if (iy + image->row0 <  region.y0)
    413413                continue;
    414             if (iy + image->row0 >= region->y1)
     414            if (iy + image->row0 >= region.y1)
    415415                continue;
    416416            if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) {
     
    430430// the region is defined wrt the parent image
    431431void psImageKeepRegion(psImage *image,
    432                        psRegion *region,
     432                       psRegion region,
    433433                       const char *op,
    434434                       psMaskType maskValue)
     
    437437    for (int iy = 0; iy < image->numRows; iy++) {
    438438        for (int ix = 0; ix < image->numCols; ix++) {
    439             if (ix + image->col0 <  region->x0)
     439            if (ix + image->col0 <  region.x0)
    440440                goto maskit;
    441             if (ix + image->col0 >= region->x1)
     441            if (ix + image->col0 >= region.x1)
    442442                goto maskit;
    443             if (iy + image->row0 <  region->y0)
     443            if (iy + image->row0 <  region.y0)
    444444                goto maskit;
    445             if (iy + image->row0 >= region->y1)
     445            if (iy + image->row0 >= region.y1)
    446446                goto maskit;
    447447            continue;
  • trunk/psLib/src/imageops/psImagePixelManip.h

    r4938 r5064  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-09-01 01:05:41 $
     10 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-09-16 23:56:48 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9494void psImageMaskRegion(
    9595    psImage *image,                    ///< the image to set
    96     psRegion *region,                  ///< the specified region
     96    psRegion region,                   ///< the specified region
    9797    const char *op,                    ///< the logical operation
    9898    psMaskType maskValue               ///< the specified bits
     
    106106void psImageKeepRegion(
    107107    psImage *image,                    ///< the image to set
    108     psRegion *region,                  ///< the specified region
     108    psRegion region,                   ///< the specified region
    109109    const char *op,                    ///< the logical operation
    110110    psMaskType maskValue               ///< the specified bits
  • trunk/psLib/src/mathtypes/psImage.c

    r5057 r5064  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-15 21:22:22 $
     11 *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-09-16 23:56:51 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    165165// XXX EAM : this needs to be changes to use psRegion rather than psRegion*
    166166psRegion psRegionForImage(psImage *image,
    167                           psRegion *in)
     167                          psRegion in)
    168168{
    169169
    170170    // x0,y0, x1,y1 are in *parent* units
    171171    //    PS_ASSERT_PTR_NON_NULL(in, NULL);
    172     if( in == NULL ) {
    173         psError(PS_ERR_BAD_PARAMETER_NULL, true, "Unallowable operation.  psRegion *in is NULL.");
    174         return *in;
    175     }
    176     /*    if (out == NULL) {
    177     //    out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1);
    178         *out = psRegionSet(in->x0, in->x1, in->y0, in->y1);
    179         } else {
    180         *out = *in;
    181         }
    182     */    // XXX these are probably wrong (see above)
    183     if (in->x1 <= 0) {
    184         in->x1 = image->col0 + image->numCols + in->x1;
    185     }
    186     if (in->y1 <= 0) {
    187         in->y1 = image->row0 + image->numRows + in->y1;
     172    /*
     173        if( in == NULL ) {
     174            psError(PS_ERR_BAD_PARAMETER_NULL, true, "Unallowable operation.  psRegion in is NULL.");
     175            return in;
     176        }
     177    */    /*    if (out == NULL) {
     178        //    out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1);
     179            *out = psRegionSet(in->x0, in->x1, in->y0, in->y1);
     180            } else {
     181            *out = *in;
     182            }
     183        */    // XXX these are probably wrong (see above)
     184    if (in.x1 <= 0) {
     185        in.x1 = image->col0 + image->numCols + in.x1;
     186    }
     187    if (in.y1 <= 0) {
     188        in.y1 = image->row0 + image->numRows + in.y1;
    188189    }
    189190
    190191    // force the lower-limits to be on the child
    191     in->x0 = PS_MAX(image->col0, in->x0);
    192     in->y0 = PS_MAX(image->row0, in->y0);
     192    in.x0 = PS_MAX(image->col0, in.x0);
     193    in.y0 = PS_MAX(image->row0, in.y0);
    193194
    194195    // force the upper-limits to be on the child
    195     in->x1 = PS_MIN(image->col0 + image->numCols, in->x1);
    196     in->y1 = PS_MIN(image->row0 + image->numRows, in->y1);
    197     return (*in);
     196    in.x1 = PS_MIN(image->col0 + image->numCols, in.x1);
     197    in.y1 = PS_MIN(image->row0 + image->numRows, in.y1);
     198    return (in);
    198199}
    199200
  • trunk/psLib/src/mathtypes/psImage.h

    r5057 r5064  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-09-15 21:22:22 $
     13 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-09-16 23:56:51 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    168168psRegion psRegionForImage(
    169169    psImage *image,                    ///< the image for which the region is to be set
    170     psRegion *in                       ///< the image region limits
     170    psRegion in                        ///< the image region limits
    171171);
    172172
  • trunk/psLib/src/mathtypes/psVector.c

    r4944 r5064  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-09-02 21:32:06 $
     11*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-09-16 23:56:51 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    616616
    617617
    618 bool psVectorInit(psVector *image,
     618bool psVectorInit(psVector *vector,
    619619                  ...)
    620620{
     
    636636    int temp2;
    637637
    638     if (image == NULL)
     638    if (vector == NULL)
    639639        return (false);
    640640
    641     va_start (argp, image);
    642 
    643     switch (image->type.type) {
     641    va_start (argp, vector);
     642
     643    switch (vector->type.type) {
    644644    case PS_TYPE_U8:
    645645        temp = va_arg (argp, psU32);
     
    650650            return false;
    651651        }
    652         for (long iy = 0; iy < image->n; iy++) {
    653             image->data.U8[iy] = vU8;
     652        for (long iy = 0; iy < vector->n; iy++) {
     653            vector->data.U8[iy] = vU8;
    654654        }
    655655        return (true);
    656656    case PS_TYPE_F32:
    657657        vF32 = (psF32)va_arg (argp, psF64);
    658         for (long iy = 0; iy < image->n; iy++) {
    659             image->data.F32[iy] = vF32;
     658        for (long iy = 0; iy < vector->n; iy++) {
     659            vector->data.F32[iy] = vF32;
    660660        }
    661661        return (true);
    662662    case PS_TYPE_F64:
    663663        vF64 = va_arg (argp, psF64);
    664         for (long iy = 0; iy < image->n; iy++) {
    665             image->data.F64[iy] = vF64;
     664        for (long iy = 0; iy < vector->n; iy++) {
     665            vector->data.F64[iy] = vF64;
    666666        }
    667667        return (true);
     
    674674            return false;
    675675        }
    676         for (long iy = 0; iy < image->n; iy++) {
    677             image->data.U16[iy] = vU16;
     676        for (long iy = 0; iy < vector->n; iy++) {
     677            vector->data.U16[iy] = vU16;
    678678        }
    679679        return (true);
    680680    case PS_TYPE_U32:
    681681        vU32 = va_arg (argp, psU32);
    682         for (long iy = 0; iy < image->n; iy++) {
    683             image->data.U32[iy] = vU32;
     682        for (long iy = 0; iy < vector->n; iy++) {
     683            vector->data.U32[iy] = vU32;
    684684        }
    685685        return (true);
    686686    case PS_TYPE_U64:
    687687        vU64 = va_arg (argp, psU64);
    688         for (long iy = 0; iy < image->n; iy++) {
    689             image->data.U64[iy] = vU64;
     688        for (long iy = 0; iy < vector->n; iy++) {
     689            vector->data.U64[iy] = vU64;
    690690        }
    691691        return (true);
     
    698698            return false;
    699699        }
    700         for (long iy = 0; iy < image->n; iy++) {
    701             image->data.S8[iy] = vS8;
     700        for (long iy = 0; iy < vector->n; iy++) {
     701            vector->data.S8[iy] = vS8;
    702702        }
    703703        return (true);
     
    710710            return false;
    711711        }
    712         for (long iy = 0; iy < image->n; iy++) {
    713             image->data.S16[iy] = vS16;
     712        for (long iy = 0; iy < vector->n; iy++) {
     713            vector->data.S16[iy] = vS16;
    714714        }
    715715        return (true);
    716716    case PS_TYPE_S32:
    717717        vS32 = va_arg (argp, psS32);
    718         for (long iy = 0; iy < image->n; iy++) {
    719             image->data.S32[iy] = vS32;
     718        for (long iy = 0; iy < vector->n; iy++) {
     719            vector->data.S32[iy] = vS32;
    720720        }
    721721        return (true);
    722722    case PS_TYPE_S64:
    723723        vS64 = va_arg (argp, psS64);
    724         for (long iy = 0; iy < image->n; iy++) {
    725             image->data.S64[iy] = vS64;
     724        for (long iy = 0; iy < vector->n; iy++) {
     725            vector->data.S64[iy] = vS64;
    726726        }
    727727        return (true);
    728728    case PS_TYPE_C32:
    729729        vC32 = va_arg (argp, psC32);
    730         for (long iy = 0; iy < image->n; iy++) {
    731             image->data.C32[iy] = vC32;
     730        for (long iy = 0; iy < vector->n; iy++) {
     731            vector->data.C32[iy] = vC32;
    732732        }
    733733        return (true);
    734734    case PS_TYPE_C64:
    735735        vC64 = va_arg (argp, psC64);
    736         for (long iy = 0; iy < image->n; iy++) {
    737             image->data.C64[iy] = vC64;
     736        for (long iy = 0; iy < vector->n; iy++) {
     737            vector->data.C64[iy] = vC64;
    738738        }
    739739        return (true);
    740740    default:
    741         psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", image->type);
     741        psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", vector->type);
    742742        return (false);
    743743    }
  • trunk/psLib/src/mathtypes/psVector.h

    r5057 r5064  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-09-15 21:22:22 $
     13 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-09-16 23:56:51 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    204204 */
    205205bool psVectorInit(
    206     psVector *image,                   ///< the vector to be initialized
     206    psVector *vector,                  ///< the vector to be initialized
    207207    ...                                ///< Variable argument list for initialization
    208208);
  • trunk/psLib/test/mathtypes/tst_psImage.c

    r4980 r5064  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-09-09 02:02:54 $
     8 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-09-16 23:56:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    286286{
    287287    psImage *in;
    288     psRegion inReg[1];
     288    psRegion inReg;
    289289    psRegion out;
    290290    in = psImageAlloc(1, 1, PS_TYPE_S32);
    291     inReg[0] = psRegionSet(1, 2, 1, 2);
     291    inReg = psRegionSet(1, 2, 1, 2);
    292292    out = psRegionForImage(in,inReg);
    293     psRegion inReg2[1];
     293    psRegion inReg2;
    294294    psRegion out2;
    295     inReg2[0] = psRegionSet(-1, 0, -2, -1);
     295    inReg2 = psRegionSet(-1, 0, -2, -1);
    296296    out2 = psRegionForImage(in, inReg2);
    297297
Note: See TracChangeset for help on using the changeset viewer.