Skip to content

incorrect channelview for ReinterpretArray when constructed from numerical array #176

@johnnychen94

Description

@johnnychen94
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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions