I would welcome a pull request with this fully fleshed out and tested.
Two more things...
1. Just to future-proof it, I might add this in there:
ASSERT(sizeof(Imf::TimeCode) == 2*sizeof(unsigned int));
2. If there are other formats that have full SMPTE timecodes, we might want to
instead change the attribute to "SMPTE:TimeCode" (making it not be
exr-specific) and dictate that any other formats follow the same encoding if
they have an SMPTE timecode.
On Oct 3, 2013, at 10:07 AM, Larry Gritz wrote:
> I don't think this merits a new core type.
>
> I would add it to the metadata as an array of two unsigned ints, which is how
> it's encoded in Imf::TimeCode. You'd want something like this in
> exrinput.cpp:
>
> static TypeDesc TwoUints (TypeDesc::UINT, 2);
> Imf::TimeCode tc = ...; // get the timecode from the EXR file
> spec.attribute ("openexr:TimeCode", TwoUints, &tc);
>
> And then to extract it (including in exroutput.cpp):
>
> ImageIOParameter *f = spec.find_attribute ("openexr:TimeCode",
> TwoUints);
> if (f) {
> Imf::TimeCode tc = *(const ImfTimeCode *) f->data();
> ... do your thing with tc ...
> }
>
>
>
> On Oct 3, 2013, at 8:56 AM, Mark Boorer wrote:
>
>> Hi,
>>
>> Was just looking to access timecode metadata from some EXR files, and
>> noticed that timecode keys aren't extracted by the reader.
>>
>> I then found this rather old issue
>> https://github.com/OpenImageIO/oiio/issues/337. Is it possible for me to add
>> this in? A simple class based on ImfTimeCode.h (or even just this class
>> directly) and a new enum added to TypeDesc?
>>
>> Cheers,
>> Mark
>
> --
> Larry Gritz
> [email protected]
>
--
Larry Gritz
[email protected]
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org