Skip to content

Commit 114d9b9

Browse files
committed
Add comment about N0f8 specialization
1 parent 66c21d1 commit 114d9b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/algorithms/common.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ function transform_density!(out::GenericGrayImage, img::GenericGrayImage, edges:
1818
end
1919

2020
function transform_density!(out::GenericGrayImage, img::GenericGrayImage{T}, edges::AbstractRange, newvals::AbstractVector) where T<:Union{N0f8,AbstractGray{N0f8}}
21+
# When dealing with 8-bit images, we can improve computational performance by precomputing the lookup table
22+
# for how the intensities transform (there are only 256 calculations of intensities rather than `length(img)`
23+
# calculations of intensities).
2124
lookup = Vector{eltype(newvals)}(undef, 256)
2225
invoke(transform_density!, Tuple{GenericGrayImage,GenericGrayImage,AbstractRange,AbstractVector},
2326
lookup, zero(T):eps(T):oneunit(T), edges, newvals)

0 commit comments

Comments
 (0)