Flip marker bitmap image 33/102933/1 accepted/tizen/common/20161207.184448 accepted/tizen/mobile/20161208.011723 accepted/tizen/wearable/20161208.011730 submit/tizen/20161207.074644
authorVarun <tallytalwar@gmail.com>
Wed, 7 Dec 2016 00:06:58 +0000 (19:06 -0500)
committerVarun <tallytalwar@gmail.com>
Wed, 7 Dec 2016 00:06:58 +0000 (19:06 -0500)
In accordance with core tangram changes, its required to flip bitmap image.

Change-Id: Ia1fc636c814567bd0ad8aa6b770dc9b089b5cf10

src/mapzen/tangram_view.cpp

index 5aa690d..fd09ffd 100644 (file)
@@ -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);