IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3880


Ignore:
Timestamp:
May 10, 2005, 4:29:39 PM (21 years ago)
Author:
desonia
Message:

tweaks

Location:
trunk/psLib
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevses

    r3866 r3880  
    33<KDevPrjSession>
    44 <DocsAndViews NumberOfDocuments="6" >
    5   <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataIO/psFits.c" >
    6    <View0 line="1202" Type="Source" />
     5  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.h" >
     6   <View0 line="32" Type="Source" />
    77  </Doc0>
    8   <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/image/tst_psImage.c" >
    9    <View0 line="35" Type="Source" />
     8  <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/image/psImageManip.c" >
     9   <View0 line="1054" Type="Source" />
    1010  </Doc1>
    11   <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/configure.ac" >
    12    <View0 line="26" Type="Source" />
     11  <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.c" >
     12   <View0 line="377" Type="Source" />
    1313  </Doc2>
    14   <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/sysUtils/psTrace.h" >
    15    <View0 line="87" Type="Source" />
     14  <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psMatrix.h" >
     15   <View0 line="0" Type="Source" />
    1616  </Doc3>
    17   <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/sysUtils/psTrace.c" >
    18    <View0 line="522" Type="Source" />
     17  <Doc4 NumberOfViews="1" URL="file:///usr/include/gsl/gsl_linalg.h" >
     18   <View0 line="53" Type="Source" />
    1919  </Doc4>
    20   <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psMetadata.h" >
    21    <View0 line="65" Type="Source" />
     20  <Doc5 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataManip/psConstants.h" >
     21   <View0 line="32" Type="Source" />
    2222  </Doc5>
    2323 </DocsAndViews>
  • trunk/psLib/src/dataManip/psConstants.h

    r3700 r3880  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-04-14 03:23:55 $
     8 *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-05-11 02:29:39 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3131These are common mathimatical constants used by various functions in the psLib.
    3232 *****************************************************************************/
    33 #define PS_ONE 1.0
    3433#define PS_PI   3.1415926535897932384626433832795029  /* pi */
    3534#define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
     
    3837#define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
    3938
    40 #define PS_COT(X) (1.0 / atan(X))
    4139#define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
    4240#define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
  • trunk/psLib/src/dataManip/psMatrix.c

    r3476 r3880  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-03-22 21:52:49 $
     23 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-05-11 02:29:39 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    376376psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2)
    377377{
    378     psS32 numRows = 0;
    379     psS32 numCols = 0;
    380378    gsl_matrix *m1 = NULL;
    381379    gsl_matrix *m2 = NULL;
     
    394392    PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP);
    395393
    396     outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type);
    397 
    398     PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP);
    399     PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP);
    400     PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP);
    401 
    402     // Initialize data
    403     numRows = inImage1->numRows;
    404     numCols = inImage1->numCols;
     394    if (inImage1->numRows != inImage2->numCols) {
     395        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2.");
     396        MULTIPLY_CLEANUP;
     397    }
     398    if (inImage1->type.type != inImage2->type.type) {
     399        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match.");
     400        MULTIPLY_CLEANUP;
     401    }
     402
     403    outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type);
    405404
    406405    // Initialize GSL data
    407     m1 = gsl_matrix_alloc(numRows, numCols);
     406    m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols);
    408407    psImageToGslMatrix(m1, inImage1);
    409     m2 = gsl_matrix_alloc(numRows, numCols);
     408    m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols);
    410409    psImageToGslMatrix(m2, inImage2);
    411     m3 = gsl_matrix_alloc(numRows, numCols);
    412     psImageToGslMatrix(m3, outImage);
     410    m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols);
    413411
    414412    // Perform multiplication
  • trunk/psLib/src/image/psImageManip.c

    r3737 r3880  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-04-21 21:18:23 $
     12 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-05-11 02:29:39 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    10561056// invert.  Also, the next SDRS should have a different signature.
    10571057psImage* psImageTransform(psImage *output,
     1058                          psArray** blankPixels,
    10581059                          const psImage *input,
    10591060                          const psImage *inputMask,
    10601061                          int inputMaskVal,
    10611062                          const psPlaneTransform *outToIn,
    1062                           const psImage *combineMask,
    1063                           int combineMaskVal)
     1063                          const psRegion region,
     1064                          const psPixels* pixels,
     1065                          psImageInterpolateMode mode,
     1066                          int exposedValue)
    10641067{
    10651068    if (input == NULL) {
  • trunk/psLib/src/image/psImageManip.h

    r3737 r3880  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-04-21 21:18:23 $
     12 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-05-11 02:29:39 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psCoord.h"
    2222#include "psStats.h"
     23#include "psPixels.h"
    2324
    2425/// @addtogroup Image
     
    183184/** Transform the input image according the supplied transformation.
    184185 *
    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
     186 *  Transform the input image according the supplied transformation. The size
     187 *  of the transformed image is defined by the supplied output image, if
     188 *  non-NULL, or the region otherwise (size region.x1 - region.x0 by region.y1
     189 *  region.y0, with out->x0 = region.x0 and out->y0 = region.y0). If the
     190 *  inputMask is non-NULL, those pixels in the inputMask matching inputMaskVal
    190191 *  are to be ignored in the transformation. The inputMask must be of type
    191192 *  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.
     193 *  generate an error and return NULL. The transformation outToIn specifies the
     194 *  coordinates in the input image of a pixel in the output image — note that
     195 *  this is the reverse of what might be naively expected, but it is what is
     196 *  required in order to use psImagePixelInterpolate. If the pixels array is
     197 *  non-NULL, it shall consist of psPixelCoords, and only those pixels in the
     198 *  output image shall be transformed; otherwise, the entire image is
     199 *  generated. The interpolation is performed using the specified interpolation
     200 *  mode. Where a pixel in the output image does not correspond to a pixel in
     201 *  the input image (or all appropriate pixels in the input image are
     202 *  masked), the value shall be set to exposed, and the pixel added to the
     203 *  appropriate list of pixels (psPixels) in the array of blankPixels for
     204 *  return to the user. This function must be capable of handling the following
     205 *  types for the input (with corresponding types for the output): psF32, psF64.
     206 
    201207 *
    202208 *  @return psImage*    The transformed image.
     
    204210psImage* psImageTransform(
    205211    psImage *output,                   ///< psImage to recycle, or NULL
     212    psArray** blankPixels,             ///<
    206213    const psImage *input,              ///< psImage to apply transform to
    207214    const psImage *inputMask,          ///< if not NULL, mask of input psImage
    208215    int inputMaskVal,                  ///< masking value for inputMask
    209216    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
     217    const psRegion region,             ///<
     218    const psPixels* pixels,            ///<
     219    psImageInterpolateMode mode,       ///<
     220    int exposedValue                   ///<
    212221);
    213222
  • trunk/psLib/src/math/psConstants.h

    r3700 r3880  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-04-14 03:23:55 $
     8 *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-05-11 02:29:39 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3131These are common mathimatical constants used by various functions in the psLib.
    3232 *****************************************************************************/
    33 #define PS_ONE 1.0
    3433#define PS_PI   3.1415926535897932384626433832795029  /* pi */
    3534#define PS_PI_2 1.5707963267948966192313216916397514  /* pi/2 */
     
    3837#define PS_2_PI 0.6366197723675813430755350534900574  /* 2/pi */
    3938
    40 #define PS_COT(X) (1.0 / atan(X))
    4139#define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0)
    4240#define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0))
  • trunk/psLib/src/math/psMatrix.c

    r3476 r3880  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-03-22 21:52:49 $
     23 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-05-11 02:29:39 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    376376psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2)
    377377{
    378     psS32 numRows = 0;
    379     psS32 numCols = 0;
    380378    gsl_matrix *m1 = NULL;
    381379    gsl_matrix *m2 = NULL;
     
    394392    PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP);
    395393
    396     outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type);
    397 
    398     PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP);
    399     PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP);
    400     PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP);
    401 
    402     // Initialize data
    403     numRows = inImage1->numRows;
    404     numCols = inImage1->numCols;
     394    if (inImage1->numRows != inImage2->numCols) {
     395        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2.");
     396        MULTIPLY_CLEANUP;
     397    }
     398    if (inImage1->type.type != inImage2->type.type) {
     399        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match.");
     400        MULTIPLY_CLEANUP;
     401    }
     402
     403    outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type);
    405404
    406405    // Initialize GSL data
    407     m1 = gsl_matrix_alloc(numRows, numCols);
     406    m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols);
    408407    psImageToGslMatrix(m1, inImage1);
    409     m2 = gsl_matrix_alloc(numRows, numCols);
     408    m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols);
    410409    psImageToGslMatrix(m2, inImage2);
    411     m3 = gsl_matrix_alloc(numRows, numCols);
    412     psImageToGslMatrix(m3, outImage);
     410    m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols);
    413411
    414412    // Perform multiplication
Note: See TracChangeset for help on using the changeset viewer.