Using Lightroom I know how to apply a camera profile (*.dcp file) to my *.DNG image.
I would like to do the same in an application which I'm writing, so I guess a good
starting point would be to append this functionality to the dng_validate.exe
application.
So I started to add:
#include "dng_camera_profile.h"
Then added:
static dng_string gDumpDCP;
And add the following to the error print:
"-dcp <file> Load camera profile from <file>.dcp\"\n"
Then I added the function to read the dcp from cli:
else if (option.Matches("dcp", true))
{
gDumpDCP.Clear();
if (index + 1 < argc)
{
gDumpDCP.Set(argv[++index]);
}
if (gDumpDCP.IsEmpty() || gDumpDCP.StartsWith("-"))
{
fprintf(stderr, "*** Missing file name after -dcp\n");
return 1;
}
if (!gDumpDCP.EndsWith(".dcp"))
{
gDumpDCP.Append(".dcp");
}
}
Then I load the profile from disk:
if (gDumpTIF.NotEmpty ())
{
dng_camera_profile profile;
if (gDumpDCP.NotEmpty())
{
dng_file_stream inStream(gDumpDCP.Get());
profile.ParseExtended(inStream);
}
// Render final image.
.... rest of code as it was
So how do I now use the profile data to correct the render and write the corrected image?