Skip to content
Brief update of documentation for variables. authored by Kevin Meaney's avatar Kevin Meaney
...@@ -692,6 +692,7 @@ When rendering the filter chain the position and dimensions of the source and de ...@@ -692,6 +692,7 @@ When rendering the filter chain the position and dimensions of the source and de
This partial ruby code snippet demonstrates how to use equations and apply variables in the rendering filter chain command: This partial ruby code snippet demonstrates how to use equations and apply variables in the rendering filter chain command:
```ruby ```ruby
theCommands = SmigCommands.new
filterchain_object = SmigIDHash.make_objectid(objecttype: :imagefilterchain, filterchain_object = SmigIDHash.make_objectid(objecttype: :imagefilterchain,
objectname: 'documentation.imagefilterchain.emboss') objectname: 'documentation.imagefilterchain.emboss')
filterchain_render = MIFilterChainRender.new filterchain_render = MIFilterChainRender.new
...@@ -707,9 +708,10 @@ filterchain_render.add_filterproperty(crop_property) ...@@ -707,9 +708,10 @@ filterchain_render.add_filterproperty(crop_property)
the_variables = { bumpvalue: Random.rand, leftedge: Random.rand * 100.0, the_variables = { bumpvalue: Random.rand, leftedge: Random.rand * 100.0,
bottomedge: Random.rand * 100.0, width: Random.rand * 200.0, bottomedge: Random.rand * 100.0, width: Random.rand * 200.0,
height: Random.rand * 150.0 } height: Random.rand * 150.0 }
filterchain_render.variables = the_variables
render_filterchain_command = CommandModule.make_renderfilterchain(filterchain_object, render_filterchain_command = CommandModule.make_renderfilterchain(filterchain_object,
renderinstructions: filterchain_render) renderinstructions: filterchain_render)
theCommands.add_command(render_filterchain_command)
theCommands.variables = the_variables
puts JSON.pretty_generate(render_filterchain_command.commandhash) puts JSON.pretty_generate(render_filterchain_command.commandhash)
``` ```
... ...
......