diff --git a/include/mapnik/jpeg_io.hpp b/include/mapnik/jpeg_io.hpp index 370a187c0..90be38deb 100644 --- a/include/mapnik/jpeg_io.hpp +++ b/include/mapnik/jpeg_io.hpp @@ -35,10 +35,10 @@ extern "C" #include } -namespace mapnik { - #define BUFFER_SIZE 4096 +namespace jpeg_detail { + typedef struct { struct jpeg_destination_mgr pub; @@ -76,6 +76,10 @@ inline void term_destination( j_compress_ptr cinfo) dest->out->flush(); } +} + +namespace mapnik { + template void save_as_jpeg(T1 & file,int quality, T2 const& image) { @@ -89,11 +93,11 @@ void save_as_jpeg(T1 & file,int quality, T2 const& image) jpeg_create_compress(&cinfo); cinfo.dest = (struct jpeg_destination_mgr *)(*cinfo.mem->alloc_small) - ((j_common_ptr) &cinfo, JPOOL_PERMANENT, sizeof(dest_mgr)); - dest_mgr * dest = (dest_mgr*) cinfo.dest; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; + ((j_common_ptr) &cinfo, JPOOL_PERMANENT, sizeof(jpeg_detail::dest_mgr)); + jpeg_detail::dest_mgr * dest = (jpeg_detail::dest_mgr*) cinfo.dest; + dest->pub.init_destination = jpeg_detail::init_destination; + dest->pub.empty_output_buffer = jpeg_detail::empty_output_buffer; + dest->pub.term_destination = jpeg_detail::term_destination; dest->out = &file; //jpeg_stdio_dest(&cinfo, fp);