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.
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.
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.
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
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.
© 2022 - 2024 — McMap. All rights reserved.