use CoreImage for decoding/encoding images on osx/ios

This commit is contained in:
Konstantin Käfer
2014-10-29 19:58:34 -04:00
parent 7a13db9a86
commit e3bc69b7e7
12 changed files with 181 additions and 29 deletions

View File

@@ -181,11 +181,11 @@ void HeadlessView::resize(uint16_t width, uint16_t height, float pixelRatio) {
make_inactive();
}
const std::unique_ptr<uint32_t[]> HeadlessView::readPixels() {
std::unique_ptr<uint32_t[]> HeadlessView::readPixels() {
const unsigned int w = width_ * pixelRatio_;
const unsigned int h = height_ * pixelRatio_;
std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]);
auto pixels = std::unique_ptr<uint32_t[]>(new uint32_t[w * h]);
make_active();
glReadPixels(0, 0, width_, height_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());