CWO++library  0.32
 All Classes Functions Variables Groups
Functions
Pixel operations

Functions

void CWO::SetPixel (int x, int y, float a)
void CWO::SetPixel (const cwoVect2< int > &v, float a)
void CWO::SetPixel (int x, int y, float amp, float ph)
void CWO::SetPixel (const cwoVect2< int > &v, float amp, float ph)
void CWO::SetPixel (int x, int y, cwoComplex &a)
void CWO::SetPixel (const cwoVect2< int > &v, cwoComplex &a)
void CWO::SetPixel (int x, int y, CWO &a)
void CWO::SetPixel (const cwoVect2< int > &v, CWO &a)
void CWO::AddPixel (int x, int y, cwoComplex a)
void CWO::AddPixel (const cwoVect2< int > &v, cwoComplex a)
void CWO::AddPixel (int x, int y, CWO &a)
void CWO::AddPixel (const cwoVect2< int > &v, CWO &a)
void CWO::MulPixel (int x, int y, float a)
void CWO::MulPixel (const cwoVect2< int > &v, float a)
void CWO::MulPixel (int x, int y, cwoComplex a)
void CWO::MulPixel (const cwoVect2< int > &v, cwoComplex a)
void CWO::GetPixel (int x, int y, float &a)
void CWO::GetPixel (const cwoVect2< int > &v, float &a)
void CWO::GetPixel (int x, int y, cwoComplex &a)
void CWO::GetPixel (const cwoVect2< int > &v, cwoComplex &a)
cwoComplex CWO::GetPixel (int m, int n)
cwoComplex CWO::GetPixel (const cwoVect2< int > &v)
void CWO::GetPixel (int x, int y, CWO &a)
void CWO::GetPixel (const cwoVect2< int > &v, CWO &a)
void CWO::GetLineH (int n, int N, CWO &a)
void CWO::GetLineV (int m, int N, CWO &a)
void CWO::GetLine (int m1, int n1, int m2, int n2, CWO &a)
void CWO::SetLineH (int n, CWO &a)
void CWO::SetLineV (int m, CWO &a)
void CWO::SetLine (int m1, int n1, int m2, int n2, CWO &a)
virtual void CWO::__Copy (cwoComplex *src, int x1, int y1, int sNx, int sNy, cwoComplex *dst, int x2, int y2, int dNx, int dNy, int Sx, int Sy)
void CWO::Copy (CWO &a, int x1, int y1, int x2, int y2, int Sx, int Sy)
void CWO::Clear (int c=0)
virtual void CWO::Fill (cwoComplex a)
template<class T >
void CWO::FlipH (T *a)
template<class T >
void CWO::FlipV (T *a)
void CWO::Flip (int mode=0)
void CWO::Crop (int x1, int y1, int Sx, int Sy)
void CWO::Crop (const cwoVect2< int > &v, const cwoVect2< int > &s)
void CWO::Crop (int x1, int y1, int Sx, int Sy, CWO &a)
void CWO::Crop (const cwoVect2< int > &v, const cwoVect2< int > &s, CWO &a)
void CWO::ShiftX (int s, int flag=0)
void CWO::ShiftY (int s, int flag=0)
void CWO::Transpose ()
virtual void CWO::__Transpose (cwoComplex *pi, cwoComplex *po)
void CWO::JoinH (CWO &a)
void CWO::JoinV (CWO &a)
void CWO::Rect (int m, int n, int Sx, int Sy, cwoComplex &a, int flag=CWO_FILL_INSIDE)
 fill inside and outside rectangular area
void CWO::Rect (const cwoVect2< int > &v, const cwoVect2< int > &s, cwoComplex &a, int flag=CWO_FILL_INSIDE)
void CWO::Circ (int m, int n, int r, cwoComplex &a, int flag=CWO_FILL_INSIDE)
 fill inside or outside circular area with radius r
void CWO::Circ (const cwoVect2< int > &v, int r, cwoComplex &a, int flag=CWO_FILL_INSIDE)
virtual void CWO::__CircFillInside (cwoComplex *p, int m, int n, int r, cwoComplex &a)
virtual void CWO::__CircFillOutside (cwoComplex *p, int m, int n, int r, cwoComplex &a)
void CWO::MulCirc (int m, int n, int r, cwoComplex &a)
 multiply complex value in circular area
