mapnik/benchmark/test_png_encoding1.cpp
artemp 38da080f82 make concrete image_data type names more expressive and explicit about color channels/depth:
image_data_32 -> image_data_rgba8
image_data_8  -> image_data_gray8
image_data_16 -> image_data_gray16
image_data_float32  -> image_data_gray32f

NOTE: currently image_data_gray16::pixel_type = std::int16_t (signed 16 bit int) to match GDAL
should we support unsigned types?
2014-12-04 11:02:42 +01:00

26 lines
585 B
C++

#include "bench_framework.hpp"
#include <mapnik/image_util.hpp>
#include <mapnik/graphics.hpp>
class test : public benchmark::test_case
{
mapnik::image_data_rgba8 im_;
public:
test(mapnik::parameters const& params)
: test_case(params),
im_(256,256) {}
bool validate() const
{
return true;
}
void 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");
}
}
};
BENCHMARK(test,"encoding blank png")