core-image

CIFilter with CIQRCodeGenerator cause crash

强颜欢笑 提交于 2020-08-10 19:52:07
问题 I'm trying to generate QR code with following code : DispatchQueue.main.async { let image = generateQRCode(from: qrCodeString) } func generateQRCode(from string: String?) -> UIImage? { if let data = string?.data(using: .utf8, allowLossyConversion: false) { if let filter = CIFilter(name: "CIQRCodeGenerator") { filter.setValue(data, forKey: "inputMessage") let transform = CGAffineTransform(scaleX: 5, y: 5) if let output = filter.outputImage?.transformed(by: transform) { return UIImage(ciImage:

CoreImage coordinate system

若如初见. 提交于 2020-08-04 10:54:09
问题 I have CVPixelBufferRef from an AVAsset . I'm trying to apply a CIFilter to it. I use these lines: CVPixelBufferRef pixelBuffer = ... CVPixelBufferRef newPixelBuffer = // empty pixel buffer to fill CIContex *context = // CIContext created from EAGLContext CGAffineTransform preferredTransform = // AVAsset track preferred transform CIImage *phase1 = [CIImage imageWithCVPixelBuffer:pixelBuffer]; CIImage *phase2 = [phase1 imageByApplyingTransform:preferredTransform]; CIImage *phase3 = [self

CoreImage coordinate system

╄→гoц情女王★ 提交于 2020-08-04 10:53:12
问题 I have CVPixelBufferRef from an AVAsset . I'm trying to apply a CIFilter to it. I use these lines: CVPixelBufferRef pixelBuffer = ... CVPixelBufferRef newPixelBuffer = // empty pixel buffer to fill CIContex *context = // CIContext created from EAGLContext CGAffineTransform preferredTransform = // AVAsset track preferred transform CIImage *phase1 = [CIImage imageWithCVPixelBuffer:pixelBuffer]; CIImage *phase2 = [phase1 imageByApplyingTransform:preferredTransform]; CIImage *phase3 = [self

CoreImage coordinate system

微笑、不失礼 提交于 2020-08-04 10:53:04
问题 I have CVPixelBufferRef from an AVAsset . I'm trying to apply a CIFilter to it. I use these lines: CVPixelBufferRef pixelBuffer = ... CVPixelBufferRef newPixelBuffer = // empty pixel buffer to fill CIContex *context = // CIContext created from EAGLContext CGAffineTransform preferredTransform = // AVAsset track preferred transform CIImage *phase1 = [CIImage imageWithCVPixelBuffer:pixelBuffer]; CIImage *phase2 = [phase1 imageByApplyingTransform:preferredTransform]; CIImage *phase3 = [self

Using CoreImage to filter an image results in image rotation

岁酱吖の 提交于 2020-01-19 10:13:16
问题 Thanks for reading. I'm trying to use CoreImage in iOS 5 to alter the appearance of an image. The problem is that the existing image appears to lose its orientation information during the process and ends up rotated by 90 degrees. Here is the code: CIContext *context = [CIContext contextWithOptions:nil]; CIImage *img = [CIImage imageWithCGImage:imageView.image.CGImage]; CIFilter *adjustFilter = [CIFilter filterWithName:@"CIHighlightShadowAdjust"]; [adjustFilter setDefaults]; [adjustFilter

Using CoreImage to filter an image results in image rotation

梦想与她 提交于 2020-01-19 10:06:38
问题 Thanks for reading. I'm trying to use CoreImage in iOS 5 to alter the appearance of an image. The problem is that the existing image appears to lose its orientation information during the process and ends up rotated by 90 degrees. Here is the code: CIContext *context = [CIContext contextWithOptions:nil]; CIImage *img = [CIImage imageWithCGImage:imageView.image.CGImage]; CIFilter *adjustFilter = [CIFilter filterWithName:@"CIHighlightShadowAdjust"]; [adjustFilter setDefaults]; [adjustFilter

Using CoreImage to filter an image results in image rotation

烈酒焚心 提交于 2020-01-19 10:05:59
问题 Thanks for reading. I'm trying to use CoreImage in iOS 5 to alter the appearance of an image. The problem is that the existing image appears to lose its orientation information during the process and ends up rotated by 90 degrees. Here is the code: CIContext *context = [CIContext contextWithOptions:nil]; CIImage *img = [CIImage imageWithCGImage:imageView.image.CGImage]; CIFilter *adjustFilter = [CIFilter filterWithName:@"CIHighlightShadowAdjust"]; [adjustFilter setDefaults]; [adjustFilter

GPUImage masking transparency

旧时模样 提交于 2020-01-16 04:42:10
问题 I'm using GPUImage framework of Brad Larson in my app and I need to make a mask of mask.jpg and photo. So mask images are two colors images with black background and white geometric figure. So basically masking is working, the problem is that I can't make the transparency of mask. To make that I need to replace the black color of mask.png to lighter color (more gray to white). So I tried to use code from here Want to change a particular color inside an image with another color - iPhone But it