diff options
author | jjesswan <jessica_wan@brown.edu> | 2024-05-06 00:01:04 -0400 |
---|---|---|
committer | jjesswan <jessica_wan@brown.edu> | 2024-05-06 00:01:04 -0400 |
commit | 2ba27898535e01298ef8f0d0b9ffd4e69ce13458 (patch) | |
tree | 18dac0a37704ba9c2271f185d62ea4a6d4873b61 /src/ocean/halftone.cpp | |
parent | 72bcf6a346dfcaeaac9520d8c524711192e77c3d (diff) |
uv mapping onto water good
Diffstat (limited to 'src/ocean/halftone.cpp')
-rw-r--r-- | src/ocean/halftone.cpp | 47 |
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; + +//} + |