本文へスキップ

onCanvasSizeChange()

onCanvasSizeChange: ({ GLctx, computeCtx, videoWidth, videoHeight, canvasWidth, canvasHeight })

説明

onCanvasSizeChange()はキャンバスのサイズが変わったときに呼ばれる。 ビデオとキャンバスの寸法で呼び出される。

パラメータ

パラメータ説明
GLctx描画キャンバスの WebGLRenderingContext または WebGL2RenderingContext.
computeCtxコンピュートキャンバスの WebGLRenderingContext または WebGL2RenderingContext.
videoWidthカメラフィードの幅(ピクセル単位)。
videoHeightカメラフィードの高さ(ピクセル単位)。
canvasWidthGLctx キャンバスの幅をピクセル単位で指定する。
canvasHeightGLctx キャンバスの高さをピクセル単位で指定する。

XR8.addCameraPipelineModule({
name: 'mycamerapipelinemodule',
onCanvasSizeChange: ({ GLctx, videoWidth, videoHeight, canvasWidth, canvasHeight }) => {
myHandleResize({ GLctx, videoWidth, videoHeight, canvasWidth, canvasHeight })
},
})