English 中文(简体)
三维问题: 我如何在MTKView和CIContext中定有色数据,以适当显示所有三个图像?
原标题:The Three-Image Problem: How do I set tagged color data in MTKView and CIContext to properly display all three images?

I have provided a link to a UIKit test app which displays three different images, side by side, each inside a separate MTKView. Each image is tagged with a different color profile:

  • Display P3
  • uRGB
  • Test RGB

我为所有彩色空间和格式设定了缺省值。 然后,我检查图像是否贴上标签,如果是的话,我就从有色空间中推翻这些价值。

The variables I am setting:

  • “workingColorSpace” in the Metal CIContext, default = sRGB
  • “workingFormat” in the Metal CIContext, default = RGBAf
  • “outputColorSpace” in the Metal CIContext, default = displayP3
  • “colorPixelFormat” in the MTKView, default = bgra8Unorm
  • “colorSpace” in a CIRenderDestination that I use in the MTKView delegate draw method

“宇宙空间”违约值 = CGColor SpaceCreateDeviceRGB(CGC)

我还在CIRenderDestination与MTKView.colorPixelFormat中确定了“pixelFormat”。

If the image is tagged, I override the following values with the tagged colorSpace:

  • CIContext.workingColorSpace
  • CIContext.outputColorSpace
  • CIRenderDestination.colorSpace

如果挂图的彩色空间是真的,那么我就把CIRenderDestination.color Space确定为延伸SRGB,忽视了有色的宽加宽色空间的彩色空间,并确定了彩色PixelFormat = bgr10_xr

Results:

  • The above scenario will properly render the DisplayP3 image, and the uRGB image. The “Test RGB” image fails: enter image description here

  • If I do not override the CIRenderDestination.colorSpace with a value from the tagged image, then the “Test RGB” image succeeds, but the “uRGB” image fails to render properly: enter image description here

Question: Do I have everything hooked up correctly and, if so, why does one image fail, and the other succeed?

与抽样项目的联系:

https://www.drop Box.com/scl/fi/57u2fcrgdvys7jtzykzxt/Color Space Research.zip?rlkey=unjeeiu7mi0wx9wfpylt78nwd&dl=0

问题回答




相关问题
Rendering to CVPixelBuffer on iOS

I have a flutter plugin where I need do to some basic 3D rendering on iOS. I decided to go with the Metal API because the OpenGL ES is deprecated on the platform. Before implementing a plugin I ...

热门标签