Fix alignment issues with reinterpret #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support
colorview(ARGB32, ::Array{C<:Colorant}). Fixes #38. CC @yuyichao.This takes another step in the direction of discouraging explicit use of
reinterpret. This is considerably more careful to check whether the eltype of input arrays matches the eltype of the Colorant before usingreinterpret, and consequently is more reliable about falling back toColorView. It resolves the alignment issue by avoiding callingreinterpret. To fix #38, we also have to introduce the ability to take acolorviewof an array that already hasColoranteltype (which it does viachannelview).To simplify the code, this uses triangular dispatch, so this also bumps the minimum required version of Julia. Are folks OK with moving on to 0.6? I was hoping to wait until 0.6 was officially released, but it is a pain in the neck to "fake" triangular dispatch.