#include #include "boost/gil/extension/io_new/jpeg_read.hpp" #include int main(int argc, char** argv){ using namespace ::boost::gil; using namespace std; // Read image information std::string filename( "..\\test_images\\jpg\\found online\\test.jpg" ); image_read_info< jpeg_tag > info = read_image_info( filename, tag_t() ); // Read image { FILE* file = fopen( filename.c_str(), "rb" ); rgb8_image_t img; read_image( file, img, tag_t() ); } // Read image { ifstream in( filename.c_str(), ios::in | ios::binary ); rgb8_image_t img( 136, 98 ); read_view( in, view( img ), tag_t() ); } // Read and convert image, use gil's default converter. { rgb8_image_t img; read_and_convert_image( filename, img, tag_t() ); } // Read a 10x10 subimage, starting from the top_left corner. { rgb8_image_t img; read_image( filename, img, point_t( 0,0 ), point_t( 10, 10 ), tag_t() ); } }