cessen / openexr-rs

This repository has been moved to https://github.com/vfx-rs/openexr-rs
MIT License
23 stars 10 forks source link

Support arbitrary attributes #27

Open abusch opened 6 years ago

abusch commented 6 years ago

It looks like OpenEXR supports arbitrary attributes in the header. There are a bunch of standard, but optional, atrtributes defined in https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfStandardAttributes.h

It would be nice to support at least some of them, like owner, comments, or capDate.

I may give it a shot maybe if I can find a bit of time, but might need a little bit of guidance :)

cessen commented 6 years ago

Ah, yes! This is definitely something we want to support. Just haven't gotten around to it. I think the main concern is design. The C++ API allows for some C++ specific capabilities with custom attributes, IIRC, so part of the question is simply how far do we go in trying to support that. But at least covering integers, floats, matrices, and strings would be good.

I would be delighted if you wanted to take a crack at it. I don't have tons of time to provide guidance right at this moment, but I'll do my best!

Ralith commented 6 years ago

I attempted this once previously and found that the built-in extended attributes rely heavily enough on C++ template magic that they cannot be handled generically in C bindings, i.e. they must be painstakingly bound individually. Yes, this seems implausible, but if you dig deep enough I believe you'll come to the same conclusion.

It would certainly be nice to have, though! Non-standard extended attributes can be handled more gracefully, as well.

norru commented 5 years ago

@ralith @cessen @abusch For my current project I absolutely need support for (writing) the multiView attribute. This is the only attribute I need to get past a brick wall.

IMF_STD_ATTRIBUTE_DEF (multiView , MultiView, StringVector)

I need a very very short term fix (ie I have zero resource to dedicate to write full arbitrary attributes support) otherwise I cannot progress with my project, a hack if necessary. Any suggestions?

they must be painstakingly bound individually.

In this context, it's acceptable to have a header.set_multi_view(&[&str]]) dedicated call which does one and one thing only.

Ralith commented 5 years ago

I'll try to bang that one out; I'll probably want it someday myself.

Ralith commented 5 years ago

See #39