MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / mirror

Method mirror

CodenameOne/src/com/codename1/ui/Image.java:1288–1302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1286 ///
1287 /// a mirrored image
1288 public Image mirror() {
1289 int width = getWidth();
1290 int height = getHeight();
1291 int[] tmp = getRGB();
1292 int[] arr = new int[width * height];
1293 for (int x = 0; x < width; x++) {
1294 for (int y = 0; y < height; y++) {
1295 arr[x + y * width] = tmp[width - x - 1 + y * width];
1296 }
1297 }
1298 Image i = new Image(Display.impl.createImage(arr, width, height));
1299 i.opaque = opaque;
1300 i.opaqueTested = opaqueTested;
1301 return i;
1302 }
1303
1304 /// Returns an instance of this image rotated by the given number of degrees. By default 90 degree
1305 /// angle divisions are supported, anything else is implementation dependent. This method assumes

Callers 3

testMirrorMethod · 0.95
mirrorBorderMethod · 0.80
invoke8Method · 0.80

Calls 4

getWidthMethod · 0.95
getHeightMethod · 0.95
getRGBMethod · 0.95
createImageMethod · 0.45

Tested by 1

testMirrorMethod · 0.76