tests: Add displacement filter scaling test

This commit is contained in:
Nathan Adams 2023-07-19 01:18:02 +02:00
parent ad591224f9
commit a85aa41e6a
10 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,40 @@
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);
var bm1 = new Bitmap(source1);
bm1.smoothing = false;
bm1.filters = [filter1];
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);
var bm2 = new Bitmap(source2);
bm2.smoothing = false;
bm2.y = (strength - 200) * 2;
bm2.x = 180;
bm2.filters = [filter2];
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: 14 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,8 @@
num_frames = 1
[image_comparison]
tolerance = 4
[player_options]
with_renderer = { optional = false, sample_count = 1 }
viewport_dimensions = { width = 800, height = 400, scale_factor = 1.0 }