daily pastebin goal
95%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<fstream>
  3.  
  4. #define KERNEL_SIZE 5
  5. #define HEIGHT 512
  6. #define WIDTH 512
  7.  
  8. int main(void) {
  9.   srand(0);
  10.   std::ofstream ofs("src_data.txt");
  11.   for (int i = 0; i < HEIGHT; i++) {
  12.     for (int j = 0; j < WIDTH; j++) {
  13.       ofs << rand() % 256 << ".0f," << std::endl;
  14.     }
  15.   }
  16.   ofs.close();
  17.  
  18.   ofs.open("kernel_data.txt");
  19.   for (int i = 0; i < KERNEL_SIZE; i++) {
  20.     for (int j = 0; j < KERNEL_SIZE; j++) {
  21.       ofs << 1.f / (KERNEL_SIZE*KERNEL_SIZE) << "f," << std::endl;
  22.     }
  23.   }
  24.   ofs.close();
  25.   return 0;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top