简体   繁体   English

CIImageAccumulator是做什么的?

[英]What does CIImageAccumulator do?

Problem 问题

The apple documentation states when the CIImageAccumulater can be used, but unfortunately it does not say what it actually does. Apple文档说明了可以使用CIImageAccumulater时间,但不幸的是,它没有说明其实际作用。

The CIImageAccumulator class enables feedback-based image processing for such things as iterative painting operations or fluid dynamics simulations. CIImageAccumulator类可用于基于迭代的绘画操作或流体动力学仿真之类的基于反馈的图像处理。 You use CIImageAccumulator objects in conjunction with other Core Image classes, such as CIFilter, CIImage, CIVector, and CIContext, to take advantage of the built-in Core Image filters when processing images. 您可以将CIImageAccumulator对象与其他Core Image类(例如CIFilter,CIImage,CIVector和CIContext)结合使用,以在处理图像时利用内置的Core Image过滤器。

I have to fix code that used a CIImageAccumulator . 我必须修复使用CIImageAccumulator代码。 It seems to me that all it is meant to do, despite its name, is to return a CIImage with all CIFilter s applied to the image. 在我看来,尽CIFilter什么名字,但它要做的只是返回一个CIImage其中所有CIFilter应用于该图像。 Adding the first image however darkens the output. 但是添加第一张图像会使输出变暗。 That is not what I would expect from an accumulator nor from any other Operator that enables feedback based image processing. 这不是我希望从累加器或任何其他启用基于反馈的图像处理的运算符获得的期望。

Question

Can anyone answer what logic / algorithm is being used when setting and getting images in and out of the CIImageAccumulator 任何人都可以回答在设置图像到CIImageAccumulator中以及CIImageAccumulator取出图像时正在使用什么逻辑/算法。

The biggest advantage of the CIImageAccumulater is that stores its contents between different rendering steps (in contrast to CIFilter or CIImage ). CIImageAccumulater的最大优点是可以在不同的渲染步骤之间存储其内容(与CIFilterCIImage )。 This allows you to use the state of a previous rendering step, blend it with something new and store that result again in the accumulator. 这使您可以使用上一个渲染步骤的状态,将其与新内容混合,然后将结果再次存储在累加器中。

Apple's main use case is interactive painting: You retrieve the current image from the accumulator, blend a new stroke the user just painted with a gesture on top of it, and store the resulting image back into the accumulator. 苹果公司的主要用例是交互式绘画:您可以从累加器中检索当前图像,将用户刚刚绘制的新笔划与笔触混合在一起,然后将结果图像存储回累加器中。 Then you display the content of the accumulator. 然后显示累加器的内容。 You can read about it here . 你可以在这里阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM