Skip to content

Commit

Permalink
ImageTransformations v0.9.0 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 authored Aug 19, 2021
1 parent e1ef518 commit 4d89e5c
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 12 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ImageTransformations

## Version `v0.9.0`

This release contains numerous enhancements as well as quite a few deprecations. There are also
internal changes that may cause small numerical differences from previous versions; these may be
most obvious at the borders of the image, where decisions about inbounds/out-of-bounds can determine
whether a "fill-value" is used instead of interpolation.

- ![BREAKING][badge-breaking] Previously, `SubArray` passed to `invwarpedview` will use out-of-domain values to build a better result on the border. This violated the array abstraction and has therefore been removed. ([#138][github-138])
- ![BREAKING][badge-breaking] Rounding for numerical stability in `warp` is now applied to the corner points instead of to the transformation coefficients. ([#143][github-143])
- ![Deprecation][badge-deprecation] `degree` and `fill` arguments are deprecated in favor of their keyword versions `method` and `fillvalue`. ([#116][github-116])
- ![Deprecation][badge-deprecation] `invwarpedview` is deprecated in favor of `InvWarpedView`. ([#116][github-116], [#138][github-138])
- ![Deprecation][badge-deprecation] `warpedview` is deprecated in favor of `WarpedView`. ([#116][github-116])
- ![Enhancement][badge-enhancement] `restrict`/`restrict!` are moved to more lightweight package [ImageBase.jl]. ([#127][github-127])
- ![Enhancement][badge-enhancement] `imresize` now works on transparent colorant types(e.g., `ARGB`). ([#126][github-126])
- ![Enhancement][badge-enhancement] `restrict` now works on 0-argument colorant types(e.g., `ARGB32`). ([ImageBase#3][github-base-3])
- ![Bugfix][badge-bugfix] Interpolations v0.13.3 compatibility (though 0.13.4 is now required). ([#132][github-132])
- ![Bugfix][badge-bugfix] `restrict` on singleton dimension is now a no-op. ([ImageBase#8][github-base-8])
- ![Bugfix][badge-bugfix] `restrict` on `OffsetArray` always returns an `OffsetArray` result. ([ImageBase#4][github-base-4])

[github-143]: https://github.com/JuliaImages/ImageTransformations.jl/pull/143
[github-138]: https://github.com/JuliaImages/ImageTransformations.jl/pull/138
[github-132]: https://github.com/JuliaImages/ImageTransformations.jl/pull/132
[github-127]: https://github.com/JuliaImages/ImageTransformations.jl/pull/127
[github-126]: https://github.com/JuliaImages/ImageTransformations.jl/pull/126
[github-116]: https://github.com/JuliaImages/ImageTransformations.jl/pull/116
[github-base-8]: https://github.com/JuliaImages/ImageBase.jl/pull/8
[github-base-4]: https://github.com/JuliaImages/ImageBase.jl/pull/4
[github-base-3]: https://github.com/JuliaImages/ImageBase.jl/pull/3


[ImageBase.jl]: https://github.com/JuliaImages/ImageBase.jl


[badge-breaking]: https://img.shields.io/badge/BREAKING-red.svg
[badge-deprecation]: https://img.shields.io/badge/deprecation-orange.svg
[badge-feature]: https://img.shields.io/badge/feature-green.svg
[badge-enhancement]: https://img.shields.io/badge/enhancement-blue.svg
[badge-bugfix]: https://img.shields.io/badge/bugfix-purple.svg
[badge-security]: https://img.shields.io/badge/security-black.svg
[badge-experimental]: https://img.shields.io/badge/experimental-lightgrey.svg
[badge-maintenance]: https://img.shields.io/badge/maintenance-gray.svg

<!--
# Badges
![BREAKING][badge-breaking]
![Deprecation][badge-deprecation]
![Feature][badge-feature]
![Enhancement][badge-enhancement]
![Bugfix][badge-bugfix]
![Security][badge-security]
![Experimental][badge-experimental]
![Maintenance][badge-maintenance]
-->
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ImageTransformations"
uuid = "02fcd773-0e25-5acc-982a-7f6622650795"
version = "0.8.12"
version = "0.9.0"

[deps]
AxisAlgorithms = "13072b0f-2c55-5437-9ae7-d433b7a33950"
Expand Down
3 changes: 0 additions & 3 deletions src/ImageTransformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ using Interpolations, AxisAlgorithms
using OffsetArrays
using ColorVectorSpace

import Base: eltype, size, length
using Base: tail, Indices
using Base.Cartesian
using .ColorTypes: AbstractGray, TransparentGray, TransparentRGB

# these two symbols previously live in ImageTransformations
import ImageBase: restrict, restrict!
Expand Down
6 changes: 3 additions & 3 deletions src/autorange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ struct CornerIterator{I<:CartesianIndex}
end
CornerIterator(R::CartesianIndices) = CornerIterator(first(R), last(R))

eltype(::Type{CornerIterator{I}}) where {I} = I
Base.eltype(::Type{CornerIterator{I}}) where {I} = I
Base.Iterators.IteratorSize(::Type{CornerIterator{I}}) where {I<:CartesianIndex{N}} where {N} = Base.Iterators.HasShape{N}()

# in 0.6 we could write: 1 .+ (iter.stop.I .- iter.start.I .!= 0)
size(iter::CornerIterator{CartesianIndex{N}}) where {N} = ntuple(d->iter.stop.I[d]-iter.start.I[d]==0 ? 1 : 2, Val(N))::NTuple{N,Int}
length(iter::CornerIterator) = prod(size(iter))
Base.size(iter::CornerIterator{CartesianIndex{N}}) where {N} = ntuple(d->iter.stop.I[d]-iter.start.I[d]==0 ? 1 : 2, Val(N))::NTuple{N,Int}
Base.length(iter::CornerIterator) = prod(size(iter))

@inline function Base.iterate(iter::CornerIterator{<:CartesianIndex})
if any(map(>, iter.start.I, iter.stop.I))
Expand Down
15 changes: 10 additions & 5 deletions src/compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
@inline isnothing(x) = x === nothing
end

# FIXME: upstream https://github.com/JuliaGraphics/ColorVectorSpace.jl/issues/75
@inline _nan(::Type{HSV{Float16}}) = HSV{Float16}(NaN16,NaN16,NaN16)
@inline _nan(::Type{HSV{Float32}}) = HSV{Float32}(NaN32,NaN32,NaN32)
@inline _nan(::Type{HSV{Float64}}) = HSV{Float64}(NaN,NaN,NaN)
@inline _nan(::Type{T}) where {T} = nan(T)
if hasmethod(nan, Tuple{Type{HSV{Float32},}})
# requires ColorTypes v0.11 and ColorVectorSpace v0.9.4
# https://github.com/JuliaGraphics/ColorVectorSpace.jl/issues/75
@inline _nan(::Type{T}) where T = nan(T)
else
@inline _nan(::Type{HSV{Float16}}) = HSV{Float16}(NaN16,NaN16,NaN16)
@inline _nan(::Type{HSV{Float32}}) = HSV{Float32}(NaN32,NaN32,NaN32)
@inline _nan(::Type{HSV{Float64}}) = HSV{Float64}(NaN,NaN,NaN)
@inline _nan(::Type{T}) where {T} = nan(T)
end

2 comments on commit 4d89e5c

@johnnychen94
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/43125

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.0 -m "<description of version>" 4d89e5cecbf115d6b25976f12ac7a32c92a5bfc0
git push origin v0.9.0

Please sign in to comment.