Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #define KERNEL_SIZE 5
- #define HEIGHT 512
- #define WIDTH 512
- int main(void) {
- srand(0);
- std::ofstream ofs("src_data.txt");
- for (int i = 0; i < HEIGHT; i++) {
- for (int j = 0; j < WIDTH; j++) {
- ofs << rand() % 256 << ".0f," << std::endl;
- }
- }
- ofs.close();
- ofs.open("kernel_data.txt");
- for (int i = 0; i < KERNEL_SIZE; i++) {
- for (int j = 0; j < KERNEL_SIZE; j++) {
- ofs << 1.f / (KERNEL_SIZE*KERNEL_SIZE) << "f," << std::endl;
- }
- }
- ofs.close();
- return 0;
- }
Add Comment
Please, Sign In to add comment