Wrapper class for images, colors or texts that provides extra informations for detection (mask, scale, rotate, grayscale, threshold,...)
Instance of this class can only be created via TemplateBuilder.build() methods.
static TemplateBuilder image(value: string)
Return a builder for building image template.
Parameters | |
value | The template's value |
Return | |
TemplateBuilder | TemplateBuilder |
static TemplateBuilder color(value: string)
Return a builder for building color template.
Parameters | |
value | The template's value |
Return | |
TemplateBuilder | TemplateBuilder |
static TemplateBuilder text(value: string)
Return a builder for building text template.
Parameters | |
value | The template's value |
Return | |
TemplateBuilder | TemplateBuilder |
static void setDefaultScale(scale: number)
Set the default scale value that all builder is created with.
Parameters | |
scale | The default scale value. |
static void setDefaultScaleX(scale: number)
Set the default scale x value that all builder is created with.
Parameters | |
scale | The default scale value. |
static void setDefaultScaleY(scale: number)
Set the default scale y value that all builder is created with.
Parameters | |
scale | The default scale value. |
number getW()
Get the width of the template. Might be null if template is not found or this is a text template. Make sure to scale the value if you're gonna use it.
Return | |
number | The template width |
number getH()
Get the height of the template. Might be null if template is not found or this is a text template. Make sure to scale the value if you're gonna use it.
Return | |
number | The template height |
Template load(reload: bool)
Eager load the template into cache. This is done automatically if you do any detection on it.
Parameters | |
reload | true to force reload the template even if it already exists in Cache |
Return | |
Template | This Template instance |
Template clear()
Clear the template from Cache.
Return | |
Template | This Template instance |
TemplateBuilder mutate()
Return a new builder instance with all of this template properties set.
Return | |
TemplateBuilder | TemplateBuilder |
© 2024 - Macrorify by KoK-CODE