move jpeg callback functions to jpeg_detail namespace to avoid conflict with mapnik::boolean
This commit is contained in:
parent
7aab2bca4f
commit
eecab1b22b
1 changed files with 11 additions and 7 deletions
|
@ -35,10 +35,10 @@ extern "C"
|
|||
#include <jpeglib.h>
|
||||
}
|
||||
|
||||
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 <typename T1, typename T2>
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue