Skip to content

Commit

Permalink
Add premultipliedLast BitmapInfo to allow transparent background
Browse files Browse the repository at this point in the history
  • Loading branch information
manc1 committed Mar 27, 2017
1 parent 8c3bdee commit d0dbf3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/Source/Mac/PictureOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class PictureOutput: ImageConsumer {
guard let dataProvider = CGDataProvider(dataInfo: nil, data: data, size: imageByteSize, releaseData: dataProviderReleaseCallback) else {fatalError("Could not create CGDataProvider")}
let defaultRGBColorSpace = CGColorSpaceCreateDeviceRGB()

return CGImage(width: Int(framebuffer.size.width), height: Int(framebuffer.size.height), bitsPerComponent:8, bitsPerPixel:32, bytesPerRow:4 * Int(framebuffer.size.width), space:defaultRGBColorSpace, bitmapInfo:CGBitmapInfo() /*| CGImageAlphaInfo.Last*/, provider:dataProvider, decode:nil, shouldInterpolate:false, intent:.defaultIntent)!
return CGImage(width: Int(framebuffer.size.width), height: Int(framebuffer.size.height), bitsPerComponent:8, bitsPerPixel:32, bytesPerRow:4 * Int(framebuffer.size.width), space:defaultRGBColorSpace, bitmapInfo:CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue), provider:dataProvider, decode:nil, shouldInterpolate:false, intent:.defaultIntent)!
}

public func newFramebufferAvailable(_ framebuffer:Framebuffer, fromSourceIndex:UInt) {
Expand Down

0 comments on commit d0dbf3b

Please sign in to comment.