Skip to content

Commit 9934165

Browse files
committed
Expose api for canvas resize
1 parent 70a9f59 commit 9934165

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mediapipe/tasks/web/core/task_runner.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ export abstract class TaskRunner {
118118
/** Configures the task with custom options. */
119119
abstract setOptions(options: TaskRunnerOptions): Promise<void>;
120120

121+
/** Config graph for auto-resizing canvas. */
122+
abstract setAutoResizeCanvas(isAutoResizeCanvas: boolean): void;
123+
121124
/**
122125
* Applies the current set of options, including optionally any base options
123126
* that have not been processed by the task implementation. The options are

mediapipe/tasks/web/vision/core/vision_task_runner.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ export abstract class VisionTaskRunner extends TaskRunner {
8282
super(graphRunner);
8383
}
8484

85+
override setAutoResizeCanvas(
86+
isAutoResizeCanvas: boolean): void {
87+
this.graphRunner.setAutoResizeCanvas(isAutoResizeCanvas);
88+
}
89+
8590
/**
8691
* Configures the shared options of a vision task.
8792
*

0 commit comments

Comments
 (0)