Skip to main content

📖 API Reference

Imports

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';
CategoryNames
ComponentMaskSegmentCanvas (default)
Ref / Props typesMaskSegmentCanvasRef, MaskSegmentCanvasProps
Session / callback typesMaskSegmentSession, PaintCallbackPayload, PaintedRegionRecord, SavePaintResult
Lasso typesLassoPolygon, ManualWallPartition
Watch typesMaskSegmentWatchState, MaskSegmentWatchDetail
Config typesPipelineConfig, MaskSegmentConfig, PaintConfig, InteractionConfig
Semantic colorsMASK_SEMANTIC_COLORS, BASEBOARD_SEMANTIC_NAME
UtilitiesprewarmPngBgrCacheAsync
Runtime defaultsDEFAULT_*_CONFIG

Props Overview

CategoryDescription
Image & InitializationoriginUrl, maskUrl, initialSession, initialPaintColor
Semantic Colors & OutlinesemanticColors, regionOutlineColor
maskConfigSegmentation and semantic region configuration
pipelineConfigResolution and processing pipeline configuration
paintConfigPaint rendering and texture blending configuration
interactionConfigTouch interaction and hit testing configuration
UI Controls & StylingVisibility toggles, custom renderers, styling
CallbacksonWatch, onPaintCallback, onError
Ref MethodsImperative methods via ref
Storage ConventionSession persistence and PNG export