Last active
November 6, 2019 09:01
-
-
Save topin89/aa1c378ac9f6a6b920195716f08bc1db to your computer and use it in GitHub Desktop.
Revisions
-
topin89 revised this gist
Nov 6, 2019 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,13 @@ #include <fstream> #include <iostream> #include <string> void writeppm(char const * const image_buffer, int const image_size, int const width, int const height, std::string const filename){ std::ofstream file{filename, std::ios::binary}; file << "P6\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); } @@ -13,7 +17,7 @@ void writepgm(char const * const image_buffer, int const width, int const height, std::string const filename){ std::ofstream file{filename, std::ios::binary}; file << "P5\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); } -
topin89 revised this gist
Nov 6, 2019 . No changes.There are no files selected for viewing
-
topin89 revised this gist
Nov 3, 2019 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,18 @@ void writeppm(char const * const image_buffer, int const image_size, int const width, int const height, std::string const filename){ std::ofstream file{filename}; file << "P6\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); } void writepgm(char const * const image_buffer, int const image_size, int const width, int const height, std::string const filename){ std::ofstream file{filename}; file << "P5\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); -
topin89 created this gist
Sep 19, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ void writeppm(unsigned char const * const image_buffer, unsigned int const image_size, unsigned int const width, unsigned int const height, unsigned std::string const filename){ std::ofstream file{filename}; file << "P6\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); } void writepgm(unsigned char const * const image_buffer, unsigned int const image_size, unsigned int const width, unsigned int const height, unsigned std::string const filename){ std::ofstream file{filename}; file << "P5\n" << width << '\n' << height << "\n255\n"; file.write(image_buffer, image_size); }