timedata-org / old-timedata

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

Handle different color models. #54

Closed rec closed 8 years ago

rec commented 8 years ago

Right now, colors don't know if they're RGB or HSV - and there are more models than just two.

BUT we don't want to burden code with additional indirections to look up methods - this sort of strategy in the past has resulted in diminished benchmarks.

I think the Python template strategy for .pyx code I'm using now will unfortunately have to be expanded to cover these cases.

And we are also going to need some "central conversion registry" for this - so if I get some flavor of Color or ColorList, I have to be able to look up there how to convert it to some other desired color model...

(We also have to keep our eyes open to future color models with more components.)

rec commented 8 years ago

I am clearer on this issue now.

We're starting with Color and ColorList.

The generalized concept is a Sample and a SampleList (names could easily change).

Everything is generic on three things:

  1. An enumerated type Enum - The names (and thus the count) of the fields in the Sample.
  2. A range type Range - classes representing say [0, 1] or [0, 255].
  3. A number type Number - by default this is float
bentoncbainbridge commented 8 years ago

Tom, if I reply to this email does it post to github?

I can help with additive color models, color compression schemes and CLUTs if you have any questions On Jun 1, 2016 7:18 PM, "Tom Swirly" notifications@github.com wrote:

I am clearer on this issue now.

We're starting with Color and ColorList.

The generalized concept is a Sample and a SampleList (names could easily change).

Everything is generic on three things:

  1. An enumerated type Enum - The names (and thus the count) of the fields in the Sample.
  2. A range type Range - classes representing say [0, 1] or [0, 255].
  3. A number type Number - by default this is float

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rec/tada/issues/54#issuecomment-223153195, or mute the thread https://github.com/notifications/unsubscribe/ALQTyRLGyUaC73n2AAqnhYFjnBSpLIaHks5qHhNJgaJpZM4IqClE .

rec commented 8 years ago

Yes :-) it posts on github AND I get email!

I'd love a 30 minute chat on color models soon, but actually more in relation to this issue: https://github.com/rec/tada/issues/51

Really the details of color models go into #51 - which is a much easier bug too.

This issue relates more to "how to represent such a thing in C++, and in Python, and how to automatically bridge the gap between them".

I expect to use the results also for audio samples, DMX, ILDA, etc... There will be one more problem, which is parallel vs interleaved, and then I'm sort of "done" my Time Data Opus! :-D

rec commented 8 years ago

I need also a list of color type we'll accept for 1.0.

Non-goals for this pass.

I think I should add a lot of these to force me to automate this process from the start. :-D

This will require a fairly small amount of code to do the actual conversion - the last four are basically the same, as are the second and third.

The key is keeping track of which we're using!

rec commented 8 years ago

I did the first five. The last two could be done if someone wanted them!