|
46 | 46 | n0f8_str = typestring(N0f8) |
47 | 47 | matrixf64_str = typestring(Matrix{Float64}) |
48 | 48 |
|
49 | | - etp = @inferred ImageTransformations.box_extrapolation(img) |
50 | | - @test @inferred(ImageTransformations.box_extrapolation(etp)) === etp |
51 | | - @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}" |
52 | | - @test typeof(etp) <: Interpolations.FilledExtrapolation |
53 | | - @test etp.fillvalue === Gray{N0f8}(0.0) |
54 | | - @test etp.itp.coefs === img |
| 49 | + for method in (Linear(), BSpline(Linear()), Constant(), BSpline(Constant())) |
| 50 | + etp = @inferred ImageTransformations.box_extrapolation(img, method=method) |
| 51 | + @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 |
| 54 | + @test etp.fillvalue === Gray{N0f8}(0.0) |
| 55 | + @test etp.itp.coefs === img |
| 56 | + end |
55 | 57 |
|
56 | 58 | # to catch regressions like #60 |
57 | 59 | @test @inferred(ImageTransformations._getindex(img, @SVector([1,2]))) isa Gray{N0f8} |
58 | 60 |
|
| 61 | + etp = @inferred ImageTransformations.box_extrapolation(img) |
59 | 62 | etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp) |
60 | 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}" |
61 | 64 | @test typeof(etp2) <: Interpolations.FilledExtrapolation |
62 | 65 | @test etp2.fillvalue === Gray{N0f8}(0.0) |
63 | 66 | @test etp2 !== etp |
64 | 67 | @test etp2.itp === etp.itp |
65 | 68 |
|
| 69 | + etp = @inferred ImageTransformations.box_extrapolation(img) |
66 | 70 | etp2 = @inferred ImageTransformations.box_extrapolation(etp.itp, fillvalue=Flat()) |
67 | 71 | @test summary(etp2) == "2×2 extrapolate(interpolate(::Array{Gray{N0f8},2}, BSpline(Linear())), Flat()) with element type $(ctqual)Gray{$(fpqual)$n0f8_str}" |
68 | 72 | @test typeof(etp2) <: Interpolations.Extrapolation |
|
0 commit comments