-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add a visual test for equivalence of blur quality/repetition a…
…nd filters/applyFilter
- Loading branch information
1 parent
5f840bf
commit 9fa3a11
Showing
7 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
tests/tests/swfs/visual/filters/blur_pass_scaling_test/Test.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package { | ||
|
||
import flash.display.Bitmap; | ||
import flash.geom.Point; | ||
import flash.display.BitmapData; | ||
import flash.geom.Rectangle; | ||
import flash.display.MovieClip; | ||
import flash.filters.BlurFilter; | ||
|
||
|
||
public class Test extends MovieClip { | ||
|
||
private static const BLURSIZE = 7; | ||
|
||
function row_1() { | ||
|
||
for (var quality = 0; quality < 10; quality += 1) { | ||
var image : BitmapData = new Image(); | ||
|
||
var filter = new BlurFilter(BLURSIZE, 1, quality); | ||
image.applyFilter(image, new Rectangle(0, 0, 80, 80), new Point(0, 0), filter); // applied only once | ||
|
||
var bm = new Bitmap(image); | ||
bm.smoothing = false; | ||
bm.y = 10; | ||
bm.x = quality * 100 + 10; | ||
addChild(bm); | ||
} | ||
} | ||
|
||
function row_2() { | ||
|
||
for (var applications = 0; applications < 10; applications += 1) { | ||
var image : BitmapData = new Image(); | ||
|
||
var filter = new BlurFilter(BLURSIZE, 1, 1); // quality is always 1 | ||
for (var i = 0; i < applications; ++i) | ||
image.applyFilter(image, new Rectangle(0, 0, 80, 80), new Point(0, 0), filter); | ||
|
||
var bm = new Bitmap(image); | ||
bm.smoothing = false; | ||
bm.y = 110; | ||
bm.x = i * 100 + 10; | ||
addChild(bm); | ||
} | ||
} | ||
|
||
|
||
function row_3() { | ||
|
||
for (var quality = 0; quality < 10; quality += 1) { | ||
var image : BitmapData = new Image(); | ||
|
||
var filter = new BlurFilter(BLURSIZE, 1, quality); | ||
|
||
var bm = new Bitmap(image); | ||
bm.smoothing = false; | ||
bm.y = 210; | ||
bm.x = quality * 100 + 10; | ||
bm.filters = [filter]; // applied only once | ||
addChild(bm); | ||
} | ||
} | ||
|
||
|
||
function row_4() { | ||
|
||
for (var applications = 0; applications < 10; applications += 1) { | ||
var image : BitmapData = new Image(); | ||
|
||
var filter = new BlurFilter(BLURSIZE, 1, 1); // quality is always 1 | ||
|
||
var filters = []; | ||
|
||
for (var i = 0; i < applications; ++i) | ||
filters.push(filter); | ||
|
||
var bm = new Bitmap(image); | ||
bm.smoothing = false; | ||
bm.y = 310; | ||
bm.x = i * 100 + 10; | ||
bm.filters = filters; | ||
addChild(bm); | ||
} | ||
} | ||
|
||
public function Test() { | ||
|
||
row_1(); | ||
row_2(); | ||
row_3(); | ||
row_4(); | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
tests/tests/swfs/visual/filters/blur_pass_scaling_test/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
num_frames = 1 | ||
|
||
[image_comparison] | ||
tolerance = 3 | ||
|
||
[player_options] | ||
with_renderer = { optional = false, sample_count = 1 } |