putText method
void
putText(})
Draws a text string. The function putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by "Tofu" or non-drawn.
img
Image. (Only 8UC1/8UC3/8UC4 2D mat is supported.)
text
Text string to be drawn.
org
Bottom-left/Top-left corner of the text string in the image.
fontHeight
Drawing font size by pixel unit.
color
Text color.
thickness
Thickness of the lines used to draw a text when negative, the glyph is filled. Otherwise, the glyph is drawn with this thickness.
lineType
Line type. See the line for details.
bottomLeftOrigin
When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.
Implementation
void putText(
InputOutputArray img,
String text,
Point org,
int fontHeight,
Scalar color, {
int thickness = 1,
int lineType = LINE_8,
bool bottomLeftOrigin = false,
}) {
final ctext = text.toNativeUtf8().cast<ffi.Char>();
cvRun(
() => ccontrib.cv_freetype_FreeType2_putText(
ref,
img.ref,
ctext,
org.ref,
fontHeight,
color.ref,
thickness,
lineType,
bottomLeftOrigin,
ffi.nullptr,
),
);
calloc.free(ctext);
}