IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8839


Ignore:
Timestamp:
Sep 19, 2006, 1:54:43 PM (20 years ago)
Author:
drobbin
Message:

edited psHash comment, minor changes/debugging to psPixels, and slight revisions to psPixels.h. updated execute_tap in types dir.

Location:
trunk/psLib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psHash.h

    r4920 r8839  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-08-31 02:07:12 $
     13 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-09-19 23:54:43 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5757;
    5858
    59 
    6059/// Allocate hash buckets in table.
    6160psHash* psHashAlloc(
  • trunk/psLib/src/types/psPixels.c

    r8232 r8839  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-08 23:32:23 $
     9 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-09-19 23:54:43 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2626static void pixelsFree(psPixels* pixels)
    2727{
    28     if (pixels != NULL) {
    29         psFree(pixels->data);
    30     }
     28    psFree(pixels->data);
    3129}
    3230
     
    296294        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    297295                _("Input psPixels can not be NULL."));
     296        psFree(out);
    298297        return NULL;
    299298    }
     
    333332}
    334333
    335 bool p_psPixelsPrint (FILE *fd, psPixels* pixels, const char *name)
    336 {
    337 
    338     fprintf (fd, "psPixels: %s\n", name);
     334bool p_psPixelsPrint (FILE *fd,
     335                      psPixels* pixels,
     336                      const char *name)
     337{
     338    if (fd == NULL) {
     339        fd = stdout;
     340    } else {
     341        if ( fprintf(fd, "\n") < 0 ) {
     342            psError(PS_ERR_IO, true,
     343                    "Invalid file pointer in p_psPixelsPrint.  Could not write to fd.\n");
     344            return false;
     345        }
     346    }
     347
     348    if (name != NULL) {
     349        fprintf (fd, "psPixels: %s\n", name);
     350    }
    339351
    340352    if (pixels == NULL) {
     
    398410    if (pixels == NULL) {
    399411        psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Input psPixels can not be NULL."));
    400         out.x = 0; //XXX: should be NAN when changed to float
    401         out.y = 0; //XXX: should be NAN when changed to float
     412        out.x = NAN; //XXX: should be NAN when changed to float
     413        out.y = NAN; //XXX: should be NAN when changed to float
    402414        return out;
    403415    }
    404416    if (position >= pixels->n) {
    405417        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid position.  Number too large\n");
    406         out.x = 0; //XXX: should be NAN when changed to float
    407         out.y = 0; //XXX: should be NAN when changed to float
     418        out.x = NAN; //XXX: should be NAN when changed to float
     419        out.y = NAN; //XXX: should be NAN when changed to float
    408420        return out;
    409421    }
     
    413425    if (position < 0) {
    414426        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid position.  Negative number too large\n");
    415         out.x = 0; //XXX: should be NAN when changed to float
    416         out.y = 0; //XXX: should be NAN when changed to float
     427        out.x = NAN; //XXX: should be NAN when changed to float
     428        out.y = NAN; //XXX: should be NAN when changed to float
    417429        return out;
    418430    }
  • trunk/psLib/src/types/psPixels.h

    r6874 r8839  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-04-17 22:00:03 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-09-19 23:54:43 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5151#define P_PSPIXELS_SET_NALLOC(pix,n) *(long*)&pix->nalloc = n
    5252
     53
    5354        /** Allocates a new psPixels structure
    5455         *
     
    7778psPixels* psPixelsRealloc(
    7879    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    79     long nalloc                       ///< the size of the coordinate vectors
     80    long nalloc                        ///< the size of the coordinate vectors
    8081);
    8182
    8283/** Add a pixel location to a psPixels
    8384 *
     85 *  Grow the psPixels input by growth.  If growth is less that 1, 10 is used.  If a NULL
     86 *  psPixels is given, a new one is created.
     87 *
    8488 *  @return psPixels*       psPixels with the value appended.
    8589 */
    8690psPixels* p_psPixelsAppend(
    87     psPixels* pixels,                  ///< psPixels to append new coordinate to.  NULL creates a new one.
    88     long growth,
    89     ///< number of elements to grow the psPixels list, if necessary.  if growth < 1, 10 is used.
    90     float x,                             ///< x coordinate to append
    91     float y                              ///< y coordinate to append
     91    psPixels* pixels,                  ///< psPixels to append new coordinate to.
     92    long growth,                       ///< Number of elements to grow the pixels list if necessary.
     93    float x,                           ///< x coordinate to append
     94    float y                            ///< y coordinate to append
    9295);
    9396
  • trunk/psLib/test/types/execute_tap

    r8805 r8839  
    1 make tests
     1make
    22./tap_psArray_all
    33./tap_psListIterator
    4 ./tap_psMetadataConfigParse
     4./tap_psMetadataConfigParse_time
     5./tap_psMetadataConfigRead
    56./tap_psMetadata_copying
    67./tap_psMetadata_creating
     
    1213./tap_psMetadata_polynomials
    1314./tap_psArguments_all
     15./tap_psPixels_all
Note: See TracChangeset for help on using the changeset viewer.