I'm trying to use GIL pixel iterators in a generic STL-style algorithm. I'm primarily using GIL for the generic 2D iterators. And in my context, I'm only interested in grayscale images.
The value_type associated with GIL iterators is a pixel type, which typically is an object representing multiple channels (e.g., colors). It makes sense that comparison operators (e.g., <) are not defined for general color pixel types.
For grayscale images, however, it makes sense that common arithmetic and comparison operators would be defined for the pixel type. This seems to be the case for the 8-bit grayscale GIL type (gray8_view_t). The iterator's value_type appears to be seamlessly evaluated to an unsigned char, exactly as I would expect.
When I try to use a float image view type, however, the same magic doesn't seem to happen. Below is some toy code that demonstrates the issue. When the last line is knocked out with "//", the code compiles. But with that second template instantiation (for floats) there, the compiler (gcc 4.2 and VC++2010) exits when it does not find an operator< for the iterator's value_type when instantiating for gray32fc_view_t.
I suppose that I can roll my own less