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

incorrect channelview for ReinterpretArray when constructed from numerical array #176

Open
johnnychen94 opened this issue Apr 4, 2022 · 0 comments
Assignees
Labels

Comments

@johnnychen94
Copy link
Member

julia> data = UInt8[0, 255]
2-element Vector{UInt8}:
 0x00
 0xff

julia> img = reinterpret(Gray{N0f8}, data)
2-element reinterpret(Gray{N0f8}, ::Vector{UInt8}):
 Gray{N0f8}(0.0)
 Gray{N0f8}(1.0)

julia> channelview(img) # the eltype should be `N0f8` instead
2-element Vector{UInt8}:
 0x00
 0xff

julia> channelview(collect(img))
2-element reinterpret(reshape, N0f8, ::Array{Gray{N0f8},1}) with eltype N0f8:
 0.0N0f8
 1.0N0f8
@johnnychen94 johnnychen94 self-assigned this Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant