CWO++library
0.32
Main Page
Modules
Classes
Files
Examples
All
Classes
Functions
Variables
Groups
simple_diffraction_with_gpu.cpp
This code is to calculate diffraction using the angular spectrum method on a GPU.
#include "cwo.h"
#include "gwo.h"
int
main()
{
CWO
a;
GWO
g;
a.
Load
(
"sample.bmp"
);
//Load image file
g.
Send
(a);
g.
Diffract(0.1,
CWO_ANGULAR
);
//Calculate diffraction from the image using the angular spectrum method
g.
Intensity
();
//Calculate the light intensity from the diffracted result
g.Scale(255);
// Convert the intensity to 255-steps data
g.
Recv
(a);
a.
Save
(
"diffract.bmp"
);
//Save the intensity as bitmap file
}
Generated on Mon Apr 2 2018 13:35:29 for CWO++library by
1.8.1