triangleRasterizeColor
import { triangleRasterizeColor } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Overloaded version of triangleRasterize() with color-only rendering
triangleRasterizeColor(vertices: Mat, indices: Mat, colors: Mat, colorBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number, settings: TriangleRasterizeSettings): void;2 available overloads
triangleRasterizeColor(vertices: Mat, indices: Mat, colors: Mat, colorBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number): void;triangleRasterizeColor(vertices: Mat, indices: Mat, colors: Mat, colorBuf: Mat, world2cam: Mat, fovY: number, zNear: number, zFar: number, settings: TriangleRasterizeSettings): void;verticesvertices coordinates array. Should contain values of CV_32FC3 type or a compatible one (e.g. cv::Vec3f, etc.)
indicestriangle vertices index array, 3 per triangle. Each index indicates a vertex in a vertices array. Should contain CV_32SC3 values or compatible
colorsper-vertex colors of CV_32FC3 type or compatible. Can be empty or the same size as vertices array. If the values are out of [0; 1] range, the result correctness is not guaranteed
colorBufInput/output value, modified by the native operation. an array representing the final rendered image. Should containt CV_32FC3 values and be the same size as depthBuf. Not cleared before rendering, i.e. the content is reused as there is some pre-rendered scene.
world2cama 4x3 or 4x4 float or double matrix containing inverted (sic!) camera pose
fovYfield of view in vertical direction, given in radians
zNearminimum Z value to render, everything closer is clipped
zFarmaximum Z value to render, everything farther is clipped
settingssee TriangleRasterizeSettings. By default the smooth shading is on, with CW culling and with disabled GL compatibility
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.