#include "FirstIncludes.h"
#include <stdlib.h>
#include <memory>
#include <math.h>
#include <complex>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "MemoryDebug.h"
#include "kku_fftw.h"
#include "ContourFollower.h"
#include "Raster.h"
#include "KKStr.h"
Go to the source code of this file.
Definition at line 204 of file ContourFollower.cpp.
208 double rp = (float)dest[index].real ();
209 double ip = (float)dest[index].imag ();
210 return (
float)sqrt (rp * rp + ip * ip);
Definition at line 842 of file ContourFollower.cpp.
850 if (size == curMaskSize)
860 for (x = 0; x < curMaskSize; x++)
862 delete fourierMask[x];
863 fourierMask[x] = NULL;
866 delete[] fourierMask;
871 for (x = 0; x < size; x++)
886 for (
kkint32 m = 0; m < size; m++)
888 complex<double> mc (m, 0);
890 for (
kkint32 k = 0; k < size; k++)
892 complex<double> kc (k, 0);
897 fourierMask[m][k] = exp (MinusOne * j * Two * Pi * kc * mc / M);
899 double exponetPart = 2.0 * 3.14159265359 * (double)k * (
double)m / (double)size;
900 double realPart = cos (exponetPart);
901 double imgPart = -sin (exponetPart);
903 if (realPart != fourierMask[m][k].real ())
908 if (imgPart != fourierMask[m][k].imag ())
std::complex< double > ComplexDouble
Definition at line 921 of file ContourFollower.cpp.
930 if (size == curRevMaskSize)
931 return revFourierMask;
941 for (x = 0; x < curRevMaskSize; x++)
943 delete revFourierMask[x];
944 revFourierMask[x] = NULL;
947 delete[] revFourierMask;
948 revFourierMask = NULL;
953 for (x = 0; x < size; x++)
957 curRevMaskSize = size;
968 for (
kkint32 m = 0; m < size; m++)
970 complex<double> mc (m, 0);
972 for (
kkint32 k = 0; k < size; k++)
974 complex<double> kc (k, 0);
979 revFourierMask[m][k] = exp (PositiveOne * j * Two * Pi * kc * mc / M);
982 double exponetPart = 2.0 * 3.14159265359 * (double)k * (
double)m / (double)size;
983 double realPart = cos (exponetPart);
984 double imgPart = sin (exponetPart);
986 if (realPart != revFourierMask[m][k].real ())
991 if (imgPart != revFourierMask[m][k].imag ())
998 return revFourierMask;
std::complex< double > ComplexDouble
Initial value:= {{-1, 0},
{-1, 1},
{ 0, 1},
{ 1, 1},
{ 1, 0},
{ 1, -1},
{ 0, -1},
{-1, -1}
}
Definition at line 34 of file ContourFollower.cpp.