... | ... | @@ -68,12 +68,12 @@ Each filter in a filter chain, is described by the filter name, a render destina |
|
|
}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
|
|
|
In the above json example, the core image filter to be created is a Core Image Unsharp Mask filter. The filter is given the identifier "com.yvs.renderingfilterchain.example.unsharpmask" and the filter takes three inputs. These are the input radius, which takes a numeric value, input intensity which also takes a numeric value the input image which of course takes an image.
|
|
|
|
|
|
When an input is an image, then the input value is a way to identify the image and is a json object. The image can be sourced as the output image of a previous filter in the filter chain and if that was the case then the key in the object would be "mifiltername" and the value would be a string which is the name identifier. If the image is sourced from a bitmap context then the key in the object would be "objectreference" as in the above example which refers to a base object with reference 0. The image can also come from an image importer object in which case the "objectreference" key is also used but that a "imageindex" key should also be supplied specifying the index of the image in the image file. If "imageindex" is not specified and the object reference refers to an image importer object then "imageindex" defaults to 0.
|
|
|
When an input is an image, then the input value is a way to obtain the image and is a json object. The image can be sourced as the output image of a previous filter in the filter chain and if that was the case then the key in the object would be "mifiltername" and the value would be a string which is the name identifier. If the image is sourced from a bitmap context then the key in the object would be "objectreference" as in the above example which refers to a base object with reference 0. The image can also come from an image importer object in which case the "objectreference" key is also used but that a "imageindex" key should also be supplied specifying the index of the image in the image file. If "imageindex" is not specified and the object reference refers to an image importer object then "imageindex" defaults to 0.
|
|
|
|
|
|
When a filter takes a numeric input, it is not necessary to specify the "cifiltervalueclass" but for all other input types specifying the value class is required and in the above example "CIImage" is demonstrated. Other "cifiltervalueclass" keys are "CIVector", "CIColor", "NSString". In the case of both CIVector and CIColor the actual type for the key "cifiltervalue" is a string, the purpose of the "cifiltervalueclass" key is to inform Moving Images what object type the string needs to be converted into before it can be assigned to the filter.
|
|
|
When a filter takes a numeric input, then the "cifiltervalueclass" key is not needed but for all other input types specifying the value class is required and in the above example "CIImage" is demonstrated. Other "cifiltervalueclass" keys are "CIVector", "CIColor", "NSString". In the case of both CIVector and CIColor the type of the value for the key "cifiltervalue" is a string, the purpose of the "cifiltervalueclass" key is to inform Moving Images what object type the string needs to be converted into before it can be assigned to the filter.
|
|
|
|
|
|
In the following example the json object represents the information needed for creating a Core Image Radial Gradient filter. It demonstrates the defining of filter inputs with value class "CIVector" and "CIColor". The format of the strings defining these object needs to be kept to strictly. In this example the the centre of the radial gradient is specified as a coordinate pair of two numbers, x and y. For specifying a color the string format is slightly different with no square brackets. Each color is specified by 4 numbers representing the three color components and the alpha value: Red Green Blue Alpha. The input "inputColor0" is assigned a white opaque color while "inputColor1" is assigned a black opaque color.
|
|
|
|
... | ... | @@ -109,6 +109,8 @@ In the following example the json object represents the information needed for c |
|
|
|
|
|
### Chaining filters together
|
|
|
|
|
|
|
|
|
|
|
|
### Providing images from image importer and bitmap context objects
|
|
|
|
|
|
### Rendering an Image Filter Chain object
|
... | ... | |