Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Graphics dependency #185

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
Graphics = "a2bd30eb-e257-5431-a919-1863eab51364"
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Expand All @@ -19,7 +18,6 @@ AbstractFFTs = "0.4, 0.5, 1.0"
ColorVectorSpace = "0.9.7"
Colors = "0.12"
FixedPointNumbers = "0.8"
Graphics = "0.4, 1.0"
MappedArrays = "0.2, 0.3, 0.4"
MosaicViews = "0.3.3"
OffsetArrays = "0.8, 0.9, 0.10, 0.11, 1.0.1"
Expand Down
9 changes: 2 additions & 7 deletions src/ImageCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Reexport

@reexport using MosaicViews
@reexport using PaddedViews
using MappedArrays, Graphics
using MappedArrays
using OffsetArrays # for show.jl
using .ColorTypes: colorant_string
using Colors: Fractional
Expand All @@ -16,8 +16,6 @@ using MappedArrays: AbstractMultiMappedArray
using Base: tail, @pure, Indices
import Base: float

import Graphics: width, height

# TODO: just use .+
# See https://github.com/JuliaLang/julia/pull/22932#issuecomment-330711997
plus(r::AbstractUnitRange, i::Integer) = broadcast(+, r, i)
Expand Down Expand Up @@ -81,17 +79,14 @@ export
# traits
assert_timedim_last,
coords_spatial,
height,
indices_spatial,
namedaxes,
nimages,
pixelspacing,
sdims,
size_spatial,
spacedirections,
spatialorder,
width,
widthheight
spatialorder

include("colorchannels.jl")
include("stackedviews.jl")
Expand Down
4 changes: 0 additions & 4 deletions src/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ end
assert_timedim_last(img::OffsetArray) = assert_timedim_last(parent(img))
assert_timedim_last(img::SubArray) = assert_timedim_last(parent(img))

widthheight(img::AbstractArray) = length(axes(img,2)), length(axes(img,1))

width(img::AbstractArray) = widthheight(img)[1]
height(img::AbstractArray) = widthheight(img)[2]


# Traits whose only meaningful definitions occur in ImageAxes, but for
Expand Down
2 changes: 0 additions & 2 deletions test/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ using ImageCore: Pixel, NumberLike, GenericImage, GenericGrayImage, default_name
@test indices_spatial(B) == (Base.OneTo(3), Base.OneTo(5))
end
assert_timedim_last(B)
@test width(B) == 5
@test height(B) == 3
end
end

Expand Down