Skip to content

Commit

Permalink
fix: add 48 and 24 bit image cases for getBitmapInfo() (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed Feb 1, 2023
1 parent fe65532 commit 63242ac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/Mantis/Extensions/CGImageExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,18 @@ extension CGImage {
switch(bitsPerPixel, bitsPerComponent) {
case (16, 5):
return CGImageAlphaInfo.noneSkipFirst.rawValue
case (32, 8):
case (24, 8), (32, 8), (48, 16), (64, 16):
return CGImageAlphaInfo.premultipliedLast.rawValue
case (32, 10):
if #available(iOS 12, macOS 10.14, *) {
return CGImageAlphaInfo.alphaOnly.rawValue | CGImagePixelFormatInfo.RGBCIF10.rawValue
} else {
return bitmapInfo.rawValue
}
case (64, 16):
return CGImageAlphaInfo.premultipliedLast.rawValue
case (128, 32):
return CGImageAlphaInfo.premultipliedLast.rawValue | CGBitmapInfo.floatComponents.rawValue
default:
return bitmapInfo.rawValue
break
}
}

Expand Down

0 comments on commit 63242ac

Please sign in to comment.