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/imageops
Files:
1 added
8 edited

Legend:

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

    r4446 r4540  
    1 #Makefile for image functions of psLib
     1#Makefile for image operation functions of psLib
    22#
    3 INCLUDES = \
    4         -I$(top_srcdir)/src/astro \
    5         -I$(top_srcdir)/src/db \
    6         -I$(top_srcdir)/src/fft \
    7         -I$(top_srcdir)/src/fits \
    8         -I$(top_srcdir)/src/imageops \
    9         -I$(top_srcdir)/src/math \
    10         -I$(top_srcdir)/src/mathtypes \
    11         -I$(top_srcdir)/src/sys \
    12         -I$(top_srcdir)/src/types \
    13         -I$(top_srcdir)/src/xml \
    14         $(all_includes)
     3noinst_LTLIBRARIES = libpslibimageops.la
    154
    16 noinst_LTLIBRARIES = libpslibimage.la
    17 
    18 libpslibimage_la_SOURCES = \
    19         psImage.c \
     5libpslibimageops_la_SOURCES = \
     6        psImageConvolve.c \
     7        psImageGeomManip.c \
    208        psImagePixelExtract.c \
    21         psImageStructManip.c \
    22         psImageGeomManip.c \
    239        psImagePixelManip.c \
    2410        psImageStats.c \
    25         psImageFFT.c \
    26         psImageConvolve.c
     11        psImageStructManip.c
    2712
    28 BUILT_SOURCES = psImageErrors.h
    29 EXTRA_DIST = psImageErrors.dat psImageErrors.h image.i
    30 
    31 psImageErrors.h: psImageErrors.dat
    32         $(top_srcdir)/src/psParseErrorCodes --data=$? $@
     13EXTRA_DIST = imageops.i
    3314
    3415pslibincludedir = $(includedir)
    3516pslibinclude_HEADERS = \
    36         psImage.h \
     17        psImageConvolve.h \
     18        psImageGeomManip.h \
    3719        psImagePixelExtract.h \
    38         psImageStructManip.h \
    39         psImageGeomManip.h \
    4020        psImagePixelManip.h \
    4121        psImageStats.h \
    42         psImageFFT.h \
    43         psImageConvolve.h
     22        psImageStructManip.h
  • trunk/psLib/src/imageops/psImageConvolve.c

    r4392 r4540  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-06-25 02:02:05 $
     7 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-07-12 19:12:01 $
    99 *
    1010 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565    result->image = psImageAlloc(numCols,numRows,PS_TYPE_KERNEL);
    6666    memset(result->image->rawDataBuffer,0,numCols*numRows*PSELEMTYPE_SIZEOF(PS_TYPE_KERNEL));
    67     result->p_kernelRows = psAlloc(sizeof(psKernelType*)*numRows);
    68 
    69     psKernelType** kernelRows = result->p_kernelRows;
    70     psKernelType** imageRows = result->image->data.PS_TYPE_KERNEL_DATA;
     67    result->p_kernelRows = psAlloc(sizeof(float*)*numRows);
     68
     69    float** kernelRows = result->p_kernelRows;
     70    float** imageRows = result->image->data.PS_TYPE_KERNEL_DATA;
    7171    for (psS32 i = 0; i < numRows; i++) {
    7272        kernelRows[i] = imageRows[i] - xMin;
     
    103103    psS32 yMax = 0;
    104104    psS32 length = 0;
    105     psKernelType normalizeTime = 1.0;  // fraction of total time for each shift clock
     105    float normalizeTime = 1.0;  // fraction of total time for each shift clock
    106106    psKernel* result = NULL;
    107     psKernelType** kernel = NULL;
     107    float** kernel = NULL;
    108108
    109109    // got non-NULL vectors?
     
    170170        } \
    171171        \
    172         normalizeTime = 1.0 / (psKernelType)(tShiftData[length-1]); \
     172        normalizeTime = 1.0 / (float)(tShiftData[length-1]); \
    173173        result = psKernelAlloc(xMin,xMax,yMin,yMax); \
    174174        kernel = result->kernel; \
     
    180180            y = lastY - yShiftData[i]; \
    181181            \
    182             kernel[y][x] += (psKernelType)t / (psKernelType)lastT; \
     182            kernel[y][x] += (float)t / (float)lastT; \
    183183            prevT = tShiftData[i]; \
    184184        } \
     
    216216        kernel = result->kernel; \
    217217        \
    218         normalizeTime = 1.0 / (psKernelType)t; \
     218        normalizeTime = 1.0 / (float)t; \
    219219        x = 0; \
    220220        y = 0; \
    221221        for (psS32 i = length-1; i >= 0; i--) { \
    222             kernel[y][x] += (psKernelType)(tShiftData[i]) * normalizeTime; \
     222            kernel[y][x] += (float)(tShiftData[i]) * normalizeTime; \
    223223            x -= xShiftData[i]; \
    224224            y -= yShiftData[i]; \
     
    296296    psS32 yMin = kernel->yMin;
    297297    psS32 yMax = kernel->yMax;
    298     psKernelType** kData = kernel->kernel;
     298    float** kData = kernel->kernel;
    299299
    300300    // make the output image to the proper size and type
     
    399399        // pad the kernel to the same size of paddedImage
    400400        psImage* paddedKernel = psImageAlloc(paddedCols,paddedRows,PS_TYPE_KERNEL);
    401         memset(paddedKernel->data.U8[0],0,sizeof(psKernelType)*numCols*numRows); // zero-out image
     401        memset(paddedKernel->data.U8[0],0,sizeof(float)*numCols*numRows); // zero-out image
    402402        psS32 yMax = kernel->yMax;
    403403        psS32 xMax = kernel->xMax;
     
    407407                padRow += paddedRows;
    408408            }
    409             psKernelType* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow];
    410             psKernelType* kernelRow = kernel->kernel[row];
     409            float* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow];
     410            float* kernelRow = kernel->kernel[row];
    411411            for (psS32 col = kernel->xMin; col <= xMax; col++) {
    412412                if (col < 0) {
  • trunk/psLib/src/imageops/psImageConvolve.h

    r4316 r4540  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-18 03:13:02 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-12 19:12:01 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2525
    2626/** Kernel Type
    27  * 
     27 *
    2828 *  A floating-point data type used for storing kernel data.
    29  * 
     29 *
    3030 */
    31 typedef psF32 psKernelType;
     31//typedef float psKernelType;
    3232
    3333/** A convolution kernel */
     
    3535{
    3636    psImage* image;                    ///< Kernel data, in the form of an image
    37     psS32 xMin;                          ///< Most negative x index
    38     psS32 yMin;                          ///< Most negative y index
    39     psS32 xMax;                          ///< Most positive x index
    40     psS32 yMax;                          ///< Most positive y index
    41     psKernelType** kernel;             ///< Pointer to the kernel data
    42     psKernelType** p_kernelRows;       ///< Pointer to the rows of the kernel data; not intended for user use.
     37    int xMin;                          ///< Most negative x index
     38    int yMin;                          ///< Most negative y index
     39    int xMax;                          ///< Most positive x index
     40    int yMax;                          ///< Most positive y index
     41    float** kernel;                    ///< Pointer to the kernel data
     42    float** p_kernelRows;              ///< Pointer to the rows of the kernel data; not intended for user use.
    4343}
    4444psKernel;
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r4385 r4540  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-25 00:51:28 $
     12 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-07-12 19:12:01 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    196196    }
    197197
    198     if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {
     198    if (mode > PS_INTERPOLATE_LANCZOS4_VARIANCE ) {
    199199        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    200200                PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r4385 r4540  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-25 00:51:28 $
     10 *  @version $Revision: 1.5 $ $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
     
    312312    }
    313313
    314     if (mode < PS_INTERPOLATE_FLAT || mode >= PS_INTERPOLATE_NUM_MODES) {
     314    if (mode < PS_INTERPOLATE_FLAT ) {
    315315        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    316316                PS_ERRORTEXT_psImageManip_INTERPOLATION_MODE_UNSUPPORTED,
  • trunk/psLib/src/imageops/psImagePixelManip.c

    r4385 r4540  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-25 00:51:28 $
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-07-12 19:12:01 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    185185}
    186186
    187 psS32 psImageOverlaySection(psImage* image,
    188                             const psImage* overlay,
    189                             psS32 col0,
    190                             psS32 row0,
    191                             const char *op)
     187int psImageOverlaySection(psImage* image,
     188                          const psImage* overlay,
     189                          int col0,
     190                          int row0,
     191                          const char *op)
    192192{
    193193    psU32 imageNumRows;
  • trunk/psLib/src/imageops/psImagePixelManip.h

    r4385 r4540  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-25 00:51:28 $
     10 *  @version $Revision: 1.7 $ $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
     
    7878 *  function is defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
    7979 *
    80  *  @return psS32         0 if success, non-zero if failed.
     80 *  @return int         0 if success, non-zero if failed.
    8181 */
    82 psS32 psImageOverlaySection(
     82int psImageOverlaySection(
    8383    psImage* image,                    ///< target image
    8484    const psImage* overlay,            ///< the overlay image
    85     psS32 col0,                        ///< the column to start overlay
    86     psS32 row0,                        ///< the row to start overlay
     85    int col0,                          ///< the column to start overlay
     86    int row0,                          ///< the row to start overlay
    8787    const char *op                     ///< the operation to perform for overlay
    8888);
  • trunk/psLib/src/imageops/psImageStructManip.c

    r3977 r4540  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-05-19 05:18:20 $
     10 *  @version $Revision: 1.3 $ $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
     
    3131{
    3232    psU32 elementSize;          // size of image element in bytes
    33     psU32 inputColOffset;       // offset in bytes to first subset pixel in input row
     33    psS32 inputColOffset;       // offset in bytes to first subset pixel in input row
     34
     35    if ( col0 < 0 || row0 < 0 ) {
     36        //        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     37        //                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID);
     38        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     39                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
     40                col0, col1-1, row0, row1-1,
     41                image->numCols-1, image->numRows-1);
     42        return NULL;
     43    }
    3444
    3545    if (image == NULL || image->data.V == NULL) {
     
    6474        return NULL;
    6575    }
     76
     77
     78
    6679    psS32 numRows = row1-row0;
    6780    psS32 numCols = col1-col0;
     
    94107
    95108    out->data.V = psRealloc(out->data.V,sizeof(psPtr)*numRows); // resize row pointer array
    96     *(psType*)&out->type = image->type;
    97     *(psU32*)&out->numCols = numCols;
    98     *(psU32*)&out->numRows = numRows;
     109    *(psMathType*)&out->type = image->type;
     110    //    *(psU32*)&out->numCols = numCols;
     111    //    *(psU32*)&out->numRows = numRows;
     112    *(psS32*)&out->numCols = numCols;
     113    *(psS32*)&out->numRows = numRows;
    99114    *(psS32*)&out->row0 = row0;
    100115    *(psS32*)&out->col0 = col0;
Note: See TracChangeset for help on using the changeset viewer.