summaryrefslogtreecommitdiff
path: root/platform/darwin/mbgl
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-01-25 17:28:23 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-01-26 15:26:55 +0100
commit19bd68d3a2c1236bf092596a9ef2ac0f7364d195 (patch)
tree6ea396fab89277a75d792b4627075af9e8e86b93 /platform/darwin/mbgl
parent46fe0df2a2a2b4c28d8579245c0caad258a8b512 (diff)
downloadqtlocation-mapboxgl-19bd68d3a2c1236bf092596a9ef2ac0f7364d195.tar.gz
[macos,ios] don't roundtrip through encodePNG when converting images
Diffstat (limited to 'platform/darwin/mbgl')
-rw-r--r--platform/darwin/mbgl/util/image+MGLAdditions.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/darwin/mbgl/util/image+MGLAdditions.hpp b/platform/darwin/mbgl/util/image+MGLAdditions.hpp
new file mode 100644
index 0000000000..c738b4523d
--- /dev/null
+++ b/platform/darwin/mbgl/util/image+MGLAdditions.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <mbgl/util/image.hpp>
+
+#include <CoreGraphics/CGImage.h>
+
+// Creates a CGImage from a PremultipliedImage, taking over the memory ownership.
+CGImageRef CGImageFromMGLPremultipliedImage(mbgl::PremultipliedImage&&);
+
+// Creates a PremultipliedImage by copying the pixels of the CGImage.
+// Does not alter the retain count of the supplied CGImage.
+mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef);