IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5213


Ignore:
Timestamp:
Sep 30, 2005, 1:09:13 PM (21 years ago)
Author:
drobbin
Message:

Updated ImageRow/Col for tail access, PixelCount fxns to allow for differing psMaskType(u8 or u16)

Location:
trunk/psLib
Files:
5 edited

Legend:

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

    r5174 r5213  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-09-29 01:15:38 $
     10 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-09-30 23:09:13 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5050psVector *psImageRow(psVector *out,
    5151                     const psImage *input,
    52                      psU32 row)
     52                     int row)
    5353{
    5454    if (input == NULL) {
     
    6060                "Specified row number is out of range for specified image.\n");
    6161        return NULL;
     62    }
     63    if (row < 0) {
     64        row += input->numRows;
     65        if (row < 0) {
     66            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     67                    "Specified row number is out of range for specified image.\n");
     68            return NULL;
     69        }
    6270    }
    6371    psVectorRecycle(out, input->numCols, input->type.type);
     
    137145psVector *psImageCol(psVector *out,
    138146                     const psImage *input,
    139                      psU32 column)
     147                     int column)
    140148{
    141149    if (input == NULL) {
     
    143151        return NULL;
    144152    }
    145     if (column >= input->numRows) {
     153    if (column >= input->numCols) {
    146154        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    147155                "Specified column number is out of range for specified image.\n");
    148156        return NULL;
    149157    }
    150     psVectorRecycle(out, input->numCols, input->type.type);
     158    if (column < 0) {
     159        column += input->numCols;
     160        if (column < 0) {
     161            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     162                    "Specified column number is out of range for specified image.\n");
     163            return NULL;
     164        }
     165    }
     166
     167
     168    psVectorRecycle(out, input->numRows, input->type.type);
    151169
    152170    switch (input->type.type) {
  • trunk/psLib/src/imageops/psImagePixelExtract.h

    r5174 r5213  
    88*  @author Robert DeSonia, MHPCC
    99*
    10 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-09-29 01:15:38 $
     10*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-09-30 23:09:13 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4141    psVector *out,                     ///< specified vector to return
    4242    const psImage *input,              ///< input image
    43     psU32 row                          ///< row number to extract
     43    int row                            ///< row number to extract
    4444);
    4545
     
    5252    psVector *out,                     ///< specified vector to return
    5353    const psImage *input,              ///< input image
    54     psU32 column                       ///< column number to extract
     54    int column                         ///< column number to extract
    5555);
    5656
  • trunk/psLib/src/imageops/psImageStats.c

    r5137 r5213  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-26 22:35:53 $
     11 *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-09-30 23:09:13 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    677677
    678678    type = mask->type.type;
     679    if (type != PS_TYPE_MASK) {
     680        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     681                "psImage type does not match the specified psMaskType!\n");
     682        return -1;
     683    }
    679684
    680685    switch (type) {
    681686    case PS_TYPE_U8:
     687    case PS_TYPE_U16:
    682688        for (long i = x0; i < x1; i++) {
    683689            for (long j = y0; j < y1; j++) {
    684                 if (mask->data.U8[i][j] & value) {
     690                if (mask->data.PS_TYPE_MASK_DATA[i][j] & value) {
    685691                    Npixels ++;
    686692                }
     
    692698    case PS_TYPE_S32:
    693699    case PS_TYPE_S64:
    694     case PS_TYPE_U16:
    695700    case PS_TYPE_U32:
    696701    case PS_TYPE_U64:
  • trunk/psLib/src/mathtypes/psVector.c

    r5177 r5213  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-09-29 18:59:01 $
     11*  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-09-30 23:09:13 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    608608        f = fdopen(fd, "a+");
    609609        fprintf (f, "vector: %s\n", name);
    610      
     610
    611611        for (int i = 0; i < a[0].n; i++) {
    612612            fprintf (f, "%f\n", p_psVectorGetElementF64(a, i));
     
    974974    type = mask->type.type;
    975975
     976    if (type != PS_TYPE_MASK) {
     977        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     978                "psVector type does not match the specified psMaskType!\n");
     979        return -1;
     980    }
     981
    976982    switch (type) {
    977983    case PS_TYPE_U8:
     984    case PS_TYPE_U16:
    978985        for (long i = 0; i < mask->n; i++) {
    979             if (mask->data.U8[i] & value) {
     986            if (mask->data.PS_TYPE_MASK_DATA[i] & value) {
    980987                Npixels ++;
    981988            }
     
    986993    case PS_TYPE_S32:
    987994    case PS_TYPE_S64:
    988     case PS_TYPE_U16:
    989995    case PS_TYPE_U32:
    990996    case PS_TYPE_U64:
  • trunk/psLib/test/mathtypes/verified/tst_psVector.stderr

    r5137 r5213  
    7878    The input psVector can not be NULL.
    7979<DATE><TIME>|<HOST>|E|psVectorCountPixelMask (FILE:LINENO)
    80     Input psVector is an unsupported type (0x104).
     80    psVector type does not match the specified psMaskType!
    8181
    8282---> TESTPOINT PASSED (psVector{psVectorCountPixelMask} | tst_psVector.c)
Note: See TracChangeset for help on using the changeset viewer.