From 423186494f0616ae072d0e6908e97bac5e1d4bbb Mon Sep 17 00:00:00 2001 From: Muukii Date: Mon, 27 Nov 2023 00:18:20 +0900 Subject: [PATCH] WIP --- Dev/Brightroom.xcodeproj/project.pbxproj | 20 +++++++++---------- .../DataSource/ImageSource.swift | 6 +++++- .../Shared/Components/Crop/CropView.swift | 1 + .../ImageViews/MetalImageView.swift | 6 ++++++ .../Components/ImageViews/_ImageView.swift | 1 + 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Dev/Brightroom.xcodeproj/project.pbxproj b/Dev/Brightroom.xcodeproj/project.pbxproj index 381af8fc..10fa5c03 100644 --- a/Dev/Brightroom.xcodeproj/project.pbxproj +++ b/Dev/Brightroom.xcodeproj/project.pbxproj @@ -2598,7 +2598,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "$(SRCROOT)/Sources/Demo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2619,7 +2619,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "$(SRCROOT)/Sources/Demo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2640,7 +2640,7 @@ CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_ASSET_PATHS = "\"Sources/SwiftUIDemo/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = JX92XL88RZ; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = Sources/SwiftUIDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -2662,7 +2662,7 @@ CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "\"Sources/SwiftUIDemo/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = JX92XL88RZ; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = Sources/SwiftUIDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -2682,7 +2682,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = GKNHX9R5U2; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "Tests/$(TARGET_NAME)/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2702,7 +2702,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = GKNHX9R5U2; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "Tests/$(TARGET_NAME)/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2721,7 +2721,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "$(SRCROOT)/Bundle/LUTs/Import LUT/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2742,7 +2742,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = "$(SRCROOT)/Bundle/LUTs/Import LUT/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2763,7 +2763,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = Bundle/LUTs/ShareLUT/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2784,7 +2784,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = KU2QEJ9K3Z; + DEVELOPMENT_TEAM = JX92XL88RZ; INFOPLIST_FILE = Bundle/LUTs/ShareLUT/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/Sources/BrightroomEngine/DataSource/ImageSource.swift b/Sources/BrightroomEngine/DataSource/ImageSource.swift index 1bf77735..d8260d4d 100644 --- a/Sources/BrightroomEngine/DataSource/ImageSource.swift +++ b/Sources/BrightroomEngine/DataSource/ImageSource.swift @@ -64,7 +64,11 @@ public final class ImageSource: Equatable { )! }, makeCIImage: { - CIImage(image: image)! + if #available(iOS 17.0, *) { + CIImage(image: image, options: [.expandToHDR : true])! + } else { + CIImage(image: image, options: [:])! + } } ) } diff --git a/Sources/BrightroomUI/Shared/Components/Crop/CropView.swift b/Sources/BrightroomUI/Shared/Components/Crop/CropView.swift index 4a8cc75c..230b0da2 100644 --- a/Sources/BrightroomUI/Shared/Components/Crop/CropView.swift +++ b/Sources/BrightroomUI/Shared/Components/Crop/CropView.swift @@ -167,6 +167,7 @@ public final class CropView: UIView, UIScrollViewDelegate { addSubview(scrollView) addSubview(guideView) + imageView.preferredImageDynamicRange = .high imageView.isUserInteractionEnabled = true scrollView.addSubview(imageView) scrollView.delegate = self diff --git a/Sources/BrightroomUI/Shared/Components/ImageViews/MetalImageView.swift b/Sources/BrightroomUI/Shared/Components/ImageViews/MetalImageView.swift index a771f827..6f4a4f4e 100644 --- a/Sources/BrightroomUI/Shared/Components/ImageViews/MetalImageView.swift +++ b/Sources/BrightroomUI/Shared/Components/ImageViews/MetalImageView.swift @@ -73,6 +73,12 @@ open class MetalImageView: MTKView, CIImageDisplaying, MTKViewDelegate { clearColor = .init(red: 0, green: 0, blue: 0, alpha: 0) clearsContextBeforeDrawing = true + if #available(iOS 17.0, *) { + layer.wantsExtendedDynamicRangeContent = true + } else { + // Fallback on earlier versions + } + #if targetEnvironment(simulator) #else /// For supporting wide-color - extended sRGB diff --git a/Sources/BrightroomUI/Shared/Components/ImageViews/_ImageView.swift b/Sources/BrightroomUI/Shared/Components/ImageViews/_ImageView.swift index e57d68e8..4cbc1d2b 100644 --- a/Sources/BrightroomUI/Shared/Components/ImageViews/_ImageView.swift +++ b/Sources/BrightroomUI/Shared/Components/ImageViews/_ImageView.swift @@ -21,6 +21,7 @@ final class _ImageView: UIImageView, CIImageDisplaying { init() { super.init(frame: .zero) layer.drawsAsynchronously = true + preferredImageDynamicRange = .high } required init?(coder: NSCoder) {