IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 12, 2005, 9:12:01 AM (21 years ago)
Author:
desonia
Message:

massive restructuring of codebase.

Location:
trunk/psLib/src/mathtypes
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/mathtypes/Makefile.am

    r4446 r4540  
    1 #Makefile for collections functions of psLib
     1#Makefile for mathtypes functions of psLib
    22#
     3noinst_LTLIBRARIES = libpslibmathtypes.la
    34
    4 INCLUDES = \
    5         -I$(top_srcdir)/src/astro \
    6         -I$(top_srcdir)/src/db \
    7         -I$(top_srcdir)/src/fft \
    8         -I$(top_srcdir)/src/fits \
    9         -I$(top_srcdir)/src/imageops \
    10         -I$(top_srcdir)/src/math \
    11         -I$(top_srcdir)/src/mathtypes \
    12         -I$(top_srcdir)/src/sys \
    13         -I$(top_srcdir)/src/types \
    14         -I$(top_srcdir)/src/xml \
    15         $(all_includes)
     5libpslibmathtypes_la_SOURCES = \
     6        psImage.c \
     7        psScalar.c \
     8        psVector.c
    169
    17 noinst_LTLIBRARIES = libpslibcollections.la
    18 
    19 libpslibcollections_la_SOURCES = \
    20         psBitSet.c \
    21         psVector.c \
    22         psPixels.c \
    23         psList.c \
    24         psScalar.c \
    25         psCompare.c \
    26         psArray.c \
    27         psHash.c \
    28         psMetadata.c \
    29         psMetadataIO.c
    30 
    31 BUILT_SOURCES = psCollectionsErrors.h
    32 EXTRA_DIST = psCollectionsErrors.dat psCollectionsErrors.h collections.i
    33 
    34 psCollectionsErrors.h:psCollectionsErrors.dat
    35         $(top_srcdir)/src/psParseErrorCodes --data=$? $@
     10EXTRA_DIST = mathtypes.i
    3611
    3712pslibincludedir = $(includedir)
    3813pslibinclude_HEADERS = \
    39         psBitSet.h \
    40         psVector.h \
    41         psPixels.h \
    42         psList.h \
     14        psImage.h \
    4315        psScalar.h \
    44         psCompare.h \
    45         psArray.h \
    46         psHash.h \
    47         psMetadata.h \
    48         psMetadataIO.h
    49 
     16        psVector.h
  • trunk/psLib/src/mathtypes/psImage.c

    r4409 r4540  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-28 20:17:52 $
     11 *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-12 19:12:01 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4848}
    4949
    50 psImage* psImageAlloc(psU32 numCols,
    51                       psU32 numRows,
     50psImage* psImageAlloc(int numCols,
     51                      int numRows,
    5252                      psElemType type)
    5353{
     
    9191}
    9292
    93 psRegion psRegionSet(psF32 x0,
    94                      psF32 x1,
    95                      psF32 y0,
    96                      psF32 y1)
     93psRegion psRegionSet(float x0,
     94                     float x1,
     95                     float y0,
     96                     float y1)
    9797{
    9898    psRegion out;
     
    149149
    150150psImage* psImageRecycle(psImage* old,
    151                         psU32 numCols,
    152                         psU32 numRows,
     151                        int numCols,
     152                        int numRows,
    153153                        const psElemType type)
    154154{
     
    369369}
    370370
    371 psC64 psImagePixelInterpolate(const psImage* input,
    372                               float x,
    373                               float y,
    374                               const psImage* mask,
    375                               psU32 maskVal,
    376                               psC64 unexposedValue,
    377                               psImageInterpolateMode mode)
     371complex psImagePixelInterpolate(const psImage* input,
     372                                float x,
     373                                float y,
     374                                const psImage* mask,
     375                                psMaskType maskVal,
     376                                complex unexposedValue,
     377                                psImageInterpolateMode mode)
    378378{
    379379
  • trunk/psLib/src/mathtypes/psImage.h

    r4409 r4540  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-28 20:17:52 $
     13 *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-12 19:12:01 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4040    PS_INTERPOLATE_LANCZOS3_VARIANCE,  ///< Variance version of PS_INTERPOLATE_LANCZOS3
    4141    PS_INTERPOLATE_LANCZOS4_VARIANCE,  ///< Variance version of PS_INTERPOLATE_LANCZOS4
    42     PS_INTERPOLATE_NUM_MODES           ///< enum end-marker; does not coorespond to a interpolation mode
     42    //    PS_INTERPOLATE_NUM_MODES           ///< enum end-marker; does not coorespond to a interpolation mode
    4343} psImageInterpolateMode;
    4444
     
    5151typedef struct psImage
    5252{
    53     const psType type;                 ///< Image data type and dimension.
    54     const psU32 numCols;               ///< Number of columns in image
    55     const psU32 numRows;               ///< Number of rows in image.
    56     const psS32 col0;                  ///< Column position relative to parent.
    57     const psS32 row0;                  ///< Row position relative to parent.
     53    const psMathType type;             ///< Image data type and dimension.
     54    const int numCols;                 ///< Number of columns in image
     55    const int numRows;                 ///< Number of rows in image.
     56    const int col0;                    ///< Column position relative to parent.
     57    const int row0;                    ///< Row position relative to parent.
    5858
    5959    union {
     
    7777
    7878    psPtr rawDataBuffer;               ///< Raw data buffer for Allocating/Freeing Images
     79    void *lock;                        ///< Optional lock for thread safety
    7980}
    8081psImage;
     
    8788typedef struct
    8889{
    89     psF32 x0;                         ///< the first column of the region.
    90     psF32 x1;                         ///< the last column of the region.
    91     psF32 y0;                         ///< the first row of the region.
    92     psF32 y1;                         ///< the last row of the region.
     90    float x0;                         ///< the first column of the region.
     91    float x1;                         ///< the last column of the region.
     92    float y0;                         ///< the first row of the region.
     93    float y1;                         ///< the last row of the region.
    9394}
    9495psRegion;
     
    103104 */
    104105psImage* psImageAlloc(
    105     psU32 numCols,                     ///< Number of rows in image.
    106     psU32 numRows,                     ///< Number of columns in image.
     106    int numCols,                       ///< Number of rows in image.
     107    int numRows,                       ///< Number of columns in image.
    107108    psElemType type                    ///< Type of data for image.
    108 );
     109)
     110;
    109111
    110112/** Create a psRegion with the specified attributes.
     
    113115 */
    114116psRegion psRegionSet(
    115     psF32 x0,                         ///< the first column of the region.
    116     psF32 x1,                         ///< the last column of the region + 1.
    117     psF32 y0,                         ///< the first row of the region.
    118     psF32 y1                          ///< the last row of the region + 1.
     117    float x0,                          ///< the first column of the region.
     118    float x1,                          ///< the last column of the region + 1.
     119    float y0,                          ///< the first row of the region.
     120    float y1                           ///< the last row of the region + 1.
    119121);
    120122
     
    146148psImage* psImageRecycle(
    147149    psImage* old,                      ///< the psImage to recycle by resizing image buffer
    148     psU32 numCols,                     ///< the desired number of columns in image
    149     psU32 numRows,                     ///< the desired number of rows in image
     150    int numCols,                       ///< the desired number of columns in image
     151    int numRows,                       ///< the desired number of rows in image
    150152    const psElemType type              ///< the desired datatype of the image
    151153);
    152154
    153155/** Copy an image to a new buffer
    154  * 
     156 *
    155157 *  @return True if image copied or false if error
    156158 */
     
    195197 *                   given x,y doesn't coorespond to a valid image location
    196198 */
    197 psC64 psImagePixelInterpolate(
     199complex psImagePixelInterpolate(
    198200    const psImage* input,              ///< input image for interpolation
    199201    float x,                           ///< column location to derive value of
    200202    float y,                           ///< row location ot derive value of
    201203    const psImage* mask,               ///< if not NULL, the mask of the input image
    202     psU32 maskVal,              ///< the mask value
    203     psC64 unexposedValue,              ///< return value if x,y location is not in image.
     204    psMaskType maskVal,                ///< the mask value
     205    complex unexposedValue,            ///< return value if x,y location is not in image.
    204206    psImageInterpolateMode mode        ///< interpolation mode
    205207);
  • trunk/psLib/src/mathtypes/psScalar.c

    r4409 r4540  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-28 20:17:52 $
     10 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-07-12 19:12:01 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020#include "psAbort.h"
    2121
    22 #include "psCollectionsErrors.h"
     22#include "psErrorText.h"
    2323
    2424psScalar* psScalarAlloc(complex value, psElemType type)
  • trunk/psLib/src/mathtypes/psScalar.h

    r4409 r4540  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-28 20:17:52 $
     13 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-12 19:12:01 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232typedef struct
    3333{
    34     psType type;                ///< Type of data.
     34    psMathType type;            ///< Type of data.
    3535
    3636    union {
  • trunk/psLib/src/mathtypes/psVector.c

    r4409 r4540  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-06-28 20:17:52 $
     11*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-07-12 19:12:01 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "psCompare.h"
    2727
    28 #include "psCollectionsErrors.h"
     28#include "psErrorText.h"
    2929
    3030typedef struct
     
    4848// FUNCTION IMPLEMENTATION - PUBLIC
    4949
    50 psVector* psVectorAlloc(unsigned long nalloc, psElemType type)
     50psVector* psVectorAlloc( long nalloc, psElemType type)
    5151{
    5252    psVector* psVec = NULL;
     
    6767    psVec->type.dimen = PS_DIMEN_VECTOR;
    6868    psVec->type.type = type;
    69     *(int*)&psVec->nalloc = nalloc;
     69    *(long*)&psVec->nalloc = nalloc;
    7070    psVec->n = nalloc;
    7171
     
    7676}
    7777
    78 psVector* psVectorRealloc(psVector* vector, unsigned long nalloc)
     78psVector* psVectorRealloc(psVector* vector, long nalloc)
    7979{
    8080    psS32 elementSize = 0;
     
    9393        // Realloc after decrementation to avoid accessing freed array elements
    9494        vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize);
    95         *(int*)&vector->nalloc = nalloc;
     95        *(long*)&vector->nalloc = nalloc;
    9696    }
    9797
     
    9999}
    100100
    101 psVector* psVectorRecycle(psVector* vector, unsigned long nalloc, psElemType type)
     101psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type)
    102102{
    103103    psS32 byteSize;
     
    120120    if (byteSize > vector->nalloc*PSELEMTYPE_SIZEOF(vector->type.type)) {
    121121        vector->data.U8 = psRealloc(vector->data.U8, byteSize);
    122         *(int*)&vector->nalloc = nalloc;
     122        *(long*)&vector->nalloc = nalloc;
    123123    }
    124124
  • trunk/psLib/src/mathtypes/psVector.h

    r4409 r4540  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-28 20:17:52 $
     13 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-12 19:12:01 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5151typedef struct
    5252{
    53     psType type;                       ///< Type of data.
    54     int n;                             ///< Number of elements in use.
    55     const int nalloc;                  ///< Total number of elements available.
     53    psMathType type;                       ///< Type of data.
     54    long n;                            ///< Number of elements in use.
     55    const long nalloc;                 ///< Total number of elements available.
    5656    p_psVectorData data;               ///< Union for data types.
     57    void *lock;                        ///< Optional lock for thread safety.
    5758}
    5859psVector;
     
    7374 */
    7475psVector* psVectorAlloc(
    75     unsigned long nalloc,              ///< Total number of elements to make available.
     76    long nalloc,                       ///< Total number of elements to make available.
    7677    psElemType type                    ///< Type of data to be held by vector.
    77 );
     78)
     79;
    7880
    7981/** Reallocate a vector.
     
    8890psVector* psVectorRealloc(
    8991    psVector* vector,                  ///< Vector to reallocate.
    90     unsigned long nalloc               ///< Total number of elements to make available.
     92    long nalloc                        ///< Total number of elements to make available.
    9193);
    9294
     
    120122    ///< taken to preserve the values.
    121123
    122     unsigned long nalloc,              ///< Total number of elements to make available.
     124    long nalloc,                       ///< Total number of elements to make available.
    123125    psElemType type                    ///< the datatype of the returned vector
    124126);
Note: See TracChangeset for help on using the changeset viewer.