... | ... | @@ -285,6 +285,8 @@ If the base object reference identifies a "imageimporter" object or if the "obje |
|
|
|
|
|
### Rendering an Image Filter Chain object
|
|
|
|
|
|
#### Render Destination
|
|
|
|
|
|
At present the only object type that can be a render destination is the object type "bitmapcontext". This will change. The rendering destination is specified as a plist dictionary/JSON object. This object can be defined in one of two ways, by specifying a value for the key "objectreference" which is a reference to the base object that is the destination for the image filter chain render, or by setting the value for the key "objecttype" which for now will be "bitmapcontext" and setting the value for the key "objectname" which is the name given to the base object when it was created. There will be more values for the key "objecttype" than "bitmapcontext" in the future, do not assume that this value will remain invariant.
|
|
|
|
|
|
Render destination example 1:
|
... | ... | @@ -314,7 +316,10 @@ Render destination example 2: |
|
|
]
|
|
|
}
|
|
|
|
|
|
The render destination is specified as part of the creation of the image filter chain base object.
|
|
|
The render destination is specified as part of the creation of the image filter chain base object.
|
|
|
|
|
|
#### Modifying filter properties when rendering
|
|
|
|
|
|
At render time you can specify filter properties for different filters to modify their values in the "-renderfilterchain" smig "doaction". The render filter chain command can take a json object which has at a minimum a "cifilterproperties" key. The value for this key is an array of objects, each object contains three members. The "mifiltername" key which identifies the filter in the filter chain which has a property whose value you want to change. The other two members have keys "cifilterkey" and "cifiltervalue". The "cifilterkey" specifies the property key of the attribute of the filter you want to change, and the "cifiltervalue" which is the value that you want to assign to the filter property.
|
|
|
|
|
|
{
|
... | ... | @@ -331,6 +336,8 @@ The following demonstrates rendering the filter chain after updating the "inputS |
|
|
|
|
|
smig doaction -renderfilterchain -object 3 -jsonstring '{"cifilterproperties":[{"cifilterkey":"inputScale","cifiltervalue":-0.0304,"mifiltername":"bumpdistortion"}]}'
|
|
|
|
|
|
#### Setting the source and destination rectangles when rendering
|
|
|
|
|
|
When the filter chain is rendered to the destination then a source and destination rectangle can be specified but both are optional. If the source rectangle is not specified then the render command will be the extent of the of the output image of the image filter chain. This may not be the source rectangle that you want, for instance the blur filters extend the bounds of the image by the size of blur in each direction and you are likely not to want the extended bounds. Instead you can supply the source rectangle which is likely to be the rectangle of the input image for the filter.
|
|
|
|
|
|
The following example supplies a source rectangle which is the dimensions of the input image.
|
... | ... | |