Example #1
0
void process_rgba8_png_pal(T const& image, 
                          std::string const& t,
                          std::ostream & stream,
                          rgba_palette const& pal)
{
#if defined(HAVE_PNG)
    png_options opts;
    handle_png_options(t, opts);
    if (pal.valid())
    {
        png_options opts;
        handle_png_options(t,opts);
        save_as_png8_pal(stream, image, pal, opts);
    }
    else if (opts.paletted)
    {
        if (opts.use_hextree)
        {
            save_as_png8_hex(stream, image, opts);
        }
        else
        {
            save_as_png8_oct(stream, image, opts);
        }
    }
    else
    {
        save_as_png(stream, image, opts);
    }
#else
    throw ImageWriterException("png output is not enabled in your build of Mapnik");
#endif
}
Example #2
0
void process_rgba8_png(T const& image,
                          std::string const& t,
                          std::ostream & stream)
{
#if defined(HAVE_PNG)
    png_options opts;
    handle_png_options(t, opts);
    if (opts.paletted)
    {
        if (opts.use_hextree)
        {
            save_as_png8_hex(stream, image, opts);
        }
        else
        {
            save_as_png8_oct(stream, image, opts);
        }
    }
    else
    {
        save_as_png(stream, image, opts);
    }
#else
    throw image_writer_exception("png output is not enabled in your build of Mapnik");
#endif
}