IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4526 for trunk/psLib/src/image


Ignore:
Timestamp:
Jul 8, 2005, 3:24:30 PM (21 years ago)
Author:
drobbin
Message:

Revised psLib based on SDRS rev. 15 changes

Location:
trunk/psLib/src/image
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImage.c

    r4493 r4526  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-07-07 02:17:53 $
     11 *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-09 01:24:30 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4848}
    4949
    50 psImage* psImageAlloc(psU32 numCols,
    51                       psU32 numRows,
     50psImage* psImageAlloc(int numCols,
     51                      int numRows,
    5252                      psElemType type)
    5353{
     
    149149
    150150psImage* psImageRecycle(psImage* old,
    151                         psU32 numCols,
    152                         psU32 numRows,
     151                        int numCols,
     152                        int numRows,
    153153                        const psElemType type)
    154154{
  • trunk/psLib/src/image/psImage.h

    r4493 r4526  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-07 02:17:53 $
     13 *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-09 01:24:30 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5151typedef struct psImage
    5252{
    53     const psMathType type;                 ///< Image data type and dimension.
    54     const psU32 numCols;               ///< Number of columns in image
    55     const psU32 numRows;               ///< Number of rows in image.
    56     const psS32 col0;                  ///< Column position relative to parent.
    57     const psS32 row0;                  ///< Row position relative to parent.
     53    const psMathType type;             ///< Image data type and dimension.
     54    const int numCols;                 ///< Number of columns in image
     55    const int numRows;                 ///< Number of rows in image.
     56    const int col0;                    ///< Column position relative to parent.
     57    const int row0;                    ///< Row position relative to parent.
    5858
    5959    union {
     
    7777
    7878    psPtr rawDataBuffer;               ///< Raw data buffer for Allocating/Freeing Images
     79    void *lock;                        ///< Optional lock for thread safety
    7980}
    8081psImage;
     
    103104 */
    104105psImage* psImageAlloc(
    105     psU32 numCols,                     ///< Number of rows in image.
    106     psU32 numRows,                     ///< Number of columns in image.
     106    int numCols,                       ///< Number of rows in image.
     107    int numRows,                       ///< Number of columns in image.
    107108    psElemType type                    ///< Type of data for image.
    108 );
     109)
     110;
    109111
    110112/** Create a psRegion with the specified attributes.
     
    113115 */
    114116psRegion psRegionSet(
    115     float x0,                         ///< the first column of the region.
    116     float x1,                         ///< the last column of the region + 1.
    117     float y0,                         ///< the first row of the region.
    118     float y1                          ///< the last row of the region + 1.
     117    float x0,                          ///< the first column of the region.
     118    float x1,                          ///< the last column of the region + 1.
     119    float y0,                          ///< the first row of the region.
     120    float y1                           ///< the last row of the region + 1.
    119121);
    120122
     
    146148psImage* psImageRecycle(
    147149    psImage* old,                      ///< the psImage to recycle by resizing image buffer
    148     psU32 numCols,                     ///< the desired number of columns in image
    149     psU32 numRows,                     ///< the desired number of rows in image
     150    int numCols,                       ///< the desired number of columns in image
     151    int numRows,                       ///< the desired number of rows in image
    150152    const psElemType type              ///< the desired datatype of the image
    151153);
  • trunk/psLib/src/image/psImageStructManip.c

    r4493 r4526  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-07-07 02:17:53 $
     10 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-07-09 01:24:30 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3131{
    3232    psU32 elementSize;          // size of image element in bytes
    33     psU32 inputColOffset;       // offset in bytes to first subset pixel in input row
     33    psS32 inputColOffset;       // offset in bytes to first subset pixel in input row
     34
     35    if ( col0 < 0 || row0 < 0 ) {
     36        //        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     37        //                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID);
     38        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     39                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
     40                col0, col1-1, row0, row1-1,
     41                image->numCols-1, image->numRows-1);
     42        return NULL;
     43    }
    3444
    3545    if (image == NULL || image->data.V == NULL) {
     
    6474        return NULL;
    6575    }
     76
     77
     78
    6679    psS32 numRows = row1-row0;
    6780    psS32 numCols = col1-col0;
     
    95108    out->data.V = psRealloc(out->data.V,sizeof(psPtr)*numRows); // resize row pointer array
    96109    *(psMathType*)&out->type = image->type;
    97     *(psU32*)&out->numCols = numCols;
    98     *(psU32*)&out->numRows = numRows;
     110    //    *(psU32*)&out->numCols = numCols;
     111    //    *(psU32*)&out->numRows = numRows;
     112    *(psS32*)&out->numCols = numCols;
     113    *(psS32*)&out->numRows = numRows;
    99114    *(psS32*)&out->row0 = row0;
    100115    *(psS32*)&out->col0 = col0;
Note: See TracChangeset for help on using the changeset viewer.