void CWO::MulCirc (const cwoVect2< int > &v, int r, cwoComplex &a)
void CWO::Convolve (CWO &a, float *ker, int Sx, int Sy)
void CWO::ConvolveFFT (CWO *a, CWO *b, CWO *c)
virtual void CWO::Expand (int Nx, int Ny)
void CWO::ExpandMirror ()
void CWO::ExpandTwice (CWO *src)
void CWO::ExpandHalf (CWO *dst)
int CWO::ScaleReal (float lim=1.0)
 scale current pixels (real part of complex amplitude) by specified maximum value
int CWO::ScaleReal (float i1, float i2, float o1, float o2)
 scale real part of complex amplitude by specified range
virtual int CWO::__ScaleReal (float i1, float i2, float o1, float o2)
int CWO::ScaleCplx (float lim=1.0)
 scale complex amplitude by specified maximum value
int CWO::ScaleCplx (float i1, float i2, float o1, float o2)
 scalecomplex amplitude by specified range
virtual int CWO::__ScaleCplx (float i1, float i2, float o1, float o2)

Detailed Description


Function Documentation

void CWO::Rect ( int  m,
int  n,
int  Sx,
int  Sy,
cwoComplex a,
int  flag = CWO_FILL_INSIDE 
)

fill inside and outside rectangular area

Parameters:
(m,n): start position (in pixel unit)
(Sx,Sy): area size (in pixel unit)
a: complex value
flag: when CWO_FILL_INSIDE, the function fills inside the rectangular area with $sx sy$.
void CWO::Circ ( int  m,
int  n,
int  r,
cwoComplex a,
int  flag = CWO_FILL_INSIDE 
)

fill inside or outside circular area with radius r

Parameters:
mcenter position (in pixel unit)
ncenter position (in pixel unit)
rradius (in pixel unit)
acomplex value
flagfill inside or outside (CWO_FILL_INSIDE, CWO_FILL_OUTSIDE)
void CWO::MulCirc ( int  m,
int  n,
int  r,
cwoComplex a 
)

multiply complex value in circular area

Parameters:
mcenter position (in pixel unit)
ncenter position (in pixel unit)
rradius (in pixel unit)
acomplex value
void CWO::Convolve ( CWO a,
float *  ker,
int  Sx,
int  Sy 
)

convolve the field with filter kernel

    @param a filtered field
    @param ker filter kernel
    @param Sx size of filter kernel
    @param Sy size of filter kernel
int CWO::ScaleReal ( float  lim = 1.0)

scale current pixels (real part of complex amplitude) by specified maximum value

   @param lim maximum value
   @image html scale1.jpg
   @note
   this function convert current pixels by the following equation:

$output~pixel = \frac{input~pixel - min}{max-min} \times lim $ where $ max, min $ are the maximum and minimum current pixel,rerspectively.

CWO a;
a.Load("lena.bmp"); //load bitmap image with 256 gray value
a.Scale(128); //the maximum value of the bitmap image is 128
int CWO::ScaleReal ( float  i1,
float  i2,
float  o1,
float  o2 
)

scale real part of complex amplitude by specified range

   @param i1 
   @param i2  
   @param o1
   @param o2
   @image html scale2.jpg
   @note 
   convert the current real part from the minimum value i1 to o1.
   similarly, convert the current real part from the maximum value i2 to o2.
CWO a;
a.Load("lena.bmp"); //load bitmap image with 256 gray value
a.Scale(0,255,255,0); //each pixel value of the bitmap image is inverted
int CWO::ScaleCplx ( float  lim = 1.0)

scale complex amplitude by specified maximum value

Parameters:
limmaximum value ]
scale1.jpg
Examples:
Phase shifting digital holography.
int CWO::ScaleCplx ( float  i1,
float  i2,
float  o1,
float  o2 
)

scalecomplex amplitude by specified range

Parameters:
i1
i2
o1
o2
scale2.jpg
Note:
convert the current complexc amplitude from the minimum value i1 to o1. similarly, convert the current complexc amplitude from the maximum value i2 to o2.