IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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)

File:
1 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) {
Note: See TracChangeset for help on using the changeset viewer.