summaryrefslogtreecommitdiff
path: root/src/ocean/halftone.cpp
diff options
context:
space:
mode:
authorjjesswan <90643397+jjesswan@users.noreply.github.com>2024-05-09 15:13:41 -0400
committerGitHub <noreply@github.com>2024-05-09 15:13:41 -0400
commitf846ddba00aee29675f0bd4f5dbc87a94a422368 (patch)
tree65a857125b91502974bceb40e24c1c7eff4bad59 /src/ocean/halftone.cpp
parent72bcf6a346dfcaeaac9520d8c524711192e77c3d (diff)
parent675391d07f50d0067e7bab983433c6d86f5f8256 (diff)
Merge pull request #3 from Seb-Park/foam2
Foam2 merge -- foam, skybox
Diffstat (limited to 'src/ocean/halftone.cpp')
-rw-r--r--src/ocean/halftone.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ocean/halftone.cpp b/src/ocean/halftone.cpp
new file mode 100644
index 0000000..6aa59cb
--- /dev/null
+++ b/src/ocean/halftone.cpp
@@ -0,0 +1,47 @@
+#include "halftone.h"
+#include <cmath>
+#include <vector>
+
+halftone::halftone()
+{
+
+}
+
+//void halftone::init(int n, int m, float density){
+// N = n;
+// M = m;
+// // std::vector<std::vector<int>> m_halftone;
+// // 1. intiialize pattern array with density
+// for (int i=0; i<N; i++){
+// for (int j=0; j<M; j++){
+// // determine whether to place a 1 or 0 here based on density
+
+// // generate random number 0-1
+// float r = ((float) rand() / (float) RAND_MAX);
+// if (r < density){
+// m_halftone[i][j] = 1;
+// } else {
+// m_halftone[i][j] = 0;
+// }
+// }
+// }
+
+//}
+
+//void halftone::apply_gaussian(){
+// for (int i=0; i<N; i++){
+// for (int j=0; j<M; j++){
+// m_halftone[i][j] = radial_gaussian(i, j);
+// }
+// }
+
+//}
+
+//float halftone::radial_gaussian(int i, int j){
+// float r = sqrt((i-.5*N)*(i-.5*N) + (j-.5*M)*(j-.5*M));
+// float result = exp(-(r*r) / (2.f*m_sigma*m_sigma));
+
+// return result;
+
+//}
+