Center vector of CIFilter
Asked Answered
P

2

0

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.

Phenomenalism answered 9/12, 2014 at 23:11 Comment(0)
D
0

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.

Dixson answered 10/12, 2014 at 1:57 Comment(4)
So what's the meaning of it in CIPixellate filter?Phenomenalism
It adjusts the offset of the pixel grid from the source image, which can have a major effect on the outcome, particularly for large pixel sizes.Dixson
Can you please further explain the effect in CIPixellate filter? "offset of the pixel grid from the source image" - what does it mean?Phenomenalism
It changes the sample point for each pixel in the grid, which results in a somewhat different output.Dixson
P
0

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

Palladio answered 10/12, 2014 at 0:13 Comment(4)
So what's the meaning of it in CIPixellate filter?Phenomenalism
Thats a good question! It seems like it is unnecessary for CIPixellate, at least to me, since the pixilation is more like a general matrix filter and just processes the entire image plane.Palladio
The pixel mosaic doesn't need to line up perfectly with the boundaries of the source image (which happens when the height and width are not both a multiple of the pixel size).Dixson
@BrianTrzupek it definitely affects the placement of the pixelations, how is unclear and undocumented though.Bridoon
D
0

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.

Dixson answered 10/12, 2014 at 1:57 Comment(4)
So what's the meaning of it in CIPixellate filter?Phenomenalism
It adjusts the offset of the pixel grid from the source image, which can have a major effect on the outcome, particularly for large pixel sizes.Dixson
Can you please further explain the effect in CIPixellate filter? "offset of the pixel grid from the source image" - what does it mean?Phenomenalism
It changes the sample point for each pixel in the grid, which results in a somewhat different output.Dixson

© 2022 - 2024 — McMap. All rights reserved.