【发布时间】:2017-02-14 11:16:26
【问题描述】:
我正在寻找一种使用 Core Image 添加实心边框的方法。我已经实现了自定义相机来拍摄矩形文档的照片。现在我得到了四个坐标文件,但是在 CIImage 上绘制边框的问题。请帮帮我。
CIImage *overlay = [CIImage imageWithColor:[CIColor colorWithRed:0 green:1 blue:0 alpha:0.6]];
overlay = [overlay imageByCroppingToRect:image.extent];
overlay = [overlay imageByApplyingFilter:@"CIPerspectiveTransformWithExtent" withInputParameters:@{@"inputExtent":[CIVector vectorWithCGRect:image.extent],@"inputTopLeft":[CIVector vectorWithCGPoint:topLeft],@"inputTopRight":[CIVector vectorWithCGPoint:topRight],@"inputBottomLeft":[CIVector vectorWithCGPoint:bottomLeft],@"inputBottomRight":[CIVector vectorWithCGPoint:bottomRight]}];
return [overlay imageByCompositingOverImage:image];
【问题讨论】:
-
听起来像这样stackoverflow.com/questions/11278647/…点击这个链接。
标签: ios objective-c core-image ciimage