components/background_components/segmenter/segmenter_interface library
Segmenter Interface - Shared Base for All Platforms
This file defines the abstract interface that ALL platform-specific implementations must conform to. Changes here automatically propagate to all platforms.
Architecture Pattern
segmenter_interface.dart <-- You are here (SHARED CONTRACT)
↓
┌────┴────┐
↓ ↓
segmenter_stub.dart segmenter_mobile.dart (segmenter_web.dart)
(fallback/desktop) (Android/iOS ML Kit) (future TensorFlow.js)
Adding a New Platform
- Create
segmenter_<platform>.dart - Implement BackgroundSegmenterBase
- Add conditional import to
segmenter.dart
Classes
- BackgroundSegmenterBase
- Abstract base class for background segmenters.
- SegmenterConfig
- Configuration options for the segmenter.
- SegmenterInputMetadata
- Metadata for input images.
Enums
- SegmenterInputFormat
- Input image format for the segmenter.
Typedefs
- SegmenterFactory = BackgroundSegmenterBase Function()
- Factory function type for creating segmenters.