I am looking for a code sample of this Core Image filter for iOS. Those filters with the inputImage in the parameter, I can figure out how to implement. But the ones without the inputImage parameter, I am not sure how it works.
Here is the extract from Apple’s doc:
CIGaussianGradient
Generates a gradient that varies from one color to another using a Gaussian distribution.
Parameters
inputCenter
A CIVector class whose attribute type is CIAttributeTypePosition and whose display name is Center.
Default value: [150 150] Identity: (null)
inputColor0
A CIColor class whose display name is Color 1.
inputColor1
A CIColor class whose display name is Color 2.
inputRadius
An NSNumber class whose attribute type is CIAttributeTypeDistance and whose display name is Radius.
Default value: 300.00 Minimum: 0.00 Maximum: 0.00 Slider minimum: 0.00 Slider maximum: 800.00 Identity: 300.00
This should get you started… though I’m not sure why this produces a magenta over white gradient in iOS, while it produces a magenta over black gradient in Quartz Composer. (if you haven’t used Quartz Composer, it’s included with Apple’s dev tools and is great for testing out Core Image filters)
To do anything useful with it, I believe you have to crop it afterwards – otherwise it will have infinite dimensions (according to Quartz Composer).