-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/available image bounds (Draft) #60
base: main
Are you sure you want to change the base?
Conversation
I guess the question really becomes, do we consider it a requirement to expose the Box data type and its functions as first class citizens in swift? If the answer is yes, theres work to be done to make the interface and expose it. If not, something like this might be sufficient. |
As a Swift/Apple platform OTIO user, I would probably prefer having CGRect-based APIs to work with. CGRect-related data structures might have already been available in Swift Foundation in Linux runtime. I would need to double-check that though. |
hey @jchen9 I concur - if they are available, lets def use them. I didn't see them in the Swift Standard Library but I may have missed something! |
Yeah, they are there. I tried Swift
|
Oh thats unexpected. Thanks for the info @jchen9 - I'll def leverage CG* for the types. Thats great news. |
@jchen9 thanks for letting us know about CGRect being available in Foundation (cross-platform), are you aware the minimum Swift version that was made available in? I propose, if it's possible, we try to target a minimum We should also consider duplicating the package manifest code in a |
I can't find prebuilt Swift 5.9 Linux binary from Swift.org. From the history of https://github.com/swiftlang/swift-corelibs-foundation/blob/main/Sources/Foundation/NSGeometry.swift these structs might have been in the |
Link the Issue(s) this Pull Request is related to.
Fixes #51
Summarize your change.
I wanted to open a discussion on the 'right' way of exposing in a cross platform swift native manner the image_bounds of a media reference. This is absolutely a draft and just meant to spark some discussion.
We need a standard way to bridge C++
std::optional<IMATH_NAMESPACE::Box2d>
across Obj-C and into Swift.In this draft PR, we propose adding a
CxxBox.h
header which exposes a simple structCxxBox2D
which is defined as follows:We then add 3 new functions to
opentimelineio.h / .m
:which we can expose to swift MediaReference class as a property which is a SIMD4 from the standard library.
Pro's - K.I.S.S. - and no reliance on
CGRect
or Apple platform stuff.Con's - we dont have the benefits of either CGRect nor the
Box
type and its functions from IMATH.Thoughts?
Reference associated tests.
No tests yet...