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

rasterize method is too restrictive on argument types #17

Open
gszep opened this issue Mar 31, 2021 · 4 comments
Open

rasterize method is too restrictive on argument types #17

gszep opened this issue Mar 31, 2021 · 4 comments

Comments

@gszep
Copy link

gszep commented Mar 31, 2021

the current type signature uses Matrix{Float64} for points and colors positional arguments which is too restrictive and does not allow for useful color formats such as ::Array{Normed{UInt8,8},2} or views into larger arrays such as ::SubArray. Would recommend using AbstractMatrix{<:Number} instead

@exaexa
Copy link
Collaborator

exaexa commented Mar 31, 2021

Will have a look at it. Certainly I guess we can go at least with AbstractMatrix{AbstractFloat}.

@gszep
Copy link
Author

gszep commented Mar 31, 2021

in fact it seems that rasterize is current doing a lot of conversion from Float64 to Int64 which we can avoid by having additional method where colors::AbstractMatrix{Normed{UInt8,8}}

@gszep
Copy link
Author

gszep commented Mar 31, 2021

you can also consider handling colors::AbstractVector{<:Colorant} from https://github.com/JuliaGraphics/ColorTypes.jl

@gszep
Copy link
Author

gszep commented Mar 31, 2021

Note that Normed{UInt8,8} is not an AbstractFloat so you would need a more general abtract type to capture it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants