From 351ddd68f462e6188f70d1f640acf631fb04a544 Mon Sep 17 00:00:00 2001 From: Varun Date: Tue, 6 Dec 2016 19:06:58 -0500 Subject: [PATCH] Flip marker bitmap image In accordance with core tangram changes, its required to flip bitmap image. Change-Id: Ia1fc636c814567bd0ad8aa6b770dc9b089b5cf10 --- src/mapzen/tangram_view.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mapzen/tangram_view.cpp b/src/mapzen/tangram_view.cpp index 5aa690d..fd09ffd 100644 --- a/src/mapzen/tangram_view.cpp +++ b/src/mapzen/tangram_view.cpp @@ -605,6 +605,19 @@ mapzen_error_e TangramView::getBitmapMarkerImage(maps_view_object_h object, unsi *(imgData + offset + 3) = *(srcData + offset + 3); } } + + // flip converted image + unsigned int *flippedImg = (unsigned int*)imgData; + unsigned int temp; + for (int i = 0; i < (imgHeight>>1); i++) { + unsigned int* lower = flippedImg + (i * imgWidth); + unsigned int* upper = flippedImg + ((imgHeight - i - 1) * imgWidth); + for (int j = 0; j < imgWidth; j++) { + temp = lower[j]; + lower[j] = upper[j]; + upper[j] = temp; + } + } } while (0); return (mapzen_error_e)convert_maps_error_to_mapzen_error(error); -- 2.7.4