tests: Add another displacement map test

This commit is contained in:
TÖRÖK Attila 2023-07-18 02:32:50 +02:00 committed by Nathan Adams
parent 400ff32723
commit 4e7baf647e
10 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package {
import flash.display.Bitmap;
import flash.filters.DisplacementMapFilter;
import flash.geom.Point;
import flash.display.BitmapDataChannel;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.display.MovieClip;
public class Test extends MovieClip {
public function Test() {
var displacement1 : BitmapData = new Displacement1();
var source1 : BitmapData = new Source1();
var filter1 = new DisplacementMapFilter(displacement1, new Point(0,0), BitmapDataChannel.RED, BitmapDataChannel.GREEN, 200, 200);
source1.applyFilter(source1, new Rectangle(0, 0, 175, 175), new Point(0, 0), filter1);
var bm1 = new Bitmap(source1);
bm1.smoothing = false;
addChild(bm1);
for (var strength = 200; strength < 300; strength += 10) {
var displacement2 : BitmapData = new Displacement2();
var source2 : BitmapData = new Source2();
var filter2 = new DisplacementMapFilter(displacement2, new Point(0,0), BitmapDataChannel.RED, BitmapDataChannel.GREEN, strength, strength);
source2.applyFilter(source2, new Rectangle(0, 0, 175, 20), new Point(0, 0), filter2);
var bm2 = new Bitmap(source2);
bm2.smoothing = false;
bm2.y = (strength - 200) * 2;
bm2.x = 180;
addChild(bm2);
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

View File

@ -0,0 +1,7 @@
num_frames = 1
[image_comparison]
tolerance = 4
[player_options]
with_renderer = { optional = false, sample_count = 1 }