Using camconst.json in Filmulator

I’m planning on using RawTherapee’s camconst.json as a source of data for Filmulator, specifically for white saturation points for the time being.

Is the dev branch of RawTherapee on GitHub the canonical place for it, if I have a button auto-download it?

I am not saying that you have a library which could be the canonical shared source for it.

In RawTherapee the dev branch on GitHub is the canonical place for it :wink:

Now to figure out how I’m going to make use of it…

I might have it be loaded into the SQLite database for easier querying instead of reading through it at startup…

You probably already figured out it is not strict JSON, as there are comments in the file, which is not allowed. Something to take into account when parsing the file…

Actually I had no idea, because I have never dealt with JSON before.

I was hoping I could just use Qt’s library for parsing it, but maybe not…

I include camconst.json with rawproc, and I use Dave Gamble’s cJSON library to read it.

It seems to ignore the comments just fine…

Edit: Oh, that’s also what RawTherapee uses… :laughing:

1 Like

Happened upon this on Hacker News…

“To be safe allocate 5 bytes more than you need”

2 Likes

I don’t use that function, I think it’s only needed if you intend to print the data structure.

Here’s my code: