TransformerBuilder
Lens Studio v3.0+
Inherits from ScriptObject
Description
Builds Transformer objects for MLComponent.
Methods
build()
: Transformer
Builds and returns a Transformer object based on the current settings.
setFillColor(vec4 color)
: TransformerBuilder
Sets the fill value used.
setFlipX(Boolean value)
: TransformerBuilder
Enables or disables horizontal flipping.
setFlipY(Boolean value)
: TransformerBuilder
Enables or disables vertical flipping.
setHorizontalAlignment(HorizontalAlignment mode)
: TransformerBuilder
Sets the horizontal alignment type used.
setRotation(TransformerRotation mode)
: TransformerBuilder
Sets the rotation type used.
setStretch(Boolean value)
: TransformerBuilder
Sets the stretching type used.
setVerticalAlignment(VerticalAlignment mode)
: TransformerBuilder
Sets the vertical alignment type used.
Inherited Methods
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Examples
var transformer = MachineLearning.createTransformerBuilder()
.setVerticalAlignment(VerticalAlignment.Center)
.setHorizontalAlignment(HorizontalAlignment.Center)
.setRotation(TransformerRotation.Rotate180)
.setFillColor(new vec4(0, 0, 0, 1))
.build();
var outputBuilder = MachineLearning.createOutputBuilder();
outputBuilder.setName("probs");
outputBuilder.setShape(new vec3(1, 1, 200));
outputBuilder.setOutputMode(MachineLearning.OutputMode.Data);
outputBuilder.setTransformer(transformer);
var outputPlaceholder = outputBuilder.build();
Still Looking for help?
Visit Support