56 #define SIG_DLL __declspec(dllexport) 58 #define SIG_DLL __declspec(dllimport) 62 #define SIG_DLL __attribute__((visibility("default"))) 482 virtual ~
ophSig(
void) =
default;
503 bool sigConvertOffaxis_CPU(
Real angleX,
Real angleY);
511 bool sigConvertOffaxis_GPU(
Real angleX,
Real angleY);
519 bool sigConvertHPO_CPU(
Real depth,
Real_t redRate);
527 bool sigConvertHPO_GPU(
Real depth,
Real_t redRate);
538 bool sigConvertCAC_CPU(
double red,
double green,
double blue);
547 bool sigConvertCAC_GPU(
double red,
double green,
double blue);
553 double sigGetParamAT_CPU();
559 double sigGetParamAT_GPU();
569 double sigGetParamSF_CPU(
float zMax,
float zMin,
int sampN,
float th);
579 double sigGetParamSF_GPU(
float zMax,
float zMin,
int sampN,
float th);
586 bool propagationHolo_CPU(
float depth);
592 bool propagationHolo_GPU(
float depth);
594 bool Color_propagationHolo_GPU(
float depth);
606 bool load(
const char *real,
const char *imag);
613 bool save(
const char *real,
const char *imag);
614 bool save(
const char *real);
646 vector<Real> result(len);
647 Real step = (last - first) / (len - 1);
648 for (
int i = 0; i < len; i++) { result[i] = first + i * step; }
658 if (src.size != dst.
size) {
661 for (
int i = 0; i < src.size[
_X]; i++)
663 for (
int j = 0; j < src.size[
_Y]; j++)
665 dst.
mat[i][j] = sqrt(src.mat[i][j][
_RE] * src.mat[i][j][
_RE] + src.mat[i][j][
_IM] * src.mat[i][j][
_IM]);
679 for (
int i = 0; i < src.
size[
_X]; i++)
681 for (
int j = 0; j < src.
size[
_Y]; j++)
694 if (src.size != dst.
size) {
697 for (
int i = 0; i < src.size[
_X]; i++)
699 for (
int j = 0; j < src.size[
_Y]; j++)
701 angle(src(i, j), dst(i, j));
712 if (src.size != dst.size) {
713 dst.resize(src.size[
_X], src.size[
_Y]);
715 for (
int i = 0; i < src.size[
_X]; i++)
717 for (
int j = 0; j < src.size[
_Y]; j++)
719 dst(i, j) = src(i, j).conj();
731 if (src.size != dst.size) {
732 dst.resize(src.size[
_X], src.size[
_Y]);
734 for (
int i = 0; i < src.size[
_X]; i++)
736 for (
int j = 0; j < src.size[
_Y]; j++)
738 dst.mat[i][j][
_RE] = exp(src.mat[i][j][
_RE]) * cos(src.mat[i][j][
_IM]);
739 dst.mat[i][j][
_IM] = exp(src.mat[i][j][
_RE]) * sin(src.mat[i][j][
_IM]);
753 for (
int i = 0; i < src.
size[
_X]; i++)
755 for (
int j = 0; j < src.
size[
_Y]; j++)
757 dst.
mat[i][j] = exp(src.
mat[i][j]);
769 for (
int i = 0; i < src.
size[
_X]; i++)
771 for (
int j = 0; j < src.
size[
_Y]; j++)
785 for (
int i = 0; i < src.
size[
_X]; i++)
787 for (
int j = 0; j < src.
size[
_Y]; j++)
789 if (src(i, j) > max) max = src(i, j);
802 for (
int i = 0; i < src.size[
_X]; i++)
804 for (
int j = 0; j < src.size[
_Y]; j++)
806 if (src(i, j)[
_RE] > max) max = src(i, j)[
_RE];
819 for (
int i = 0; i < src.
size[
_X]; i++)
821 for (
int j = 0; j < src.
size[
_Y]; j++)
823 if (src(i, j) < min) min = src(i, j);
834 for (
int i = 0; i < src.size[
_X]; i++)
836 for (
int j = 0; j < src.size[
_Y]; j++)
838 if (src(i, j)[
_RE] < min) min = src(i, j)[
_RE];
851 if (src.size != dst.size) {
852 dst.resize(src.size[
_X], src.size[
_Y]);
854 int xshift = src.size[
_X] / 2;
855 int yshift = src.size[
_Y] / 2;
856 for (
int i = 0; i < src.size[
_X]; i++)
858 int ii = (i + xshift) % src.size[
_X];
859 for (
int j = 0; j < src.size[
_Y]; j++)
861 int jj = (j + yshift) % src.size[
_Y];
862 dst.mat[ii][jj][
_RE] = src.mat[i][j].real();
863 dst.mat[ii][jj][
_IM] = src.mat[i][j].imag();
891 bool readConfig(
const char* fname);
892 void Parameter_Set(
int nx,
int ny,
double width,
double height ,
double NA );
893 void wavelength_Set(
double wavelength);
894 void focal_length_Set(
double red ,
double green,
double blue,
double rad);
895 void Data_output(
uchar *data,
int pos ,
int bitpixel);
896 void Wavenumber_output(
int &wavenumber);
905 bool sigConvertOffaxis(
Real angleX,
Real angleY);
906 bool cvtOffaxis_CPU(
Real angleX,
Real angleY);
907 void cvtOffaxis_GPU(
Real angleX,
Real angleY);
917 bool sigConvertHPO(
Real depth,
Real_t redRate);
928 bool sigConvertCAC(
double red,
double green,
double blue);
935 bool propagationHolo(
float depth);
949 double sigGetParamAT();
960 double sigGetParamSF(
float zMax,
float zMin,
int sampN,
float th);
966 void setMode(
bool is_CPU);
992 bool getComplexHFromPSDH(
const char* fname0,
const char* fname90,
const char* fname180,
const char* fname270);
1003 bool getComplexHFrom3ArbStepPSDH(
const char* f0,
const char* f1,
const char* f2,
const char* fOI,
const char* fRI,
int nIter);
1007 #endif // !__ophSig_h Complex< Real > maxOfMat(matrix< Complex< Real >> &src)
Function for extracts maximum of matrix , where matrix is complex number.
void abs(const oph::Complex< T > &src, oph::Complex< T > &dst)
class for the complex number and its arithmetic. type T == type cplx type only float || double T real...
void angleMat(matrix< Complex< T >> &src, matrix< T > &dst)
Function for extracts Complex phase value.
void meanOfMat(matrix< T > &src, T &dst)
Function for extracts mean of matrix.
void conjMat(matrix< Complex< T >> &src, matrix< Complex< T >> &dst)
Function for extracts Complex conjugate value.
matrix< T > & resize(int x, int y)
Complex< Real > minOfMat(matrix< Complex< Real >> &src)
Function for extracts minimum of matrix , where matrix is complex number.
void expMat(matrix< Complex< T >> &src, matrix< Complex< T >> &dst)
Function for extracts exponent e(x), where x is complex number.
OphComplexField * ComplexH
void fft2(ivec2 n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
Functions for performing fftw 2-dimension operations inside Openholo.
void absMat(matrix< T > &src, matrix< T > &dst)
Function for extracts real absolute value.
void fftShift(matrix< Complex< Real >> &src, matrix< Complex< Real >> &dst)
Shift zero-frequency component to center of spectrum.
void absMat(matrix< Complex< T >> &src, matrix< T > &dst)
Function for extracts Complex absolute value.
virtual bool loadAsOhc(const char *fname)
Function to read OHC file.
Real minOfMat(matrix< Real > &src)
Function for extracts minimum of matrix , where matrix is real number.
void expMat(matrix< T > &src, matrix< T > &dst)
Function for extracts exponent e(x), where x is real number.
void angle(const std::vector< Complex< T >> &src, std::vector< T > &dst)
virtual bool saveAsOhc(const char *fname)
Function to write OHC file
Real maxOfMat(matrix< Real > &src)
Function for extracts maximum of matrix , where matrix is real number.
void fft1(int n, Complex< Real > *in, int sign=OPH_FORWARD, uint flag=OPH_ESTIMATE)
Functions for performing fftw 1-dimension operations inside Openholo.
vector< T > linspace(T first, T last, int len)
Generate linearly spaced vector.
virtual void ophFree(void)
Pure virtual function for override in child classes.