Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 我需要在mac应用程序中从一个图像中删除标记的对象。有什么办法可以这样做吗?_Macos_Cocoa - Fatal编程技术网

Macos 我需要在mac应用程序中从一个图像中删除标记的对象。有什么办法可以这样做吗?

Macos 我需要在mac应用程序中从一个图像中删除标记的对象。有什么办法可以这样做吗?,macos,cocoa,Macos,Cocoa,我需要在mac应用程序中从一个图像中删除标记的对象。我们可以用画笔标记图像中的对象。因此,在应用擦除效果后,应移除选定对象,并用匹配的背景填充该空间。有人能帮上忙吗?您可以使用核心图像过滤器。这是 要删除,需要使用CISOURCEOUTCOMPING 示例: CIImage *yourBgImage = ... //from what image You want to cut CIImage *markedObject = ... //Your painted image CIFilter

我需要在mac应用程序中从一个图像中删除标记的对象。我们可以用画笔标记图像中的对象。因此,在应用擦除效果后,应移除选定对象,并用匹配的背景填充该空间。有人能帮上忙吗?

您可以使用核心图像过滤器。这是

要删除,需要使用CISOURCEOUTCOMPING

示例:

CIImage *yourBgImage = ... //from what image You want to cut
CIImage *markedObject = ... //Your painted image

CIFilter *sourceOut = [CIFilter filterWithName: @"CISourceOutCompositing"];
[sourceOut setValue: markedObject forKey: @"inputImage"];
[sourceOut setValue: yourBgImage forKey: @"inputBackgroundImage"];

CIImage *result = [sourceOut valueForKey: @"outputImage"];

结果是您的输出图像,即已擦除的图像。

@JobinJose我添加了示例。希望能有帮助。祝你好运