Open vade opened 9 months ago
How to expose these is a really interesting question. We’ve decided to align on Imath for spatial primitives, but we also want our bindings to “feel right” for their context.
Given that CGRect is only available in CoreGraphics (not the cross-platform Foundation), I’d be tempted to try and bind Box2d more directly and then include CGRect conversions in some optional Apple platform aware extensions. This has the downside though that the user needs to manually convert when getting and setting.
One other option is that we could make some custom spatial type protocols that match the underlying Imath types and use extensions to define protocol adherence for types like CGRect. This helps with pain in setting, but getting still requires an unwrap to get to the Apple types.
Oh, just realized, we should move this issue to the Swift-Bindings repo.
Hey @reinecke - Ah this tracks. Maybe theres a 'natural' exposing of the box2D binding, but as you said, an Apple Centric solution would expose a CGRect variant of the box2D binding so clients wouldn't need to worry too much?
Working on an AVFoundation interoperability implementation of OTIO and noticing that Media Reference does not expose its bounds in any way.
While not strictly necessary, its helpful to have access when trying to read an OTIO timeline and do useful stuff with it