Skip to content
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

Add Missing Extended Dynamic Range APIs to iOS #12852

Closed
Microno95 opened this issue Jan 23, 2023 · 4 comments
Closed

Add Missing Extended Dynamic Range APIs to iOS #12852

Microno95 opened this issue Jan 23, 2023 · 4 comments
Labels
external partner/macios Issues for the Mac / iOS SDK partner Issue or Request from a partner team platform/iOS 🍎 proposal/open

Comments

@Microno95
Copy link

Description

In iOS 16, the extended dynamic range APIs were added for use with Metal. Specifically, the CAMetalLayer class now has the properties wantsExtendedDynamicRangeContent and edrMetadata exposed on iOS.

Adding these to the iOS SDK would enable developers to write applications that can take advantage of EDR on iOS platforms.

Public API Changes

namespace CoreAnimation
{
    [Register("CAMetalLayer", true)]
    [SupportedOSPlatform("ios8.0")]
    [SupportedOSPlatform("macos10.11")]
    [SupportedOSPlatform("maccatalyst13.0")]
    [SupportedOSPlatform("tvos8.0")]
    public class CAMetalLayer : CALayer
    {
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        [Export("init")]
        public CAMetalLayer();
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [DesignatedInitializer]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        [Export("initWithCoder:")]
        public CAMetalLayer(NSCoder coder);
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        protected CAMetalLayer(NSObjectFlag t);
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        protected internal CAMetalLayer(NativeHandle handle);

        public override NativeHandle ClassHandle { get; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("tvos11.0")]
        [SupportedOSPlatform("macos10.13")]
        [SupportedOSPlatform("ios11.0")]
        [SupportedOSPlatform("maccatalyst11.0")]
        public virtual bool AllowsNextDrawableTimeout { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("tvos13.0")]
        [SupportedOSPlatform("macos10.15")]
        [SupportedOSPlatform("ios13.0")]
        [SupportedOSPlatform("maccatalyst13.0")]
        public virtual CGColorSpace? ColorSpace { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual IMTLDevice? Device { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual CGSize DrawableSize { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual bool FramebufferOnly { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("tvos11.2")]
        [SupportedOSPlatform("macos10.13.2")]
        [SupportedOSPlatform("ios11.2")]
        [SupportedOSPlatform("maccatalyst11.2")]
        public virtual nuint MaximumDrawableCount { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual MTLPixelFormat PixelFormat { get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("tvos13.0")]
        [SupportedOSPlatform("macos10.15")]
        [SupportedOSPlatform("ios13.0")]
        [SupportedOSPlatform("maccatalyst13.0")]
        public virtual IMTLDevice? PreferredDevice { get; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual bool PresentsWithTransaction { get; set; }
        // PROPOSED ADDITION //
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios16.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst16.0")]
        public virtual bool wantsExtendedDynamicRangeContent{ get; set; }
        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [SupportedOSPlatform("ios16.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst16.0")]
        public virtual CAEDRMetadata? edrMetadata { get; set; }
        // END OF ADDITION //

        [BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
        [Export("nextDrawable")]
        [SupportedOSPlatform("ios8.0")]
        [SupportedOSPlatform("macos10.11")]
        [SupportedOSPlatform("maccatalyst13.0")]
        [SupportedOSPlatform("tvos")]
        public virtual ICAMetalDrawable? NextDrawable();
    }
}

Intended Use-Case

I am working as part of software development team where we would like to display High Dynamic Range content on the latest iPad Pros which supports up to 1600 nits in EDR mode, but are unable to fully utilise the display as such.

@drasticactions
Copy link
Contributor

I believe this should go to https://github.com/xamarin/xamarin-macios. That's where the bindings live, not here.

@jaykannan
Copy link

I believe this should go to https://github.com/xamarin/xamarin-macios. That's where the bindings live, not here.

Is there a MAUI Native equivalent of this repo like Xamarin IOS where it could specifically go?

@jfversluis
Copy link
Member

I believe this should go to https://github.com/xamarin/xamarin-macios. That's where the bindings live, not here.

Is there a MAUI Native equivalent of this repo like Xamarin IOS where it could specifically go?

No, that is the linked repo, that is also used for .NET MAUI and will probably be renamed/moved at some point :)

@jfversluis
Copy link
Member

This issue was moved to xamarin/xamarin-macios#17340

@dotnet dotnet locked and limited conversation to collaborators Jan 23, 2023
@samhouts samhouts added partner Issue or Request from a partner team partner/macios Issues for the Mac / iOS SDK external labels May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external partner/macios Issues for the Mac / iOS SDK partner Issue or Request from a partner team platform/iOS 🍎 proposal/open
Projects
None yet
Development

No branches or pull requests

5 participants