I've got the feeling that I could find a quick answer to my need by
combining exiv2 with a little part of code of exif.cc
I've found that in exif.cc, it seems to be the encoding/decoding rules of
XMP blend operations params
-----------------------------------------------------------------------------------------------------------------------------
// encode binary blob into text:
void dt_exif_xmp_encode (const unsigned char *input, char *output, const
int len)
{
const char hex[16] =
{
'0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f'
};
for(int i=0; i<len; i++)
{
const int hi = input[i] >> 4;
const int lo = input[i] & 15;
output[2*i] = hex[hi];
output[2*i+1] = hex[lo];
}
output[2*len] = '\0';
}
// and back to binary
void dt_exif_xmp_decode (const char *input, unsigned char *output, const
int len)
{
// ascii table:
// 48- 57 0-9
// 97-102 a-f
#define TO_BINARY(a) (a > 57 ? a - 97 + 10 : a - 48)
for(int i=0; i<len/2; i++)
{
const int hi = TO_BINARY( input[2*i ] );
const int lo = TO_BINARY( input[2*i+1] );
output[i] = (hi << 4) | lo;
}
#undef TO_BINARY
}
-----------------------------------------------------------------------------------------------------------------------------
Furthermore, exiv2 can directly reads the XMP data of XMP file:
exiv2 -p x myPicture.xmp
=> gives me all data I need (filter + blenop_params encoded in sort of
hexa).
Somebody to support me and indicate me if I'm going in the right direction ?
Thanks !
Alexandre
2013/8/25 Alexandre Jullien <alex.jull...@gmail.com>
> I agree that doing this in the code is not wanted for the first step.
>
> As I wrote, my basic need is to have standalone executable *translating
> darktable XMP files* in clear operations parameters in both ways.
>
> The interpolation is clearly the final goal, but is not hard if you can
> translate easily modules parameters in XMP file.
> I've write some scripts using bash and octave doing this kind of job on
> luminosity to deflicker my timelpase but on JPG only...
>
> Thanks for your answers, I hope that somebody with development skill could
> helm me to do this external tool based on src/iop :-)
>
> Alexandre
>
>
> 2013/8/25 Tobias Ellinghaus <h...@gmx.de>
>
>> Am Sonntag, 25. August 2013, 12:51:53 schrieb Alexandre Jullien:
>> > Hello everybody,
>>
>> Hi.
>>
>> [modifying iop params from outside the module]
>>
>> this is something I wanted to do for quite some time, however it requires
>> some
>> means of introspection to make sense of the module params. This would
>> probably
>> require some new API so that modules could decode their binary params
>> blob.
>> Doing it directly in code would be quite messy and prone to break whenever
>> anything gets changed. It would also require us to invent some data
>> format to
>> convert the params to/from.
>>
>> My hope is that some day™ LUA will be able to access the parameters of
>> modules. Then we could write small scripts (maybe some day even with a
>> GUI)
>> that can interpolate between the parameters of two images over a whole
>> set.
>> But until that happens the only hope would be to write a small external
>> tool
>> that directly uses the struct definitions from the files in src/iop/* and
>> breaks
>> whenever these are changed.
>>
>> TL;DR: would be nice but is hardly possible.
>>
>> > Alexandre (Toulouse (31) / France)
>>
>> Tobias
>>
>> ------------------------------------------------------------------------------
>> Introducing Performance Central, a new site from SourceForge and
>> AppDynamics. Performance Central is your source for news, insights,
>> analysis and resources for efficient Application Performance Management.
>> Visit us today!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>> _______________________________________________
>> darktable-devel mailing list
>> darktable-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/darktable-devel
>>
>>
>
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel