how do you setup a MTKView for tone mapping HDR

Generated on 8/2/2024

1 search

To set up an MTKView for tone mapping HDR, you can follow these steps as outlined in the session "Use HDR for dynamic image experiences in your app":

  1. Set up the MTKView for extended range content:

    • Ensure that the MTKView is configured to handle extended range content, which is necessary for HDR.
  2. Apply filters to create an edited CI image:

    • Use Core Image (CI) filters to create an edited CI image that you want to display.
  3. Get the current display headroom state for the view:

    • Retrieve the current display headroom state to understand the display's capabilities.
  4. Apply the new CI tonemap headroom filter:

    • Use the new CI tonemap headroom filter to tone map the image according to the display's headroom.
  5. Render the resulting tonemapped image using the CI render destination API:

    • Finally, render the tonemapped image using the Core Image render destination API.

For more detailed information and code examples, you can refer to the session Use HDR for dynamic image experiences in your app (27:56).

If you need to edit SDR and gain map images separately and display the combined result in an MTKView, the process is similar. You can find more details in the same session at Use HDR for dynamic image experiences in your app (30:17).

Relevant Sessions

  1. Use HDR for dynamic image experiences in your app