-
Notifications
You must be signed in to change notification settings - Fork 164
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
Unify channel index type in nth_channel_view and image_view::num_channels #373
Comments
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
A rationale could be that |
It has been a bit of a mess. I'm recalling #305 where some of us, @stefanseefeld, were preferring My suggestion is to
Please, have your say @sdebionne @striezel @stefanseefeld @lpranam @chhenning @simmplecoder ... |
Everywhere - except where it is not used. While
Seems to me like most of the image processing stuff agreed that channels should be a
Yeah, seems like it, but we can fix that - one PR at a time.
Basically I am with Stefan Seefeld on this one. |
Sorry, I meant "everywhere" in core. Image processing is a recent addition to the library (that I dont know much about TBH). I think there is a consensus that unsigned integers are error prone and that using unsigned type for OpenMP does not allow a for loop index to be |
I was not really expecting that people do arithmetic operations on the number of channels, but if that is a concern, then some signed type may indeed be better. In that case it should probably be |
I don't like the I do like the idea of readable and self-descriptive names, so I like the idea of aliasing |
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
This unifies the channel index type in nth_channel_view and image_view::num_channels - the latter one already uses std::size_t. Fixes boostorg#373.
Actual behavior
image_view::num_channels()
returnssize_t
nth_channel_view(View, int n)
expectsint
for indexApart from signed and unsigned mix-up causing the annoying compilation warnings,
if no rationale of the mix is provided, it's a sloppy design of the interface.
Expected behavior
Use of common type for indexing of
image_view
channels.C++ Minimal Working Example
The text was updated successfully, but these errors were encountered: