Post

Replies

Boosts

Views

Activity

How can I load HDR(HLG) pixelbuffer to texture?(OpenGLES, Metal)
Hello I am Daeun Sim, working on graphics. I took the video with 12 Pro and loaded pixelbuffer from video output as a Metal or OpenGL texture. However, it looks brighter than what I saw in the camera roll. It seems to me that the CVMetalTextureCacheCreateTextureFromImage or CVOpenGLTextureCacheCreateTextureFromImage is not considering the CVImageBufferTransferFunction in pixelbuffer description inside. My pixel buffer has the following description. How can i handle HLG images? I think I need a color conversion process(like sRGB image), but I can't figure out the expression. <CVPixelBuffer 0x2827606e0 width=1920 height=1080 bytesPerRow=7680 pixelFormat=BGRA iosurface=0x281460f20 poolName=2922:decode_1 attributes={ &#9;&#9;PixelFormatDescription =&#9;&#9; { &#9;&#9;&#9;&#9;BitsPerBlock = 32; &#9;&#9;&#9;&#9;BitsPerComponent = 8; &#9;&#9;&#9;&#9;BlackBlock = {length = 4, bytes = 0x000000ff}; &#9;&#9;&#9;&#9;CGBitmapContextCompatibility = 1; &#9;&#9;&#9;&#9;CGBitmapInfo = 8196; &#9;&#9;&#9;&#9;CGImageCompatibility = 1; &#9;&#9;&#9;&#9;ComponentRange = FullRange; &#9;&#9;&#9;&#9;ContainsAlpha = 1; &#9;&#9;&#9;&#9;ContainsGrayscale = 0; &#9;&#9;&#9;&#9;ContainsRGB = 1; &#9;&#9;&#9;&#9;ContainsYCbCr = 0; &#9;&#9;&#9;&#9;FillExtendedPixelsCallback = {length = 24, bytes = 0x0000000000000000ac7430b3010000000000000000000000}; &#9;&#9;&#9;&#9;IOSurfaceCoreAnimationCompatibility = 1; &#9;&#9;&#9;&#9;IOSurfaceCoreAnimationCompatibilityHTPCOK = 1; &#9;&#9;&#9;&#9;IOSurfaceOpenGLESFBOCompatibility = 1; &#9;&#9;&#9;&#9;IOSurfaceOpenGLESTextureCompatibility = 1; &#9;&#9;&#9;&#9;OpenGLESCompatibility = 1; &#9;&#9;&#9;&#9;PixelFormat = 1111970369; &#9;&#9;}; } propagatedAttachments={ &#9;&#9;AlphaChannelIsOpaque = 1; &#9;&#9;CVFieldCount = 1; &#9;&#9;CVImageBufferChromaLocationBottomField = Left; &#9;&#9;CVImageBufferChromaLocationTopField = Left; &#9;&#9;CVImageBufferColorPrimaries = "ITU_R_2020"; &#9;&#9;CVImageBufferTransferFunction = "ITU_R_2100_HLG"; // HLG &#9;&#9;CVImageBufferYCbCrMatrix = "ITU_R_2020"; &#9;&#9;QTMovieTime =&#9;&#9; { &#9;&#9;&#9;&#9;TimeScale = 600; &#9;&#9;&#9;&#9;TimeValue = 810; &#9;&#9;}; } nonPropagatedAttachments={ }> Or would it be desirable to receive the HDE video as kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange rather than kCVPixelFormatType_32BGRA?
2
0
1.4k
Nov ’20