Skip to content

Commit

Permalink
Update MetalImageView (#115)
Browse files Browse the repository at this point in the history
* Patch

* disable log
  • Loading branch information
muukii authored Apr 7, 2021
1 parent ac5a3bd commit e8d69ab
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ open class MetalImageView: MTKView, CIImageDisplaying, MTKViewDelegate {
#if targetEnvironment(simulator)
#else
/// For supporting wide-color - extended sRGB
// colorPixelFormat = .bgra10_xr_srgb
// colorPixelFormat = .bgra10_xr
#endif

}

public required init(
Expand Down Expand Up @@ -144,12 +145,14 @@ open class MetalImageView: MTKView, CIImageDisplaying, MTKViewDelegate {
commandEncoder.endEncoding()
}

EditorLog.debug(.imageView, "ColorSpace => \(processedImage.colorSpace as Any)")

ciContext.render(
processedImage,
to: targetTexture,
commandBuffer: commandBuffer,
bounds: bounds,
colorSpace: defaultColorSpace
colorSpace: processedImage.colorSpace ?? defaultColorSpace
)

commandBuffer.present(drawable)
Expand Down

0 comments on commit e8d69ab

Please sign in to comment.