
Hi Phil,
rgb8_image_t img;
jpeg_image_file_reader j(jpeg_filename); // <----- here
image_read_settings< jpeg_tag > settings( point_t( 0, 0 ) , point_t( 10, 10 ) , jpeg_dct_method::slow );
read_image( j, img, settings ); // Takes the file object, not the filename
Now, the file remains open while j is in scope, so you can read more lines from it etc. with the possibility of doing so efficiently.
(If anyone is having difficulty following this, compare this will reading and writing text files; imagine if the operations took filenames, and there were no objects representing open files.)
I can follow. Your jpeg_image_file_reader could also serve another function that is to give the user access to the backend. I have been thinking about this use case and I think one good idea is have an input iterator returned by the io extension. The user would set up the strides to read which can be in scanlines or tiles. Once the iterator is retrieved the operator++() would read the next portion. Christian