add blend mode tests
[swfdec.git] / test / image / BitmapData-copyPixels.as
blob0e762f9039bd1fc04ebf360bac0f9fb04f49f033
1 // makeswf -v 7 -s 300x150 -r 1 -o BitmapData-copyPixels.swf BitmapData-copyPixels.as
3 trans = new flash.display.BitmapData (50, 50, true, 0);
4 for (x = 0; x < 17; x++) {
5 for (y = 0; y < 17; y++) {
6 trans.setPixel32 (2 * x + 8, 2 * y + 8, x * 0xF0F0F00 | y * 0xF);
7 trans.setPixel32 (2 * x + 9, 2 * y + 8, x * 0xF0F0F00 | y * 0xF);
8 trans.setPixel32 (2 * x + 8, 2 * y + 9, x * 0xF0F0F00 | y * 0xF);
9 trans.setPixel32 (2 * x + 9, 2 * y + 9, x * 0xF0F0F00 | y * 0xF);
13 opa = new flash.display.BitmapData (50, 50, false, 0);
14 for (x = 0; x < 17; x++) {
15 for (y = 0; y < 17; y++) {
16 opa.setPixel32 (2 * x + 8, 2 * y + 8, x * 0xF000F0F | y * 0xF0000);
17 opa.setPixel32 (2 * x + 9, 2 * y + 8, x * 0xF000F0F | y * 0xF0000);
18 opa.setPixel32 (2 * x + 8, 2 * y + 9, x * 0xF000F0F | y * 0xF0000);
19 opa.setPixel32 (2 * x + 9, 2 * y + 9, x * 0xF000F0F | y * 0xF0000);
23 mask = new flash.display.BitmapData (50, 50, true, 0);
24 for (x = 0; x < 50; x += 3) {
25 mask.setPixel32 (x, 0, x * 0x05000000);
26 mask.setPixel32 (x + 2, 0, x * 0x05000000);
27 mask.setPixel32 (x + 1, 0, x * 0x05000000);
29 for (y = 1; y < 50; y *= 2) {
30 mask.copyPixels (mask, { x: 0, y: 0, width: 50, height: y }, { x: 0, y: y });
33 array = [ trans, opa, mask ];
35 for (y = 0; y < 3; y++) {
36 for (x = 0; x < 6; x++) {
37 bm = array[y].clone ();
38 if (x < 2)
39 bm.copyPixels (array[x % 2], { x: 20, y: 20, width: 20, height: 20 }, { x: 11, y: 11 });
40 else if (x < 4)
41 bm.copyPixels (trans, { x: 20, y: 20, width: 20, height: 20 }, { x: 11, y: 11 }, mask, { x: 0, y: 0}, x == 3);
42 else
43 bm.copyPixels (trans, { x: 20, y: 20, width: 20, height: 20 }, { x: 11, y: 11 }, null, null, x == 5);
44 a = createEmptyMovieClip ("image" + getNextHighestDepth (), getNextHighestDepth ());
45 a.attachBitmap (bm, 0);
46 a._x = x * 50;
47 a._y = y * 50;