File: test_png_encoding1.cpp

package info (click to toggle)
mapnik 3.0.22%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,260 kB
  • sloc: cpp: 144,587; python: 1,426; sh: 785; makefile: 170; xml: 140; lisp: 13
file content (26 lines) | stat: -rw-r--r-- 570 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "bench_framework.hpp"
#include <mapnik/image_util.hpp>

class test : public benchmark::test_case
{
    mapnik::image_rgba8 im_;
public:
    test(mapnik::parameters const& params)
     : test_case(params),
       im_(256,256) {}
    bool validate() const
    {
        return true;
    }
    bool operator()() const
    {
        std::string out;
        for (std::size_t i=0;i<iterations_;++i) {
            out.clear();
            out = mapnik::save_to_string(im_,"png8:m=h:z=1");
        }
        return true;
    }
};

BENCHMARK(test,"encoding blank png")