Skip to content

Commit

Permalink
switch from immutable to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Evizero committed Jul 3, 2017
1 parent 63a70a5 commit 12394fc
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/distortedview.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
immutable DistortedView{T,P<:AbstractMatrix,E<:AbstractExtrapolation,G,D} <: AbstractArray{T,2}
struct DistortedView{T,P<:AbstractMatrix,E<:AbstractExtrapolation,G,D} <: AbstractArray{T,2}
parent::P
etp::E
grid::G
Expand Down
4 changes: 2 additions & 2 deletions src/operations/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ see also
[`augment`](@ref)
"""
immutable CacheImage <: ImageOperation end
struct CacheImage <: ImageOperation end

applyeager(op::CacheImage, img::Array) = img
applyeager(op::CacheImage, img::OffsetArray) = img
Expand Down Expand Up @@ -79,7 +79,7 @@ end
see [`CacheImage`](@ref)
"""
immutable CacheImageInto{T<:AbstractArray} <: ImageOperation
struct CacheImageInto{T<:AbstractArray} <: ImageOperation
buffer::T
end
CacheImage(buffer::AbstractArray) = CacheImageInto(buffer)
Expand Down
8 changes: 4 additions & 4 deletions src/operations/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ see also
[`PermuteDims`](@ref), [`CombineChannels`](@ref), [`augment`](@ref)
"""
immutable SplitChannels <: Operation end
struct SplitChannels <: Operation end

@inline supports_eager(::Type{SplitChannels}) = false
@inline supports_lazy(::Type{SplitChannels}) = true
Expand Down Expand Up @@ -126,7 +126,7 @@ see also
[`SplitChannels`](@ref), [`PermuteDims`](@ref), [`augment`](@ref)
"""
immutable CombineChannels{T<:Colorant} <: Operation
struct CombineChannels{T<:Colorant} <: Operation
colortype::Type{T}
end

Expand Down Expand Up @@ -221,7 +221,7 @@ see also
[`SplitChannels`](@ref), [`CombineChannels`](@ref), [`augment`](@ref)
"""
immutable PermuteDims{N,perm,iperm} <: Operation end
struct PermuteDims{N,perm,iperm} <: Operation end
PermuteDims() = throw(MethodError(PermuteDims, ()))
PermuteDims(perm::Tuple{}) = throw(MethodError(PermuteDims, (perm,)))
PermuteDims(perm::NTuple{N,Int}) where {N} = PermuteDims{N,perm,invperm(perm)}()
Expand Down Expand Up @@ -297,7 +297,7 @@ see also
[`CombineChannels`](@ref), [`augment`](@ref)
"""
immutable Reshape{N} <: Operation
struct Reshape{N} <: Operation
dims::NTuple{N,Int}
end
Reshape() = throw(MethodError(Reshape, ()))
Expand Down
10 changes: 5 additions & 5 deletions src/operations/crop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ see also
[`CropNative`](@ref), [`CropSize`](@ref), [`CropRatio`](@ref), [`augment`](@ref)
"""
immutable Crop{N,I<:Tuple} <: ImageOperation
struct Crop{N,I<:Tuple} <: ImageOperation
indexes::I

function Crop{N}(indexes::NTuple{N,UnitRange}) where N
Expand Down Expand Up @@ -143,7 +143,7 @@ see also
[`Crop`](@ref), [`CropSize`](@ref), [`CropRatio`](@ref), [`augment`](@ref)
"""
immutable CropNative{N,I<:Tuple} <: ImageOperation
struct CropNative{N,I<:Tuple} <: ImageOperation
indexes::I

function CropNative{N}(indexes::NTuple{N,UnitRange}) where N
Expand Down Expand Up @@ -229,7 +229,7 @@ see also
[`CropRatio`](@ref), [`Crop`](@ref), [`CropNative`](@ref), [`augment`](@ref)
"""
immutable CropSize{N} <: ImageOperation
struct CropSize{N} <: ImageOperation
size::NTuple{N,Int}

function CropSize{N}(size::NTuple{N,Int}) where N
Expand Down Expand Up @@ -329,7 +329,7 @@ see also
[`RCropRatio`](@ref), [`CropSize`](@ref), [`Crop`](@ref), [`CropNative`](@ref), [`augment`](@ref)
"""
immutable CropRatio <: ImageOperation
struct CropRatio <: ImageOperation
ratio::Float64

function CropRatio(ratio::Real)
Expand Down Expand Up @@ -451,7 +451,7 @@ see also
[`CropRatio`](@ref), [`CropSize`](@ref), [`Crop`](@ref), [`CropNative`](@ref), [`augment`](@ref)
"""
immutable RCropRatio <: ImageOperation
struct RCropRatio <: ImageOperation
ratio::Float64

function RCropRatio(ratio::Real)
Expand Down
2 changes: 1 addition & 1 deletion src/operations/distortion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ see also
[`RandomDistortion`](@ref), [`augment`](@ref)
""" ->
immutable ElasticDistortion <: ImageOperation
struct ElasticDistortion <: ImageOperation
gridheight::Int
gridwidth::Int
scale::Float64
Expand Down
2 changes: 1 addition & 1 deletion src/operations/either.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ see also
[`augment`](@ref)
"""
immutable Either{N,T<:Tuple} <: ImageOperation
struct Either{N,T<:Tuple} <: ImageOperation
operations::T
chances::SVector{N,Float64}
cum_chances::SVector{N,Float64}
Expand Down
4 changes: 2 additions & 2 deletions src/operations/flip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ see also
[`FlipY`](@ref), [`Either`](@ref), [`augment`](@ref)
"""
immutable FlipX <: AffineOperation end
struct FlipX <: AffineOperation end
FlipX(p::Number) = Either(FlipX(), p)

