In the librtprocess branch of rawproc, there is now a fairly functional incorporation of librtprocess demosaics:
The build instructions aren’t updated yet, but ./configure --enable-librtprocess … checks for the installed library and enables the GUI selectors for the algorithms. --enable-demosaic has been removed; rawproc now includes by default a demosaic tool with the toy “half” algorithm.
Most of the librtprocess demosaic algorithms are now exposed in the demosaic tool, with the exception of xtransfast_demosaic() and lmmse_demosaic(). Also not yet exposed are GUI controls to enter algorithm-specific parameters, which are hard-coded for the time being.
In the code, one will find the librtprocess calls in src/gimage.cpp, in the gImage::ApplyDemosaic() method, about line 2191. Scroll past the half, half-resize, and color conditionals; there, I demonstrate three data mashalling schemes:
- In-line malloc/free of float** arrays
- JaggedArray declarations, using jaggedarray.h copied from librtprocess/include to /usr/include
- RT_malloc() and RT_free() helper functions I wrote to do the memory management. Those functions can be found just prior to the gImage::ApplyDemosaic() method header/commentary.
I’m going to keep it in the librtprocess branch for a while, before merging it with master. I’m also working on porting the ahd_demosaic() routine from RawTherapee, about 80% complete. Edit: should point out, that work is in a fork of CarVac/librtprocess, so eventually I’ll, what, request a pull? push a patch? I’ve not done this before…