IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageFFT.c

    r1983 r2204  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-10-06 21:31:30 $
     7 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-10-27 00:57:31 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1111 */
    1212#include <unistd.h>
    13 #include <stdbool.h>
    1413#include <string.h>
    1514#include <complex.h>
     
    2726#define PS_FFTW_PLAN_RIGOR FFTW_ESTIMATE
    2827
    29 static bool p_fftwWisdomImported = false;
     28static psBool p_fftwWisdomImported = false;
    3029
    3130psImage* psImageFFT(psImage* out, const psImage* in, psFftDirection direction)
    3231{
    33     unsigned int numCols;
    34     unsigned int numRows;
     32    psU32 numCols;
     33    psU32 numRows;
    3534    psElemType type;
    3635    fftwf_plan plan;
     
    7776
    7877    // n.b. FFTW can perform a in-place transform at the same rate or faster than out-of-place.
    79     int sign = ((direction & PS_FFT_FORWARD) != 0) ? FFTW_FORWARD : FFTW_BACKWARD;
     78    psS32 sign = ((direction & PS_FFT_FORWARD) != 0) ? FFTW_FORWARD : FFTW_BACKWARD;
    8079    out = psImageCopy(out, in, PS_TYPE_C32);
    8180    plan = fftwf_plan_dft_2d(numCols, numRows,
     
    118117{
    119118    psElemType type;
    120     unsigned int numCols;
    121     unsigned int numRows;
     119    psU32 numCols;
     120    psU32 numRows;
    122121
    123122    if (in == NULL) {
     
    140139
    141140        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F32);
    142         for (unsigned int row = 0; row < numRows; row++) {
     141        for (psU32 row = 0; row < numRows; row++) {
    143142            outRow = out->data.F32[row];
    144143            inRow = in->data.C32[row];
    145144
    146             for (unsigned int col = 0; col < numCols; col++) {
     145            for (psU32 col = 0; col < numCols; col++) {
    147146                outRow[col] = crealf(inRow[col]);
    148147            }
     
    153152
    154153        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F64);
    155         for (unsigned int row = 0; row < numRows; row++) {
     154        for (psU32 row = 0; row < numRows; row++) {
    156155            outRow = out->data.F64[row];
    157156            inRow = in->data.C64[row];
    158157
    159             for (unsigned int col = 0; col < numCols; col++) {
     158            for (psU32 col = 0; col < numCols; col++) {
    160159                outRow[col] = creal(inRow[col]);
    161160            }
     
    179178{
    180179    psElemType type;
    181     unsigned int numCols;
    182     unsigned int numRows;
     180    psU32 numCols;
     181    psU32 numRows;
    183182
    184183    if (in == NULL) {
     
    203202
    204203        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F32);
    205         for (unsigned int row = 0; row < numRows; row++) {
     204        for (psU32 row = 0; row < numRows; row++) {
    206205            outRow = out->data.F32[row];
    207206            inRow = in->data.C32[row];
    208207
    209             for (unsigned int col = 0; col < numCols; col++) {
     208            for (psU32 col = 0; col < numCols; col++) {
    210209                outRow[col] = cimagf(inRow[col]);
    211210            }
     
    216215
    217216        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F64);
    218         for (unsigned int row = 0; row < numRows; row++) {
     217        for (psU32 row = 0; row < numRows; row++) {
    219218            outRow = out->data.F64[row];
    220219            inRow = in->data.C64[row];
    221220
    222             for (unsigned int col = 0; col < numCols; col++) {
     221            for (psU32 col = 0; col < numCols; col++) {
    223222                outRow[col] = cimag(inRow[col]);
    224223            }
     
    241240{
    242241    psElemType type;
    243     unsigned int numCols;
    244     unsigned int numRows;
     242    psU32 numCols;
     243    psU32 numRows;
    245244
    246245    if (real == NULL || imag == NULL) {
     
    282281        out = psImageRecycle(out, numCols, numRows, PS_TYPE_C32);
    283282
    284         for (unsigned int row = 0; row < numRows; row++) {
     283        for (psU32 row = 0; row < numRows; row++) {
    285284            outRow = out->data.C32[row];
    286285            realRow = real->data.F32[row];
    287286            imagRow = imag->data.F32[row];
    288287
    289             for (unsigned int col = 0; col < numCols; col++) {
     288            for (psU32 col = 0; col < numCols; col++) {
    290289                outRow[col] = realRow[col] + I * imagRow[col];
    291290            }
     
    297296
    298297        out = psImageRecycle(out, numCols, numRows, PS_TYPE_C64);
    299         for (unsigned int row = 0; row < numRows; row++) {
     298        for (psU32 row = 0; row < numRows; row++) {
    300299            outRow = out->data.C64[row];
    301300            realRow = real->data.F64[row];
    302301            imagRow = imag->data.F64[row];
    303302
    304             for (unsigned int col = 0; col < numCols; col++) {
     303            for (psU32 col = 0; col < numCols; col++) {
    305304                outRow[col] = realRow[col] + I * imagRow[col];
    306305            }
     
    324323{
    325324    psElemType type;
    326     unsigned int numCols;
    327     unsigned int numRows;
     325    psU32 numCols;
     326    psU32 numRows;
    328327
    329328    if (in == NULL) {
     
    346345
    347346        out = psImageRecycle(out, numCols, numRows, PS_TYPE_C32);
    348         for (unsigned int row = 0; row < numRows; row++) {
     347        for (psU32 row = 0; row < numRows; row++) {
    349348            outRow = out->data.C32[row];
    350349            inRow = in->data.C32[row];
    351350
    352             for (unsigned int col = 0; col < numCols; col++) {
     351            for (psU32 col = 0; col < numCols; col++) {
    353352                outRow[col] = crealf(inRow[col]) - I * cimagf(inRow[col]);
    354353            }
     
    359358
    360359        out = psImageRecycle(out, numCols, numRows, PS_TYPE_C64);
    361         for (unsigned int row = 0; row < numRows; row++) {
     360        for (psU32 row = 0; row < numRows; row++) {
    362361            outRow = out->data.C64[row];
    363362            inRow = in->data.C64[row];
    364363
    365             for (unsigned int col = 0; col < numCols; col++) {
     364            for (psU32 col = 0; col < numCols; col++) {
    366365                outRow[col] = creal(inRow[col]) - I * cimag(inRow[col]);
    367366            }
     
    384383{
    385384    psElemType type;
    386     unsigned int numCols;
    387     unsigned int numRows;
    388     int numElementsSquared;
     385    psU32 numCols;
     386    psU32 numRows;
     387    psS32 numElementsSquared;
    389388
    390389    if (in == NULL) {
     
    405404
    406405        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F32);
    407         for (unsigned int row = 0; row < numRows; row++) {
     406        for (psU32 row = 0; row < numRows; row++) {
    408407            outRow = out->data.F32[row];
    409408            inRow = in->data.C32[row];
    410409
    411             for (unsigned int col = 0; col < numCols; col++) {
     410            for (psU32 col = 0; col < numCols; col++) {
    412411                real = crealf(inRow[col]);
    413412                imag = cimagf(inRow[col]);
     
    422421
    423422        out = psImageRecycle(out, numCols, numRows, PS_TYPE_F64);
    424         for (unsigned int row = 0; row < numRows; row++) {
     423        for (psU32 row = 0; row < numRows; row++) {
    425424            outRow = out->data.F64[row];
    426425            inRow = in->data.C64[row];
    427426
    428             for (unsigned int col = 0; col < numCols; col++) {
     427            for (psU32 col = 0; col < numCols; col++) {
    429428                real = creal(inRow[col]);
    430429                imag = cimag(inRow[col]);
Note: See TracChangeset for help on using the changeset viewer.