4D v16

SVG_Filter_Blur

Home

 
4D v16
SVG_Filter_Blur

SVG_Filter_Blur 


 

SVG_Filter_Blur ( filterRef ; deviation {; input {; Auswahlname}} ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
filterRef  SVG_Ref in Reference of filter
deviation  Zahl in Standard deviation for blur operation
input  String in Source of filter primitive
Auswahlname  String in Target of filter primitive
Funktionsergebnis  SVG_Ref in Reference of primitive

The SVG_Filter_Blur command sets a Gaussian blur for the filterRef filter and returns its reference. If filterRef is not a filter reference, an error is generated.

The deviation parameter can be used to set the standard deviation for the blur operation. If the number is an integer, the same deviation will be applied to the X and Y axes. If the number includes a decimal part, the integer part represents the deviation to be applied to the X axis and the decimal part represents the deviation to be applied to the Y axis.

The optional input parameter identifies the graphic source of the filter primitive. You can pass:

  • either "sourceGraphic", indicating that the graphic is the filter source (default),
  • or "sourceAlpha", which indicates that the alpha channel is the filter source.

The optional name parameter is the name, if any, assigned to the result of this filter primitive.

Note: Starting with 4D v14 R5, this command works under Windows with Direct2D enabled in software mode (see the Direct2D software constant in the description of the SET DATABASE PARAMETER command).

In a form, we display two identical SVG pictures then we create a "blur" filter and assign to the one on the right:

 $root:=SVG_New(400;400;"filters test") //definition of first (left) picture
 $rect:=SVG_New_rect($root;10;10;380;100;0;0;"darkblue";"white";1)
 SVG_SET_FILL_BRUSH($root;"orange")
 $textAreaRef:=SVG_New_textArea($root;"Hello World!";10;10;380;100;"arial";60;Normal;Align center)
 <>pict1:=SVG_Export_to_picture($root//display first picture
 
 $root2:=SVG_New(400;400;"filters test") //definition of identical (right) picture
 
  //create filter
 $filter1:=SVG_Define_filter($root2;"blur")
  // filter definition
 $vGraph:=True //applied on graphic layer - pass False to apply to the alpha layer
 If($vGraph)
    SVG_Filter_Blur($filter1;Deviation{Deviation};"sourceGraphic")
 Else
    SVG_Filter_Blur($filter1;Deviation{Deviation};"sourceAlpha")
 End if
 
 $rect2:=SVG_New_rect($root2;10;10;380;100;0;0;"darkblue";"white";1) //definition of identical (right) picture
 SVG_SET_FILL_BRUSH($root2;"orange")
 $textAreaRef2:=SVG_New_textArea($root2;"Hello World!";10;10;380;100;"arial";60;Normal;Align center)
 
 SVG_SET_FILTER($textAreaRef2;"blur") //apply filter
 <>pict2:=SVG_Export_to_picture($root2//display second picture

Result (input = sourceGraphic):

Result (input = sourceAlpha):



Siehe auch 

SVG_Filter_Blend
SVG_Filter_Offset

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Filters
Nummer: 65922

spezifisches Verhalten unter Windows

 
GESCHICHTE 

Erstellt: Composant 4D SVG v11.3
Geändert: 4D v14 R5

 
ARTIKELVERWENDUNG

4D SVG ( 4D v16)