timedata-org / old-timedata

Time arts data - high-performance color processing in C++ and Python.
7 stars 3 forks source link

Models with disparate components. #88

Open rec opened 8 years ago

rec commented 8 years ago

Motivating example: in the HSV color model, the hue component is often thought of going from 0 to 360, or a mathematician might write 0 to 2π, but the saturation and value go from 0 to 100.

In the C++ world, each component's type includes its range - deliberately, it's a good feature.

And a Sample is a std::array so its components must have the same type.

It's likely that I'm going to have to replace this with std::tuple - which means I have to unroll every loop over each component. That isn't that bad but it's not trivial. For after release...

rec commented 8 years ago

I'm now thinking that a struct is the correct way to go...

rec commented 8 years ago

...but that the difficulty of this is definitely beyond the pale for v1.0.