IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3476 for trunk/psLib/src/image


Ignore:
Timestamp:
Mar 22, 2005, 11:52:49 AM (21 years ago)
Author:
desonia
Message:

* empty log message *

Location:
trunk/psLib/src/image
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageErrors.dat

    r2879 r3476  
    7979psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
    8080psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
     81psImageManip_TRANSFORM_NULL            Specified input transform can not be NULL.
  • trunk/psLib/src/image/psImageErrors.h

    r3264 r3476  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-22 21:52:49 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9696#define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
    9797#define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
     98#define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL"
    9899//~End
    99100
  • trunk/psLib/src/image/psImageExtraction.c

    r3313 r3476  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-24 00:19:51 $
     11 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    370370                ps##TYPE *imgVecData = imgVec->data.TYPE; \
    371371                if (maskVec != NULL) { \
    372                     maskVecData = maskVec->data.V; \
    373                     maskData = (psMaskType* )(mask->data.V[row0]) + c; \
     372                    maskVecData = maskVec->data.U8; \
     373                    maskData = (psMaskType* )(mask->data.U8[row0]) + c; \
    374374                } \
    375375                for (psS32 r=row0;r<row1;r++) { \
     
    453453            // point the vector struct to the
    454454            // data to calculate the stats
    455             imgVec->data.V = (psPtr )(in->data.U8[r] + col0 * elementSize);
     455            imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize);
    456456            if (maskVec != NULL) {
    457                 maskVec->data.V = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
     457                maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));
    458458            }
    459459            myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal);
  • trunk/psLib/src/image/psImageManip.c

    r3446 r3476  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-18 02:35:14 $
     12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-03-22 21:52:49 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2727#include "psConstants.h"
    2828#include "psImageErrors.h"
     29#include "psCoord.h"
    2930
    3031psS32 psImageClip(psImage* input,
     
    10341035    break;
    10351036
    1036 
    10371037    switch (mode) {
    10381038        PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT);
     
    10491049    return out;
    10501050}
     1051
     1052
     1053// XXX: implementation is awaiting working psPlaneTransform functions like
     1054// invert.  Also, the next SDRS should have a different signature.
     1055psImage* psImageTransform(psImage *output,
     1056                          const psImage *input,
     1057                          const psImage *inputMask,
     1058                          int inputMaskVal,
     1059                          const psPlaneTransform *outToIn,
     1060                          const psImage *combineMask,
     1061                          int combineMaskVal)
     1062{
     1063    if (input == NULL) {
     1064        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1065                PS_ERRORTEXT_psImage_IMAGE_NULL);
     1066        return NULL;
     1067    }
     1068
     1069    if (outToIn == NULL) {
     1070        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1071                PS_ERRORTEXT_psImageManip_TRANSFORM_NULL);
     1072        return NULL;
     1073    }
     1074
     1075    // find the input image domain in the output image
     1076
     1077    // loop through the output image using the domain above and transform
     1078    // each output pixel to input coordinates and use psImagePixelInterpolate
     1079    // to determine the pixel value.
     1080
     1081
     1082    return NULL;
     1083}
  • trunk/psLib/src/image/psImageManip.h

    r3264 r3476  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:24 $
     13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-22 21:52:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121#include "psImage.h"
     22#include "psCoord.h"
    2223
    2324/// @addtogroup Image
     
    180181);
    181182
     183/** Transform the input image according the supplied transformation.
     184 *
     185 *  Transform the input image according the supplied transformation. In the
     186 *  event that the output is NULL, the smallest possible image capable of
     187 *  containing the entire transformed input image is to be returned; otherwise
     188 *  only the image size specified in the output image is to be used. If the
     189 *  inputMask is not NULL, those pixels in the inputMask matching inputMaskVal
     190 *  are to be ignored in the transformation. The inputMask must be of type
     191 *  psU8, and of the same size as the input, otherwise the function shall
     192 *  generate an error and return NULL. The transformation outToIn specifies
     193 *  the coordinates in the input image of a pixel in the output image - note
     194 *  that this is the reverse of what might be naively expected, but it is what
     195 *  is required in order to use psImagePixelInterpolate. If combineMask is not
     196 *  NULL, then those pixels that match combineMaskVal are not transformed.
     197 *  combineMask must be of type psU8 and of the same size as the output,
     198 *  otherwise the function shall generate an error and return NULL. This
     199 *  function must be capable of handling the following types for the input
     200 *  (with corresponding types for the output): psF32, psF64.
     201 *
     202 *  @return psImage*    The transformed image.
     203 */
     204psImage* psImageTransform(
     205    psImage *output,                   ///< psImage to recycle, or NULL
     206    const psImage *input,              ///< psImage to apply transform to
     207    const psImage *inputMask,          ///< if not NULL, mask of input psImage
     208    int inputMaskVal,                  ///< masking value for inputMask
     209    const psPlaneTransform *outToIn,   ///< the transform to apply
     210    const psImage *combineMask,        ///< if not NULL, mask of pixels not to be transformed
     211    int combineMaskVal                 ///< masking value for combineMask
     212);
     213
    182214#endif
  • trunk/psLib/src/image/psImageStats.c

    r3309 r3476  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-02-23 21:32:40 $
     11 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-03-22 21:52:49 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6363        junkData->nalloc = in->numRows * in->numCols;
    6464        junkData->n = junkData->nalloc;
    65         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     65        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    6666    } else {
    6767        // image not necessarily contiguous
     
    7373        junkData->n = junkData->nalloc;
    7474
    75         psU8* data = junkData->data.V;
     75        psU8* data = junkData->data.U8;
    7676        for (int row = 0; row < numRows; row++) {
    7777            memcpy(data, in->data.V[row], rowSize);
     
    8787            junkMask->nalloc = mask->numRows * mask->numCols;
    8888            junkMask->n = junkMask->nalloc;
    89             junkMask->data.V = mask->data.V[0];
     89            junkMask->data.U8 = mask->data.V[0];
    9090        } else {
    9191            // image not necessarily contiguous
     
    9797            junkMask->n = junkMask->nalloc;
    9898
    99             psU8* data = junkMask->data.V;
     99            psU8* data = junkMask->data.U8;
    100100            for (int row = 0; row < numRows; row++) {
    101101                memcpy(data, mask->data.V[row], rowSize);
     
    136136        junkData->nalloc = in->numRows * in->numCols;
    137137        junkData->n = junkData->nalloc;
    138         junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
     138        junkData->data.U8 = in->data.V[0];      // since psImage data is contiguous...
    139139    } else {
    140140        // image not necessarily contiguous
     
    146146        junkData->n = junkData->nalloc;
    147147
    148         psU8* data = junkData->data.V;
     148        psU8* data = junkData->data.U8;
    149149        for (int row = 0; row < numRows; row++) {
    150150            memcpy(data, in->data.V[row], rowSize);
     
    160160            junkMask->nalloc = mask->numRows * mask->numCols;
    161161            junkMask->n = junkMask->nalloc;
    162             junkMask->data.V = mask->data.V[0];
     162            junkMask->data.U8 = mask->data.V[0];
    163163        } else {
    164164            // image not necessarily contiguous
     
    170170            junkMask->n = junkMask->nalloc;
    171171
    172             psU8* data = junkMask->data.V;
     172            psU8* data = junkMask->data.U8;
    173173            for (int row = 0; row < numRows; row++) {
    174174                memcpy(data, mask->data.V[row], rowSize);
Note: See TracChangeset for help on using the changeset viewer.