IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4214


Ignore:
Timestamp:
Jun 10, 2005, 4:19:05 PM (21 years ago)
Author:
desonia
Message:

beefed up psImageTransform

Location:
trunk/psLib
Files:
13 edited

Legend:

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

    r4212 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-10 21:46:46 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8989        pixels->n = pixels->nalloc;
    9090    }
     91
     92    return pixels;
     93}
     94
     95psPixels* p_psPixelsAppend(psPixels* pixels, int growth, psS32 x, psS32 y)
     96{
     97    if (growth < 1) {
     98        growth = 10;
     99    }
     100
     101    if ( (pixels == NULL) || (pixels->n >= pixels->nalloc) ) {
     102        pixels=psPixelsRealloc(pixels, pixels->nalloc+growth);
     103    }
     104
     105    int n = pixels->n;
     106
     107    pixels->data[n].x = x;
     108    pixels->data[n].y = y;
     109
     110    pixels->n++;
    91111
    92112    return pixels;
  • trunk/psLib/src/collections/psPixels.h

    r4162 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-08 23:40:45 $
     9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6262    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    6363    int size                           ///< the size of the coordinate vectors
     64);
     65
     66/** Add a pixel location to a psPixels
     67 *
     68 *  @return psPixels*       psPixels with the value appended.
     69 */
     70psPixels* p_psPixelsAppend(
     71    psPixels* pixels,                  ///< psPixels to append new coordinate to.  NULL creates a new one.
     72    int growth,                        ///< number of elements to grow the psPixels list, if necessary.  if growth < 1, 10 is used.
     73    psS32 x,                           ///< x coordinate to append
     74    psS32 y                            ///< y coordinate to append
    6475);
    6576
  • trunk/psLib/src/dataIO/psFits.h

    r4191 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-09 19:40:51 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    251251);
    252252
    253 
    254253/** Updates a FITS table.  The current HDU type must be either
    255254 *  PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.
  • trunk/psLib/src/fits/psFits.h

    r4191 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-09 19:40:51 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    251251);
    252252
    253 
    254253/** Updates a FITS table.  The current HDU type must be either
    255254 *  PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.
  • trunk/psLib/src/image/psImageGeomManip.c

    r4211 r4214  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-10 21:26:47 $
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-06-11 02:19:05 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    688688}
    689689
    690 
    691 // XXX: implementation is awaiting working psPlaneTransform functions like
    692 // invert.  Also, the next SDRS should have a different signature.
    693690psImage* psImageTransform(psImage *output,
    694                           psArray** blankPixels,
     691                          psPixels* blankPixels,
    695692                          const psImage *input,
    696693                          const psImage *inputMask,
     
    705702        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    706703                PS_ERRORTEXT_psImage_IMAGE_NULL);
    707         return NULL;
     704        psFree(output);
     705        return NULL;
     706    }
     707    psElemType type = input->type.type;
     708
     709    if (inputMask != NULL) {
     710        if (input->numRows != inputMask->numRows || input->numCols != inputMask->numCols) {
     711            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
     712                    PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE,
     713                    input->numCols, input->numRows,
     714                    inputMask->numCols, inputMask->numRows );
     715            psFree(output);
     716            return NULL;
     717        }
     718        if (inputMask->type.type != PS_TYPE_MASK) {
     719            char* typeStr;
     720            PS_TYPE_NAME(typeStr,inputMask->type.type);
     721            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     722                    PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
     723                    typeStr, PS_TYPE_MASK_NAME);
     724            psFree(output);
     725            return NULL;
     726        }
    708727    }
    709728
     
    714733    }
    715734
    716     int row0 = region.y0;
    717     int row1 = region.y1;
    718     int col0 = region.x0;
    719     int col1 = region.x1;
    720     if (col1 < 1) {
    721         col1 += input->numCols;
    722     }
    723 
    724     if (row1 < 1) {
    725         row1 += input->numRows;
    726     }
    727 
    728     int numRows = row1 - row0;
    729     int numCols = col1 - col0;
    730 
    731     if (numRows < 1 || numCols < 1) {
    732         psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    733                 "The specified region is invalid.");
    734         psFree(output);
    735         return NULL;
    736     }
    737 
    738     // create the output image.
    739     output = psImageRecycle(output, numCols, numRows, input->type.type);
    740     *(psS32*)&output->col0 = region.x0;
    741     *(psS32*)&output->row0 = region.y0;
    742 
     735    int row0;
     736    int row1;
     737    int col0;
     738    int col1;
     739    int numRows;
     740    int numCols;
     741    if (output == NULL) { // output image size is determined by psRegion
     742        row0 = region.y0;
     743        row1 = region.y1;
     744        col0 = region.x0;
     745        col1 = region.x1;
     746        if (col1 < 1) {
     747            col1 += input->numCols;
     748        }
     749
     750        if (row1 < 1) {
     751            row1 += input->numRows;
     752        }
     753
     754        numRows = row1 - row0;
     755        numCols = col1 - col0;
     756
     757        if (numRows < 1 || numCols < 1) {
     758            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
     759                    "The specified region is invalid.");
     760            psFree(output);
     761            return NULL;
     762        }
     763        // create the output image.
     764        output = psImageRecycle(output, numCols, numRows, input->type.type);
     765        *(psS32*)&output->col0 = region.x0;
     766        *(psS32*)&output->row0 = region.y0;
     767    } else { // size of output is determined by output parameter
     768        numRows = output->numRows;
     769        numCols = output->numCols;
     770        row0 = output->row0;
     771        col0 = output->col0;
     772        row1 = row0+numRows;
     773        col1 = col0+numCols;
     774    }
    743775
    744776    // loop through the output image using the domain above and transform
     
    747779    psPlane outPosition;
    748780    psPlane* inPosition = NULL;
    749     for (int row = 0; row < numRows; row++) {
    750         outPosition.y = row+row0;
    751         psF32* outputData=output->data.F32[row];
    752         for (int col = 0; col < numCols; col++) {
    753             outPosition.x = col+col0;
    754             // apply the transform to get the position in the input image
    755             inPosition = psPlaneTransformApply(inPosition, outToIn, &outPosition);
    756 
    757             if (inPosition == NULL) {
    758                 psError(PS_ERR_UNKNOWN, false,
    759                         "Failed to apply the transform");
    760                 psFree(output);
    761                 return NULL;
    762             }
    763             // interpolate the cooresponding input pixel to get the output pixel value.
    764             outputData[col] = (psF32)psImagePixelInterpolate(input,
    765                               inPosition->x, inPosition->y,
    766                               inputMask, inputMaskVal, exposedValue,
    767                               mode);
    768 
    769         }
     781
     782    #define PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     783    /* apply the transform to get the position in the input image */ \
     784    inPosition = psPlaneTransformApply(inPosition, outToIn, &outPosition); \
     785    \
     786    if (inPosition == NULL) { \
     787        psError(PS_ERR_UNKNOWN, false, \
     788                "Failed to apply the transform"); \
     789        psFree(output); \
     790        return NULL; \
     791    } \
     792    /* interpolate the cooresponding input pixel to get the output pixel value. */ \
     793    ps##TYPE value = p_psImagePixelInterpolate##MODE##_##TYPE(input, \
     794                     inPosition->x, inPosition->y, \
     795                     inputMask, inputMaskVal, NAN); \
     796    if (isnan(value)) { \
     797        if (blankPixels != NULL) { \
     798            p_psPixelsAppend(blankPixels, blankPixels->nalloc, outPosition.x, outPosition.y); \
     799        } \
     800        value = exposedValue; \
     801    } \
     802
     803    #define PSIMAGE_TRANSFORM_LOOP(TYPE, MODE) { \
     804        for (int row = 0; row < numRows; row++) { \
     805            outPosition.y = row+row0; \
     806            ps##TYPE* outputData=output->data.TYPE[row]; \
     807            for (int col = 0; col < numCols; col++) { \
     808                outPosition.x = col+col0; \
     809                PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     810                outputData[col] = value; \
     811            } \
     812        } \
     813    }
     814
     815    #define PSIMAGE_TRANSFORM_FROMLIST(TYPE, MODE) { \
     816        int n = pixels->n; \
     817        for (int i= 0; i < n; i++) { \
     818            int x = pixels->data[i].x; \
     819            int y = pixels->data[i].y; \
     820            if (x >= col0 && x < col1 && y >= row0 && y < row1) { \
     821                outPosition.x = x; \
     822                outPosition.y = y; \
     823                PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     824                output->data.TYPE[y][x] = value; \
     825            } \
     826        } \
     827    }
     828
     829    #define PSIMAGE_TRANSFORM_CASE(MODE) \
     830case PS_INTERPOLATE_##MODE: \
     831    switch (type) { \
     832    case PS_TYPE_F32: \
     833        PSIMAGE_TRANSFORM_LOOP(F32,MODE); \
     834        break; \
     835    case PS_TYPE_F64: \
     836        PSIMAGE_TRANSFORM_LOOP(F64,MODE); \
     837        break; \
     838    default: { \
     839            char* typeStr; \
     840            PS_TYPE_NAME(typeStr,type); \
     841            psError(PS_ERR_BAD_PARAMETER_TYPE, true, \
     842                    PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, \
     843                    typeStr); \
     844            psFree(output); \
     845            return NULL; \
     846        } \
     847    } \
     848    break;
     849
     850    switch (mode) {
     851        PSIMAGE_TRANSFORM_CASE(FLAT);
     852        PSIMAGE_TRANSFORM_CASE(BILINEAR);
     853        PSIMAGE_TRANSFORM_CASE(BILINEAR_VARIANCE);
     854    default:
     855        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     856                PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
     857                mode);
     858        psFree(output);
     859        return NULL;
    770860    }
    771861
  • trunk/psLib/src/image/psImageGeomManip.h

    r4162 r4214  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-08 23:40:45 $
     10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-11 02:19:05 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    144144psImage* psImageTransform(
    145145    psImage *output,                   ///< psImage to recycle, or NULL
    146     psArray** blankPixels,             ///<
     146    psPixels* blankPixels,             ///< list of pixels in output image not set, or NULL if no list is desired.
    147147    const psImage *input,              ///< psImage to apply transform to
    148148    const psImage *inputMask,          ///< if not NULL, mask of input psImage
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r4211 r4214  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-10 21:26:47 $
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-06-11 02:19:05 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    688688}
    689689
    690 
    691 // XXX: implementation is awaiting working psPlaneTransform functions like
    692 // invert.  Also, the next SDRS should have a different signature.
    693690psImage* psImageTransform(psImage *output,
    694                           psArray** blankPixels,
     691                          psPixels* blankPixels,
    695692                          const psImage *input,
    696693                          const psImage *inputMask,
     
    705702        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    706703                PS_ERRORTEXT_psImage_IMAGE_NULL);
    707         return NULL;
     704        psFree(output);
     705        return NULL;
     706    }
     707    psElemType type = input->type.type;
     708
     709    if (inputMask != NULL) {
     710        if (input->numRows != inputMask->numRows || input->numCols != inputMask->numCols) {
     711            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
     712                    PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE,
     713                    input->numCols, input->numRows,
     714                    inputMask->numCols, inputMask->numRows );
     715            psFree(output);
     716            return NULL;
     717        }
     718        if (inputMask->type.type != PS_TYPE_MASK) {
     719            char* typeStr;
     720            PS_TYPE_NAME(typeStr,inputMask->type.type);
     721            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     722                    PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
     723                    typeStr, PS_TYPE_MASK_NAME);
     724            psFree(output);
     725            return NULL;
     726        }
    708727    }
    709728
     
    714733    }
    715734
    716     int row0 = region.y0;
    717     int row1 = region.y1;
    718     int col0 = region.x0;
    719     int col1 = region.x1;
    720     if (col1 < 1) {
    721         col1 += input->numCols;
    722     }
    723 
    724     if (row1 < 1) {
    725         row1 += input->numRows;
    726     }
    727 
    728     int numRows = row1 - row0;
    729     int numCols = col1 - col0;
    730 
    731     if (numRows < 1 || numCols < 1) {
    732         psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    733                 "The specified region is invalid.");
    734         psFree(output);
    735         return NULL;
    736     }
    737 
    738     // create the output image.
    739     output = psImageRecycle(output, numCols, numRows, input->type.type);
    740     *(psS32*)&output->col0 = region.x0;
    741     *(psS32*)&output->row0 = region.y0;
    742 
     735    int row0;
     736    int row1;
     737    int col0;
     738    int col1;
     739    int numRows;
     740    int numCols;
     741    if (output == NULL) { // output image size is determined by psRegion
     742        row0 = region.y0;
     743        row1 = region.y1;
     744        col0 = region.x0;
     745        col1 = region.x1;
     746        if (col1 < 1) {
     747            col1 += input->numCols;
     748        }
     749
     750        if (row1 < 1) {
     751            row1 += input->numRows;
     752        }
     753
     754        numRows = row1 - row0;
     755        numCols = col1 - col0;
     756
     757        if (numRows < 1 || numCols < 1) {
     758            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
     759                    "The specified region is invalid.");
     760            psFree(output);
     761            return NULL;
     762        }
     763        // create the output image.
     764        output = psImageRecycle(output, numCols, numRows, input->type.type);
     765        *(psS32*)&output->col0 = region.x0;
     766        *(psS32*)&output->row0 = region.y0;
     767    } else { // size of output is determined by output parameter
     768        numRows = output->numRows;
     769        numCols = output->numCols;
     770        row0 = output->row0;
     771        col0 = output->col0;
     772        row1 = row0+numRows;
     773        col1 = col0+numCols;
     774    }
    743775
    744776    // loop through the output image using the domain above and transform
     
    747779    psPlane outPosition;
    748780    psPlane* inPosition = NULL;
    749     for (int row = 0; row < numRows; row++) {
    750         outPosition.y = row+row0;
    751         psF32* outputData=output->data.F32[row];
    752         for (int col = 0; col < numCols; col++) {
    753             outPosition.x = col+col0;
    754             // apply the transform to get the position in the input image
    755             inPosition = psPlaneTransformApply(inPosition, outToIn, &outPosition);
    756 
    757             if (inPosition == NULL) {
    758                 psError(PS_ERR_UNKNOWN, false,
    759                         "Failed to apply the transform");
    760                 psFree(output);
    761                 return NULL;
    762             }
    763             // interpolate the cooresponding input pixel to get the output pixel value.
    764             outputData[col] = (psF32)psImagePixelInterpolate(input,
    765                               inPosition->x, inPosition->y,
    766                               inputMask, inputMaskVal, exposedValue,
    767                               mode);
    768 
    769         }
     781
     782    #define PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     783    /* apply the transform to get the position in the input image */ \
     784    inPosition = psPlaneTransformApply(inPosition, outToIn, &outPosition); \
     785    \
     786    if (inPosition == NULL) { \
     787        psError(PS_ERR_UNKNOWN, false, \
     788                "Failed to apply the transform"); \
     789        psFree(output); \
     790        return NULL; \
     791    } \
     792    /* interpolate the cooresponding input pixel to get the output pixel value. */ \
     793    ps##TYPE value = p_psImagePixelInterpolate##MODE##_##TYPE(input, \
     794                     inPosition->x, inPosition->y, \
     795                     inputMask, inputMaskVal, NAN); \
     796    if (isnan(value)) { \
     797        if (blankPixels != NULL) { \
     798            p_psPixelsAppend(blankPixels, blankPixels->nalloc, outPosition.x, outPosition.y); \
     799        } \
     800        value = exposedValue; \
     801    } \
     802
     803    #define PSIMAGE_TRANSFORM_LOOP(TYPE, MODE) { \
     804        for (int row = 0; row < numRows; row++) { \
     805            outPosition.y = row+row0; \
     806            ps##TYPE* outputData=output->data.TYPE[row]; \
     807            for (int col = 0; col < numCols; col++) { \
     808                outPosition.x = col+col0; \
     809                PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     810                outputData[col] = value; \
     811            } \
     812        } \
     813    }
     814
     815    #define PSIMAGE_TRANSFORM_FROMLIST(TYPE, MODE) { \
     816        int n = pixels->n; \
     817        for (int i= 0; i < n; i++) { \
     818            int x = pixels->data[i].x; \
     819            int y = pixels->data[i].y; \
     820            if (x >= col0 && x < col1 && y >= row0 && y < row1) { \
     821                outPosition.x = x; \
     822                outPosition.y = y; \
     823                PSIMAGE_TRANSFORM_DOTRANSFORM(TYPE,MODE) \
     824                output->data.TYPE[y][x] = value; \
     825            } \
     826        } \
     827    }
     828
     829    #define PSIMAGE_TRANSFORM_CASE(MODE) \
     830case PS_INTERPOLATE_##MODE: \
     831    switch (type) { \
     832    case PS_TYPE_F32: \
     833        PSIMAGE_TRANSFORM_LOOP(F32,MODE); \
     834        break; \
     835    case PS_TYPE_F64: \
     836        PSIMAGE_TRANSFORM_LOOP(F64,MODE); \
     837        break; \
     838    default: { \
     839            char* typeStr; \
     840            PS_TYPE_NAME(typeStr,type); \
     841            psError(PS_ERR_BAD_PARAMETER_TYPE, true, \
     842                    PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED, \
     843                    typeStr); \
     844            psFree(output); \
     845            return NULL; \
     846        } \
     847    } \
     848    break;
     849
     850    switch (mode) {
     851        PSIMAGE_TRANSFORM_CASE(FLAT);
     852        PSIMAGE_TRANSFORM_CASE(BILINEAR);
     853        PSIMAGE_TRANSFORM_CASE(BILINEAR_VARIANCE);
     854    default:
     855        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     856                PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
     857                mode);
     858        psFree(output);
     859        return NULL;
    770860    }
    771861
  • trunk/psLib/src/imageops/psImageGeomManip.h

    r4162 r4214  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-08 23:40:45 $
     10 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-11 02:19:05 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    144144psImage* psImageTransform(
    145145    psImage *output,                   ///< psImage to recycle, or NULL
    146     psArray** blankPixels,             ///<
     146    psPixels* blankPixels,             ///< list of pixels in output image not set, or NULL if no list is desired.
    147147    const psImage *input,              ///< psImage to apply transform to
    148148    const psImage *inputMask,          ///< if not NULL, mask of input psImage
  • trunk/psLib/src/sys/psConfigure.c

    r4205 r4214  
    1313 *  @author Robert DeSonia, MHPCC
    1414 *
    15  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2005-06-10 01:41:35 $
     15 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2005-06-11 02:19:05 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828{
    2929    char version[80];
    30     snprintf(version,80,"%s-v%s",PACKAGE,VERSION);
     30    snprintf(version,80,"%s-v%s",PACKAGE_NAME,PACKAGE_VERSION);
    3131
    3232    return(psStringCopy(version));
  • trunk/psLib/src/sysUtils/psConfigure.c

    r4205 r4214  
    1313 *  @author Robert DeSonia, MHPCC
    1414 *
    15  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2005-06-10 01:41:35 $
     15 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2005-06-11 02:19:05 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828{
    2929    char version[80];
    30     snprintf(version,80,"%s-v%s",PACKAGE,VERSION);
     30    snprintf(version,80,"%s-v%s",PACKAGE_NAME,PACKAGE_VERSION);
    3131
    3232    return(psStringCopy(version));
  • trunk/psLib/src/types/psPixels.c

    r4212 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-10 21:46:46 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8989        pixels->n = pixels->nalloc;
    9090    }
     91
     92    return pixels;
     93}
     94
     95psPixels* p_psPixelsAppend(psPixels* pixels, int growth, psS32 x, psS32 y)
     96{
     97    if (growth < 1) {
     98        growth = 10;
     99    }
     100
     101    if ( (pixels == NULL) || (pixels->n >= pixels->nalloc) ) {
     102        pixels=psPixelsRealloc(pixels, pixels->nalloc+growth);
     103    }
     104
     105    int n = pixels->n;
     106
     107    pixels->data[n].x = x;
     108    pixels->data[n].y = y;
     109
     110    pixels->n++;
    91111
    92112    return pixels;
  • trunk/psLib/src/types/psPixels.h

    r4162 r4214  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-08 23:40:45 $
     9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-11 02:19:05 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6262    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    6363    int size                           ///< the size of the coordinate vectors
     64);
     65
     66/** Add a pixel location to a psPixels
     67 *
     68 *  @return psPixels*       psPixels with the value appended.
     69 */
     70psPixels* p_psPixelsAppend(
     71    psPixels* pixels,                  ///< psPixels to append new coordinate to.  NULL creates a new one.
     72    int growth,                        ///< number of elements to grow the psPixels list, if necessary.  if growth < 1, 10 is used.
     73    psS32 x,                           ///< x coordinate to append
     74    psS32 y                            ///< y coordinate to append
    6475);
    6576
  • trunk/psLib/test/image/tst_psImageGeomManip.c

    r4191 r4214  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-09 19:40:51 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-11 02:19:05 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3131static psS32 testImageShiftCase(psS32 cols, psS32 rows, float colShift,float rowShift);
    3232static psS32 testImageResample(void);
     33static psS32 testImageTransform(void);
    3334
    3435testDescription tests[] = {
     
    3839                              {testImageShift,561,"psImageShift",0,false},
    3940                              {testImageResample,743,"psImageResample",0,false},
     41                              {testImageTransform,-1,"psImageTransform",0,false},
    4042                              {NULL}
    4143                          };
     
    10731075}
    10741076
     1077static psS32 testImageTransform(void)
     1078{
     1079
     1080    /// XXX: TODO
     1081    return 0;
     1082}
Note: See TracChangeset for help on using the changeset viewer.