Skip to content

putText1

Image processingfunctionOpenCV 5.0.0
import { putText1 } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSimg, text, org, color
FUNCTIONputText1
RETURN TYPEPoint
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Draws a text string using specified font.

The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. The function returns the coordinates in pixels from where the text can be continued.

putText1(img: Mat, text: EmbindString, org: Point, color: Scalar, fface: FontFace, size: number, weight: number, flags: number, wrap: Range): Point;
4 available overloads
putText1(img: Mat, text: EmbindString, org: Point, color: Scalar, fface: FontFace, size: number): Point;
putText1(img: Mat, text: EmbindString, org: Point, color: Scalar, fface: FontFace, size: number, weight: number): Point;
putText1(img: Mat, text: EmbindString, org: Point, color: Scalar, fface: FontFace, size: number, weight: number, flags: number): Point;
putText1(img: Mat, text: EmbindString, org: Point, color: Scalar, fface: FontFace, size: number, weight: number, flags: number, wrap: Range): Point;
img

Input/output value, modified by the native operation. Image.

text

Text string to be drawn.

org

Bottom-left corner of the first character of the printed text (see PUT_TEXT_ALIGN_... though)

color

Text color.

fface

The font to use for the text

size

Font size in pixels (by default) or pts

weight

Font weight, 100..1000, where 100 is "thin" font, 400 is "regular", 600 is "semibold", 800 is "bold" and beyond that is "black". The parameter is ignored if the font is not a variable font or if it does not provide variation along 'wght' axis. If the weight is 0, then the weight, currently set via setInstance(), is used.

flags

Various flags, see PUT_TEXT_...

wrap

The optional text wrapping range: In the case of left-to-right (LTR) text if the printed character would cross wrap.end boundary, the "cursor" is set to wrap.start. In the case of right-to-left (RTL) text it's vice versa. If the parameters is not set, [org.x, img.cols] is used for LTR text and [0, org.x] is for RTL one.

Returns

The Point result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.