76 this->double_pnX = 01;
77 this->double_pnY = 01;
80 this->double_size = 0;
84 this->pnX = pixel_number[
_X];
85 this->pnY = pixel_number[
_Y];
86 this->half_pnX = pnX >> 1;
87 this->half_pnY = pnY >> 1;
88 this->double_pnX = pnX << 1;
89 this->double_pnY = pnY << 1;
90 this->size = pnX * pnY;
91 this->half_size = size >> 2;
92 this->double_size = size << 2;
111 this->pixel_number =
ivec2();
112 this->offset =
ivec2();
113 this->pixel_pitch =
vec2();
114 this->shift =
vec3();
118 this->wave_length = 0;
131 this->rotate =
false;
169 bool checkExtension(
const char* fname,
const char* ext);
183 virtual bool saveAsImg(
const char* fname, uint8_t bitsperpixel,
uchar* src,
int width,
int height);
192 virtual uchar* loadAsImg(
const char* fname);
201 virtual bool saveAsOhc(
const char *fname);
211 virtual bool loadAsOhc(
const char *fname);
243 context_.pixel_number[
_X] = n[
_X]; context_.pixel_number[
_Y] = n[
_Y];
244 context_.ss = context_.pixel_number * context_.pixel_pitch;
247 context_.pixel_number[
_X] = width; context_.pixel_number[
_Y] = height;
248 context_.ss = context_.pixel_number * context_.pixel_pitch;
256 context_.pixel_pitch[
_X] = p[
_X]; context_.pixel_pitch[
_Y] = p[
_Y];
257 context_.ss = context_.pixel_number * context_.pixel_pitch;
260 context_.pixel_pitch[
_X] = pitchX; context_.pixel_pitch[
_Y] = pitchY;
261 context_.ss = context_.pixel_number * context_.pixel_pitch;
275 void setWaveNum(
int num);
324 void setMaxThreadNum(
int num);
331 int getMaxThreadNum();
344 bool mergeColor(
int idx,
int width,
int height,
uchar *src,
uchar *dst);
357 bool separateColor(
int idx,
int width,
int height,
uchar *src,
uchar *dst);
369 bool loadAsImgUpSideDown(
const char* fname,
uchar* dst);
381 bool getImgSize(
int&
w,
int&
h,
int&
bytesperpixel,
const char* fname);
392 void imgScaleBilinear(
uchar* src,
uchar* dst,
int w,
int h,
int neww,
int newh,
int channels = 1);
447 void fftInit2D(
ivec2 size,
int sign,
unsigned int flag);
475 virtual void ophFree(
void);
481 fftw_plan plan_fwd, plan_bwd;
482 fftw_complex *fft_in, *fft_out;
568 #endif // !__Openholo_h
void setWaveLength(Real w, const uint idx=0)
Function for setting the wave length.
OphConfig & getContext(void)
Function for getting the current context.
void setImageRotate(bool rotate)
Function for setting the image rotate(true or false)
void setColorArrangeOHC(const ColorArran color_arrange)
void setPhaseEncodingOHC(const BPhaseCode phase_code, const vec2 phase_code_range)
void getPixelPitchOHC(vec2 &pixel_pitch)
void setColorArrange(const ColorArran _clrArrange)
oph::ColorArran getColorArrange()
void setPixelNumberOHC(const ivec2 pixel_number)
getter/setter for OHC file read and write
void getColorArrangeOHC(ColorArran &color_arrange)
long long int double_size
void setPixelPitchOHC(const vec2 pixel_pitch)
structure for 2-dimensional integer vector and its arithmetic.
void getComplexFieldDataOHC(Complex< Real > **cmplx, uint wavelen_idx)
void setColorTypeOHC(const ColorType color_type)
void getWaveLengthUnitOHC(LenUnit &length_unit)
void setOffset(ivec2 offset)
Function for setting the offset.
void getPixelNumberOHC(ivec2 &pixel_number)
void setImageMerge(bool merge)
Function for setting the image merge(true or false)
void setWavelengthOHC(const Real wavelength, const LenUnit wavelength_unit)
void setPixelNumber(int width, int height)
void addWaveLengthNComplexFieldDataOHC(const Real wavelength, const OphComplexField &complex_field)
Function to add ComplexField when adding wavelength data.
ImgEncoderOhc * OHC_encoder
OHC file format Variables for read and write.
void setWaveLengthUnitOHC(const LenUnit length_unit)
void getWavelengthOHC(vector< Real > &wavelength)
void setFieldEncoding(const FldStore _fldStore, const FldCodeType _fldCodeType)
void getWaveLengthNumOHC(uint &wavelength_num)
void getComplexFieldData(OphComplexField &cmplx_field, uint wavelen_idx)
ImgDecoderOhc * OHC_decoder
oph::ColorType getColorType()
void addWaveLengthOHC(const Real wavelength)
void addComplexFieldData(const OphComplexField &data)
void setNumOfWavlen(const uint n_wavlens)
void setWaveLengthNumOHC(const uint wavelength_num)
void addComplexFieldDataOHC(const OphComplexField &complex_field)
void setPhaseEncoding(const BPhaseCode _bPhaseCode, const double _phaseCodeMin, const double _phaseCodeMax)
void addWavelength(const Real wavlen)
structure for 2-dimensional Real type vector and its arithmetic.
structure for 3-dimensional Real type vector and its arithmetic.
void setPixelPitch(Real pitchX, Real pitchY)
ResolutionConfig(const ivec2 &pixel_number)
oph::LenUnit getUnitOfWavlen()
void setPixelPitch(vec2 p)
Function for setting the output pixel pitch.
void setColorType(const ColorType _clrType)
void setPixelPitch(const double _pxPitchX, const double _pxPitchY, const LenUnit unit=LenUnit::m)
void setFieldEncodingOHC(const FldStore field_store, const FldCodeType field_code_type)
structure for 3-dimensional integer vector and its arithmetic.
void setImageFlip(int flip)
Function for setting the image flip.
void setWavelength(const Real _wavlen, const LenUnit _unit=LenUnit::m)
void setNumOfPixel(const uint _pxNumX, const uint _pxNumY)
Complex< Real > ** getComplexField(void)
Function for getting the complex field.
ImageConfig & getImageConfig()
Function for getting the image config.
void setPixelNumber(ivec2 n)
Function for setting the output resolution.
void getColorTypeOHC(ColorType &color_type)
void setUnitOfWavlen(const LenUnit unit)
Complex< Real > ** complex_H
void getComplexFieldDataOHC(OphComplexField &cmplx, uint wavelen_idx)
void getWavelength(std::vector< double_t > &wavlen_array)
void addWavelengthNComplexFieldData(const Real wavlen, const OphComplexField &data)