diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-09-11 13:05:30 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-09-11 13:14:42 +0200 |
commit | 8ec92b72473305cbf14c31b185fd5634ce670837 (patch) | |
tree | 74b9ec23620e3d1f27b17c25947f8f2cf01216ed /platform/default/webp_reader.cpp | |
parent | 6e171a62a9cc07ddbb0765e3021e46ebd60313df (diff) | |
download | qtlocation-mapboxgl-upstream/remove-webp.tar.gz |
[linux,qt] Remove remainder of WebP supportupstream/remove-webp
Diffstat (limited to 'platform/default/webp_reader.cpp')
-rw-r--r-- | platform/default/webp_reader.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/platform/default/webp_reader.cpp b/platform/default/webp_reader.cpp deleted file mode 100644 index 2c01fb4479..0000000000 --- a/platform/default/webp_reader.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include <mbgl/util/image.hpp> -#include <mbgl/util/premultiply.hpp> -#include <mbgl/util/logging.hpp> - -extern "C" -{ -#include <webp/decode.h> -} - -namespace mbgl { - -PremultipliedImage decodeWebP(const uint8_t* data, size_t size) { - int width = 0, height = 0; - if (WebPGetInfo(data, size, &width, &height) == 0) { - throw std::runtime_error("failed to retrieve WebP basic header information"); - } - - int stride = width * 4; - size_t webpSize = stride * height; - auto webp = std::make_unique<uint8_t[]>(webpSize); - - if (!WebPDecodeRGBAInto(data, size, webp.get(), webpSize, stride)) { - throw std::runtime_error("failed to decode WebP data"); - } - - UnassociatedImage image({ static_cast<uint32_t>(width), static_cast<uint32_t>(height) }, - std::move(webp)); - return util::premultiply(std::move(image)); -} - -} // namespace mbgl |