Post

Replies

Boosts

Views

Activity

Reply to Converting UIImage to jpegData - [Metal] 9072 by 12198 iosurface is too large for GPU
What is going on in ImagePicker? What type is Image? The device's camera should give an image a lot smaller than 9072 by 12198. If you want to support images that large, try CGImageDestination. For example: struct ImageDestination { let outputData = CFDataCreateMutable(nil, 0)! let cgImageDestination: CGImageDestination init?(type: UTType, count: Int = 1) { guard let d = CGImageDestinationCreateWithData(outputData, type.identifier as CFString, count, nil) else { return nil } self.cgImageDestination = d } mutating func addImage(_ image: CGImage) { CGImageDestinationAddImage(cgImageDestination, image, nil) } mutating func finalize() throws { guard CGImageDestinationFinalize(cgImageDestination) else { throw DocumentFailure.savingUnknown } } } /// usage: let imageCG = uiImage.cgImage! var dest = ImageDestination(type: .jpeg)! dest.addImage(imageCG) dest.finalize() // your data dest.outputData
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to EDR and display brightness
My guess is that this is related to the LCD display in your mac. LCD works by blocking light, but it's not perfect. Say black = 99.9% absorption or 0.001 transmittance. Say your max brightness is 500 nits, that means full backlight + LCD at reference white -> 500 nits. Well your blacks are going to be 0.001 * 500 = 0.5 nits. At half brightness, if you keep the backlight the same but increase the dimming on the LCD, you end up with EDR headroom. BUT, now the blacks (still 0.5 nits) got brighter relative to the reference white (250 nits). So if you did this all the way down to minimum brightness, the laptop screen would look washed out and be consuming extra power to keep the backlight at full. Other display types like OLED screens don't have this issue. LCDs with local-dimming can mitigate this by turning down some of the backlight zones (you still get blacks washing out in some areas, ie ghosting), so it's practical to end up with a greater dynamic range.
Topic: Graphics & Games SubTopic: General Tags:
Sep ’21
Reply to Converting UIImage to jpegData - [Metal] 9072 by 12198 iosurface is too large for GPU
What is going on in ImagePicker? What type is Image? The device's camera should give an image a lot smaller than 9072 by 12198. If you want to support images that large, try CGImageDestination. For example: struct ImageDestination { let outputData = CFDataCreateMutable(nil, 0)! let cgImageDestination: CGImageDestination init?(type: UTType, count: Int = 1) { guard let d = CGImageDestinationCreateWithData(outputData, type.identifier as CFString, count, nil) else { return nil } self.cgImageDestination = d } mutating func addImage(_ image: CGImage) { CGImageDestinationAddImage(cgImageDestination, image, nil) } mutating func finalize() throws { guard CGImageDestinationFinalize(cgImageDestination) else { throw DocumentFailure.savingUnknown } } } /// usage: let imageCG = uiImage.cgImage! var dest = ImageDestination(type: .jpeg)! dest.addImage(imageCG) dest.finalize() // your data dest.outputData
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Use MTKView with UIScrollView
Post more of your code. MTKView works fine with UIScrollView, so maybe one of their frames is zero-sized?
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to EDR and display brightness
My guess is that this is related to the LCD display in your mac. LCD works by blocking light, but it's not perfect. Say black = 99.9% absorption or 0.001 transmittance. Say your max brightness is 500 nits, that means full backlight + LCD at reference white -> 500 nits. Well your blacks are going to be 0.001 * 500 = 0.5 nits. At half brightness, if you keep the backlight the same but increase the dimming on the LCD, you end up with EDR headroom. BUT, now the blacks (still 0.5 nits) got brighter relative to the reference white (250 nits). So if you did this all the way down to minimum brightness, the laptop screen would look washed out and be consuming extra power to keep the backlight at full. Other display types like OLED screens don't have this issue. LCDs with local-dimming can mitigate this by turning down some of the backlight zones (you still get blacks washing out in some areas, ie ghosting), so it's practical to end up with a greater dynamic range.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Altool Error on OS 10.10.5 Yosemite - altool: unrecognized option `--notarize-app'
If you don't have access to a more recent Mac, try using an automation on Github Actions.
Topic: Code Signing SubTopic: Notarization Tags:
Replies
Boosts
Views
Activity
May ’22