Center vector of CIFilter

戏子无情 提交于 2019-12-13 07:35:34

问题


I'm having a hard time understanding the meaning of the center vector used by many different CIFilters.

Let's take CIRadialGradient for example, what does the inputCenter mean? What's its values range? How does its coordinate system behave etc.


回答1:


As Brian said, it's just a type that encodes a position where the effect is centered. HOWEVER, CoreImage coordinates are inverted on the Y-axis from what you're used to using on iOS: The 0,0 point is the lower-left corner and the y value increases as you move toward the top of the screen.




回答2:


The inputCenter for that CIFilter is the center of the two concentric circles. So it is a point in your view/image. The default value is [150 150], so I imagine that acceptable values can be any values in the view plane (positive or negative).

Some rudimentary info is here: https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIRadialGradient



来源:https://stackoverflow.com/questions/27390595/center-vector-of-cifilter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!