跳到主要内容

📖 API 参考

导入

import MaskSegmentCanvas, {
type MaskSegmentCanvasRef,
type MaskSegmentCanvasProps,
type MaskSegmentSession,
type MaskSegmentWatchState,
type MaskSegmentWatchDetail,
type BgrColor,
type MaskSemanticColor,
type PaintCallbackPayload,
type PaintedRegionRecord,
type PipelineConfig,
type MaskSegmentConfig,
type PaintConfig,
type InteractionConfig,
type SavePaintResult,
type LassoPolygon,
type ManualWallPartition,
MASK_SEMANTIC_COLORS,
BASEBOARD_SEMANTIC_NAME,
prewarmPngBgrCacheAsync,
DEFAULT_PIPELINE_CONFIG,
DEFAULT_MASK_CONFIG,
DEFAULT_PAINT_CONFIG,
DEFAULT_INTERACTION_CONFIG,
} from 'react-native-mask-segment-canvas';
分类名称
组件MaskSegmentCanvas(默认导出)
Ref / Props 类型MaskSegmentCanvasRef, MaskSegmentCanvasProps
会话 / 回调类型MaskSegmentSession, PaintCallbackPayload, PaintedRegionRecord, SavePaintResult
套索类型LassoPolygon, ManualWallPartition
Watch 类型MaskSegmentWatchState, MaskSegmentWatchDetail
配置类型PipelineConfig, MaskSegmentConfig, PaintConfig, InteractionConfig
语义颜色MASK_SEMANTIC_COLORS, BASEBOARD_SEMANTIC_NAME
工具函数prewarmPngBgrCacheAsync
运行时默认值DEFAULT_*_CONFIG

Props 概览

分类描述
图像与初始化originUrl, maskUrl, initialSession, initialPaintColor
语义颜色与轮廓semanticColors, regionOutlineColor
maskConfig分割和语义区域配置
pipelineConfig分辨率和处理管线配置
paintConfig上色渲染和纹理混合配置
interactionConfig触摸交互和命中测试配置
UI 控件与样式可见性开关、自定义渲染器、样式
回调onWatch, onPaintCallback, onError
Ref 方法通过 ref 调用的命令式方法
存储约定会话持久化和 PNG 导出