mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Camera and editor improvements
This commit is contained in:
@@ -566,7 +566,7 @@ public class DrawingContext {
|
||||
f(self.context)
|
||||
}
|
||||
|
||||
public init?(size: CGSize, scale: CGFloat = 0.0, opaque: Bool = false, clear: Bool = false, bytesPerRow: Int? = nil) {
|
||||
public init?(size: CGSize, scale: CGFloat = 0.0, opaque: Bool = false, clear: Bool = false, bytesPerRow: Int? = nil, colorSpace: CGColorSpace? = nil) {
|
||||
if size.width <= 0.0 || size.height <= 0.0 {
|
||||
return nil
|
||||
}
|
||||
@@ -601,7 +601,7 @@ public class DrawingContext {
|
||||
height: Int(self.scaledSize.height),
|
||||
bitsPerComponent: DeviceGraphicsContextSettings.shared.bitsPerComponent,
|
||||
bytesPerRow: self.bytesPerRow,
|
||||
space: DeviceGraphicsContextSettings.shared.colorSpace,
|
||||
space: colorSpace ?? DeviceGraphicsContextSettings.shared.colorSpace,
|
||||
bitmapInfo: self.bitmapInfo.rawValue,
|
||||
releaseCallback: nil,
|
||||
releaseInfo: nil
|
||||
@@ -616,7 +616,7 @@ public class DrawingContext {
|
||||
}
|
||||
}
|
||||
|
||||
public func generateImage() -> UIImage? {
|
||||
public func generateImage(colorSpace: CGColorSpace? = nil) -> UIImage? {
|
||||
if self.scaledSize.width.isZero || self.scaledSize.height.isZero {
|
||||
return nil
|
||||
}
|
||||
@@ -633,7 +633,7 @@ public class DrawingContext {
|
||||
bitsPerComponent: self.context.bitsPerComponent,
|
||||
bitsPerPixel: self.context.bitsPerPixel,
|
||||
bytesPerRow: self.context.bytesPerRow,
|
||||
space: DeviceGraphicsContextSettings.shared.colorSpace,
|
||||
space: colorSpace ?? DeviceGraphicsContextSettings.shared.colorSpace,
|
||||
bitmapInfo: self.context.bitmapInfo,
|
||||
provider: dataProvider,
|
||||
decode: nil,
|
||||
|
||||
Reference in New Issue
Block a user