IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 12:55:05 PM (20 years ago)
Author:
Paul Price
Message:

Following today's meeting, we agreed that psVectorAlloc (and therefore
psArrayAlloc also) shall set the number of elements in use to equal the
number of elements allocated. We introduce new functions,
psVectorAllocEmpty and psArrayAllocEmpty, that allocate a vector and set
the length to zero.

File:
1 edited

Legend:

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

    r8627 r9730  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-08-26 04:34:28 $
     10 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-10-24 22:52:55 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1818
    1919#include "psMemory.h"
     20#include "psVector.h"
    2021#include "psImagePixelExtract.h"
    2122#include "psError.h"
     
    392393    if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) {
    393394        psVector* imgVec = psVectorAlloc(numRows, type);
    394         imgVec->n = imgVec->nalloc;
    395395        psVector* maskVec = NULL;
    396396        psMaskType* maskData = NULL;
     
    417417        if (mask != NULL) {
    418418            maskVec = psVectorAlloc(numRows, mask->type.type);
    419             maskVec->n = maskVec->nalloc;
    420419        }
    421420        #define PSIMAGE_CUT_VERTICAL(TYPE) \
     
    855854        // n.b. alloc enough for the data by making the vectors slightly larger
    856855        // than the area of the region of interest.
    857         buffer[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]),
    858                                     input->type.type);
    859         buffer[lcv]->n = 0;
     856        buffer[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]),
     857                                         input->type.type);
    860858
    861859        bufferMask[lcv] = NULL;
    862860        if (mask != NULL) {
    863             bufferMask[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]),
    864                                             PS_TYPE_MASK);
    865             bufferMask[lcv]->n = 0;
     861            bufferMask[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]),
     862                                                 PS_TYPE_MASK);
    866863        }
    867864    }
Note: See TracChangeset for help on using the changeset viewer.