|
1 | | -#ctqual = "ColorTypes." |
2 | | -ctqual = "" |
3 | | -# fpqual = "FixedPointNumbers." |
4 | | -fpqual = "" |
5 | | - |
6 | 1 | @testset "_default_fillvalue" begin |
7 | 2 | @test_throws UndefVarError _default_fillvalue |
8 | 3 | @test typeof(ImageTransformations._default_fillvalue) <: Function |
|
43 | 38 | @test typeof(ImageTransformations.box_extrapolation) <: Function |
44 | 39 |
|
45 | 40 | img = rand(Gray{N0f8}, 2, 2) |
46 | | - n0f8_str = typestring(N0f8) |
47 | | - matrixf64_str = typestring(Matrix{Float64}) |
48 | 41 |
|
49 | 42 | for method in (Linear(), BSpline(Linear()), Constant(), BSpline(Constant())) |
50 | 43 | etp = @inferred ImageTransformations.box_extrapolation(img, method=method) |
51 | 44 | @test @inferred(ImageTransformations.box_extrapolation(etp)) === etp |
52 | | - # @test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
53 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
| 45 | + @test_nowarn summary(etp) |
| 46 | + @test size(etp) == size(img) |
| 47 | + @test eltype(etp) == eltype(img) |
| 48 | + @test etp.itp isa Interpolations.BSplineInterpolation |
| 49 | + @test etp isa Interpolations.FilledExtrapolation |
54 | 50 | @test etp.fillvalue === Gray{N0f8}(0.0) |
55 | 51 | @test etp.itp.coefs === img |
56 | 52 | end |
|
60 | 56 |
|
61 | 57 | etp = @inferred ImageTransformations.box_extrapolation(img) |
62 | 58 | etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp) |
63 | | - @test summary(etp2) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
64 | | - @test typeof(etp2) <: Interpolations.FilledExtrapolation |
| 59 | + @test_nowarn summary(etp2) |
| 60 | + @test size(etp2) == size(img) |
| 61 | + @test eltype(etp2) == eltype(img) |
| 62 | + @test etp2.itp isa Interpolations.BSplineInterpolation |
| 63 | + @test etp2 isa Interpolations.FilledExtrapolation |
65 | 64 | @test etp2.fillvalue === Gray{N0f8}(0.0) |
66 | 65 | @test etp2 !== etp |
67 | 66 | @test etp2.itp === etp.itp |
68 | 67 |
|
69 | 68 | etp = @inferred ImageTransformations.box_extrapolation(img) |
70 | 69 | etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp, fillvalue=Flat()) |
71 | | - @test summary(etp2) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
72 | | - @test typeof(etp2) <: Interpolations.Extrapolation |
| 70 | + @test_nowarn summary(etp2) |
| 71 | + @test size(etp2) == size(img) |
| 72 | + @test eltype(etp2) == eltype(img) |
| 73 | + @test etp2.itp isa Interpolations.BSplineInterpolation |
| 74 | + @test etp2 isa Interpolations.Extrapolation |
| 75 | + @test etp2.et == Flat() |
73 | 76 | @test etp2 !== etp |
74 | 77 | @test etp2.itp === etp.itp |
75 | 78 |
|
76 | 79 | etp = @inferred ImageTransformations.box_extrapolation(img, fillvalue=1) |
77 | | - @test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Gray{N0f8}(1.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
78 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
| 80 | + @test_nowarn summary(etp) |
| 81 | + @test size(etp) == size(img) |
| 82 | + @test eltype(etp) == eltype(img) |
| 83 | + @test etp.itp isa Interpolations.BSplineInterpolation |
| 84 | + @test etp isa Interpolations.FilledExtrapolation |
79 | 85 | @test etp.fillvalue === Gray{N0f8}(1.0) |
80 | 86 | @test etp.itp.coefs === img |
81 | 87 |
|
82 | 88 | etp = @inferred ImageTransformations.box_extrapolation(img, fillvalue=Flat()) |
83 | 89 | @test @inferred(ImageTransformations.box_extrapolation(etp)) === etp |
84 | | - @test summary(etp) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
85 | | - @test typeof(etp) <: Interpolations.Extrapolation |
| 90 | + @test_nowarn summary(etp) |
| 91 | + @test size(etp) == size(img) |
| 92 | + @test eltype(etp) == eltype(img) |
| 93 | + @test etp.itp isa Interpolations.BSplineInterpolation |
| 94 | + @test etp isa Interpolations.Extrapolation |
| 95 | + @test etp.et == Flat() |
86 | 96 | @test etp.itp.coefs === img |
87 | 97 |
|
88 | 98 | etp = @inferred ImageTransformations.box_extrapolation(img, method=Constant()) |
89 | | - str = summary(etp) |
90 | | - @test occursin("2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Constant", str) && occursin("Gray{N0f8}(0.0)) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}", str) |
91 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
| 99 | + @test_nowarn summary(etp) |
| 100 | + @test size(etp) == size(img) |
| 101 | + @test eltype(etp) == eltype(img) |
| 102 | + @test etp.itp.it == BSpline(Constant{Nearest}()) |
| 103 | + @test etp isa Interpolations.FilledExtrapolation |
92 | 104 | @test etp.itp.coefs === img |
93 | 105 |
|
94 | 106 | etp = @inferred ImageTransformations.box_extrapolation(img, method=Constant(), fillvalue=Flat()) |
95 | | - str = summary(etp) |
96 | | - @test occursin("2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Constant", str) && occursin("Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}", str) |
97 | | - @test typeof(etp) <: Interpolations.Extrapolation |
| 107 | + @test_nowarn summary(etp) |
| 108 | + @test size(etp) == size(img) |
| 109 | + @test eltype(etp) == eltype(img) |
| 110 | + @test etp.itp.it == BSpline(Constant{Nearest}()) |
| 111 | + @test etp isa Interpolations.Extrapolation |
| 112 | + @test etp.et == Flat() |
98 | 113 | @test etp.itp.coefs === img |
99 | 114 |
|
100 | 115 | imgfloat = Float64.(img) |
101 | 116 | etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Quadratic(Flat(OnGrid()))) |
102 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
103 | | - @test summary(etp) == "2×2 extrapolate(interpolate(OffsetArray(::$matrixf64_str, 0:3, 0:3), BSpline(Quadratic(Flat(OnGrid())))), NaN) with element type Float64" |
| 117 | + @test_nowarn summary(etp) |
| 118 | + @test size(etp) == size(imgfloat) |
| 119 | + @test eltype(etp) == eltype(imgfloat) |
| 120 | + @test etp.itp.it == BSpline(Quadratic(Flat(OnGrid()))) |
| 121 | + @test etp isa Interpolations.FilledExtrapolation |
104 | 122 |
|
105 | 123 | etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Cubic(Flat(OnGrid())), fillvalue=Flat()) |
106 | | - @test typeof(etp) <: Interpolations.Extrapolation |
107 | | - @test summary(etp) == "2×2 extrapolate(interpolate(OffsetArray(::$matrixf64_str, 0:3, 0:3), BSpline(Cubic(Flat(OnGrid())))), Flat()) with element type Float64" |
| 124 | + @test_nowarn summary(etp) |
| 125 | + @test size(etp) == size(imgfloat) |
| 126 | + @test eltype(etp) == eltype(imgfloat) |
| 127 | + @test etp.itp.it == BSpline(Cubic(Flat(OnGrid()))) |
| 128 | + @test etp isa Interpolations.Extrapolation |
108 | 129 |
|
109 | 130 | etp = @inferred ImageTransformations.box_extrapolation(imgfloat, method=Lanczos4OpenCV()) |
110 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
| 131 | + @test_nowarn summary(etp) |
| 132 | + @test size(etp) == size(imgfloat) |
| 133 | + @test eltype(etp) == eltype(imgfloat) |
| 134 | + @test etp.itp.it == Lanczos4OpenCV() |
| 135 | + @test etp isa Interpolations.FilledExtrapolation |
111 | 136 | end |
112 | 137 |
|
113 | 138 | @testset "AxisAlgorithms.A_ldiv_B_md" begin |
|
0 commit comments