Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS 1
- #define _SCL_SECURE_NO_WARNINGS 1
- #include <stdio.h>
- #include <tchar.h>
- #include <fstream>
- #include <sstream>
- #include <cassert>
- #include <boost/gil/gil_all.hpp>
- #include <boost/gil/extension/io_new/jpeg_all.hpp>
- using namespace std;
- using namespace boost;
- using namespace gil;
- template< typename Image >
- void read_mem_jpeg( Image& dest
- , const char* jpeg_file
- , const char* jpeg_file_end
- )
- {
- istringstream ss( string( jpeg_file, jpeg_file_end ), std::ios::binary );
- read_image( ss, dest, jpeg_tag() );
- }
- int main()
- {
- char jpeg_file[4096];
- char filename[] = "C:/chh/gil_contributions/test_images/jpg/found online/test.jpg";
- ifstream in( filename, std::ios::binary );
- in.read( jpeg_file, 4096 );
- rgb8_image_t img;
- read_mem_jpeg( img, jpeg_file, jpeg_file + 4096 );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement