... | ... | @@ -331,7 +331,51 @@ 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"}]}'
|
|
|
|
|
|
XXXX need to add info about specifying the source and destination rectangles.
|
|
|
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.
|
|
|
|
|
|
{
|
|
|
"cifilterproperties": [
|
|
|
{
|
|
|
"cifilterkey": "inputScale",
|
|
|
"cifiltervalue": -0.03038950130322813,
|
|
|
"mifiltername": "bumpdistortion"
|
|
|
}
|
|
|
],
|
|
|
"sourcerectangle": {
|
|
|
"origin": {
|
|
|
"x": 0,
|
|
|
"y": 0
|
|
|
},
|
|
|
"size": {
|
|
|
"width": 454,
|
|
|
"height": 341
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
If the destination rectangle is not specified, then the rectangle drawn to is the dimensions of the destination object. If we have created a bitmap context with width 1000 pixels and height 800 pixels then the rendering of the image filter chain will be drawn to fill the bitmap context. This can be overridden by specifying the destination rectangle. For example to render only to the right half of a bitmap context then our json object would look like:
|
|
|
|
|
|
{
|
|
|
"cifilterproperties": [
|
|
|
{
|
|
|
"cifilterkey": "inputScale",
|
|
|
"cifiltervalue": -0.03038950130322813,
|
|
|
"mifiltername": "bumpdistortion"
|
|
|
}
|
|
|
],
|
|
|
"destinationrectangle": {
|
|
|
"origin": {
|
|
|
"x": 500,
|
|
|
"y": 0
|
|
|
},
|
|
|
"size": {
|
|
|
"width": 500,
|
|
|
"height": 800
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### The Image Filter Chain ruby processing scripts
|
|
|
|
... | ... | |