@inline supports_stepview(::Type{FlipX}) = true
Expand Down Expand Up @@ -133,7 +133,7 @@ see also
[`FlipX`](@ref), [`Either`](@ref), [`augment`](@ref)
"""
immutable FlipY <: AffineOperation end
struct FlipY <: AffineOperation end
FlipY(p::Number) = Either(FlipY(), p)

@inline supports_stepview(::Type{FlipY}) = true
Expand Down
2 changes: 1 addition & 1 deletion src/operations/noop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ image but instead passes it along unchanged (without copying).
Usually used in combination with [`Either`](@ref) to denote a
"branch" that does not perform any computation.
"""
immutable NoOp <: AffineOperation end
struct NoOp <: AffineOperation end

@inline supports_eager(::Type{NoOp}) = false
@inline supports_stepview(::Type{NoOp}) = true
Expand Down
2 changes: 1 addition & 1 deletion src/operations/resize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ see also
[`CropSize`](@ref), [`augment`](@ref)
"""
immutable Resize{N} <: ImageOperation
struct Resize{N} <: ImageOperation
size::NTuple{N,Int}

function Resize{N}(size::NTuple{N,Int}) where N
Expand Down
8 changes: 4 additions & 4 deletions src/operations/rotation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ see also
[`Rotate180`](@ref), [`Rotate270`](@ref), [`Rotate`](@ref),
[`Either`](@ref), [`augment`](@ref)
"""
immutable Rotate90 <: AffineOperation end
struct Rotate90 <: AffineOperation end
Rotate90(p::Number) = Either(Rotate90(), p)

@inline supports_permute(::Type{Rotate90}) = true
Expand Down Expand Up @@ -137,7 +137,7 @@ see also
[`Rotate90`](@ref), [`Rotate270`](@ref), [`Rotate`](@ref),
[`Either`](@ref), [`augment`](@ref)
"""
immutable Rotate180 <: AffineOperation end
struct Rotate180 <: AffineOperation end
Rotate180(p::Number) = Either(Rotate180(), p)

@inline supports_stepview(::Type{Rotate180}) = true
Expand Down Expand Up @@ -208,7 +208,7 @@ see also
[`Rotate90`](@ref), [`Rotate180`](@ref), [`Rotate`](@ref),
[`Either`](@ref), [`augment`](@ref)
"""
immutable Rotate270 <: AffineOperation end
struct Rotate270 <: AffineOperation end
Rotate270(p::Number) = Either(Rotate270(), p)

@inline supports_permute(::Type{Rotate270}) = true
Expand Down Expand Up @@ -307,7 +307,7 @@ see also
[`Rotate90`](@ref), [`Rotate180`](@ref), [`Rotate270`](@ref),
[`CropNative`](@ref), [`augment`](@ref)
"""
immutable Rotate{T<:AbstractVector} <: AffineOperation
struct Rotate{T<:AbstractVector} <: AffineOperation
degree::T

function Rotate{T}(degree::T) where {T<:AbstractVector{S} where S<:Real}
Expand Down
2 changes: 1 addition & 1 deletion src/operations/scale.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ see also
[`Zoom`](@ref), [`Resize`](@ref), [`augment`](@ref)
"""
immutable Scale{N,T<:AbstractVector} <: AffineOperation
struct Scale{N,T<:AbstractVector} <: AffineOperation
factors::NTuple{N,T}

function Scale{N}(factors::NTuple{N,T}) where {N,T<:AbstractVector}
Expand Down
4 changes: 2 additions & 2 deletions src/operations/shear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ see also
[`ShearY`](@ref), [`CropNative`](@ref), [`augment`](@ref)
"""
immutable ShearX{T<:AbstractVector} <: AffineOperation
struct ShearX{T<:AbstractVector} <: AffineOperation
degree::T

function ShearX{T}(degree::T) where {T<:AbstractVector{S} where S<:Real}
Expand Down Expand Up @@ -132,7 +132,7 @@ see also
[`ShearX`](@ref), [`CropNative`](@ref), [`augment`](@ref)
"""
immutable ShearY{T<:AbstractVector} <: AffineOperation
struct ShearY{T<:AbstractVector} <: AffineOperation
degree::T

function ShearY{T}(degree::T) where {T<:AbstractVector{S} where S<:Real}
Expand Down
2 changes: 1 addition & 1 deletion src/operations/zoom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ see also
[`Scale`](@ref), [`Resize`](@ref), [`augment`](@ref)
"""
immutable Zoom{N,T<:AbstractVector} <: ImageOperation
struct Zoom{N,T<:AbstractVector} <: ImageOperation
factors::NTuple{N,T}

function Zoom{N}(factors::NTuple{N,T}) where {N,T<:AbstractVector}
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
immutable ImmutablePipeline{N,T<:Tuple} <: Pipeline
struct ImmutablePipeline{N,T<:Tuple} <: Pipeline
operations::T

function ImmutablePipeline{N}(ops::NTuple{N,Operation}) where N
Expand Down

0 comments on commit 12394fc

Please sign in to comment.