[core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG in most cases, as we were passing premultiplied pixels which were then interpreted as unmultiplied. I changed encodePNG to accept premultipled pixels, and unpremultiply in the implementations.
This commit is contained in:
@@ -25,8 +25,8 @@ TEST(API, RepeatedRender) {
|
||||
|
||||
{
|
||||
map.setStyleJSON(style, "");
|
||||
std::promise<UnassociatedImage> promise;
|
||||
map.renderStill([&promise](std::exception_ptr, UnassociatedImage&& image) {
|
||||
std::promise<PremultipliedImage> promise;
|
||||
map.renderStill([&promise](std::exception_ptr, PremultipliedImage&& image) {
|
||||
promise.set_value(std::move(image));
|
||||
});
|
||||
auto result = std::move(promise.get_future().get());
|
||||
@@ -37,8 +37,8 @@ TEST(API, RepeatedRender) {
|
||||
|
||||
{
|
||||
map.setStyleJSON(style, "TEST_DATA/suite");
|
||||
std::promise<UnassociatedImage> promise;
|
||||
map.renderStill([&promise](std::exception_ptr, UnassociatedImage&& image) {
|
||||
std::promise<PremultipliedImage> promise;
|
||||
map.renderStill([&promise](std::exception_ptr, PremultipliedImage&& image) {
|
||||
promise.set_value(std::move(image));
|
||||
});
|
||||
auto result = std::move(promise.get_future().get());
|
||||
|
||||
Reference in New Issue
Block a user