boostorg / boostorg/gil

Unify channel index type in nth_channel_view and image_view::num_channels

Aperta
#373 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
cat/annoyance core
Lingua principale
C++
Stelle
199
Fork
171
Merge medio
1g 14h
PR unite (30g)
10

Descrizione

### Actual behavior

- `image_view::num_channels()` returns `size_t`
- `nth_channel_view(View, int n)` expects `int` for index

Apart 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

```cpp
#include
namespace gil = boost::gil;
int main
{
gil::rgb8_image_t img;
auto v = gil::view(img);
for (std::size_t i = 0; i < v.num_channels(); i++)
auto _ = nth_channel_view(v, i);
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.