IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2005, 10:38:12 AM (21 years ago)
Author:
drobbin
Message:

made required changes based on apidelta-report-cycle6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psPixels.c

    r4392 r4401  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-25 02:02:05 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-27 20:38:12 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5555}
    5656
    57 psPixels* psPixelsAlloc(int size)
     57psPixels* psPixelsAlloc(psU32 nalloc)
    5858{
    5959    psPixels* out = psAlloc(sizeof(psPixels));
    6060
    61     if (size > 0) {
    62         out->data = psAlloc(sizeof(psPixelCoord)*size);
     61    if (nalloc > 0) {
     62        out->data = psAlloc(sizeof(psPixelCoord)*nalloc);
    6363    } else {
    6464        out->data = NULL;
    6565    }
    66     out->n = size;
    67     out->nalloc = size;
     66    out->n = nalloc;
     67    out->nalloc = nalloc;
    6868
    6969    psMemSetDeallocator(out, (psFreeFunc)pixelsFree);
     
    7272}
    7373
    74 psPixels* psPixelsRealloc(psPixels* pixels, int size)
    75 {
    76     if (pixels == NULL) {
    77         return psPixelsAlloc(size);
    78     }
    79 
    80     if (size > 0) {
    81         pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*size);
     74psPixels* psPixelsRealloc(psPixels* pixels, psU32 nalloc)
     75{
     76    if (pixels == NULL) {
     77        return psPixelsAlloc(nalloc);
     78    }
     79
     80    if (nalloc > 0) {
     81        pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*nalloc);
    8282    } else {
    8383        psFree(pixels->data);
     
    8585    }
    8686
    87     pixels->nalloc = size;
     87    pixels->nalloc = nalloc;
    8888
    8989    if (pixels->n > pixels->nalloc) {
     
    130130}
    131131
    132 psImage *psPixelsToMask(psImage *out, const psPixels *pixels, const psRegion region, unsigned int maskVal)
     132psImage *psPixelsToMask(psImage *out, const psPixels *pixels, psRegion region, psMaskType maskVal)
    133133{
    134134    // check that the input pixel vector is valid
     
    197197}
    198198
    199 psPixels* psPixelsFromMask(psPixels* out, const psImage* mask, unsigned int maskVal)
     199psPixels* psPixelsFromMask(psPixels* out, const psImage* mask, psMaskType maskVal)
    200200{
    201201    if (mask == NULL) {
Note: See TracChangeset for help on using the changeset viewer.