How jmseb3/capturable works
Capturable is a Compose Multiplatform library that turns marked composable content into an ImageBitmap, with an optional extension for encoding, saving, and sharing captures. The main flow is: a caller marks content and requests a capture; the modifier records and converts the drawing; the controller completes the asynchronous result. Extension helpers then encode that result and hand it to platform save or share facilities. Core capture and save behavior is excerpted; platform-specific integrations are represented where the README documents them, but unsampled implementations are not treated as inspected.
Main entry points: CaptureController.kt Capture controller · CaptureAsyncAndShare.jvm.kt Platform sharing · Capturable.kt Capturable modifier · CaptureAsyncAndSave.nonweb.kt Platform save
Components 16
Core capture
- Capturable modifier
capturable/src/commonMain/kotlin/dev/wonddak/capturable/Capturable.kt - Capture controller
capturable/src/commonMain/kotlin/dev/wonddak/capturable/controller/CaptureController.kt - ImageBitmap
Image formats
- Image format
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/CapturableSaveImageType.kt - Bitmap encoder
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/encodeToByteArray.kt
Save helpers
- Capture and save
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.kt - Platform save
capturableExtension/src/nonWebMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.nonweb.kt - FileKit storage
Share helpers
- Capture and share
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.kt - Platform sharing
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.jvm.kt - macOS share picker
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/platform/macos/ShareByMacShare.kt - Native share service
- System clipboard
- Web Share API
- Browser download
Other components
- Library caller
Connections 19
- Library caller → Capturable modifier: marks content
README.md - Library caller → Capture controller: requests capture
README.md - Capturable modifier → Capture controller: collects requests
capturable/src/commonMain/kotlin/dev/wonddak/capturable/Capturable.kt - Capturable modifier → ImageBitmap: converts drawing
capturable/src/commonMain/kotlin/dev/wonddak/capturable/Capturable.kt - Capturable modifier → Capture controller: completes request
capturable/src/commonMain/kotlin/dev/wonddak/capturable/Capturable.kt - Library caller → Capture and save: invokes save
README.md - Capture and save → Capture controller: captures image
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.kt - Platform save → Capture controller: awaits capture
capturableExtension/src/nonWebMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.nonweb.kt - Platform save → Bitmap encoder: encodes bitmap
capturableExtension/src/nonWebMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.nonweb.kt - Bitmap encoder → Image format: uses format
capturableExtension/src/commonMain/kotlin/dev/wonddak/capturable/extension/encodeToByteArray.kt - Platform save → FileKit storage: writes or saves
capturableExtension/src/nonWebMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndSave.nonweb.kt - Library caller → Capture and share: invokes share
README.md - Platform sharing → Capture controller: awaits capture
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.jvm.kt - Platform sharing → macOS share picker: tries macOS share
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.jvm.kt - macOS share picker → Native share service: opens picker
README.md - Platform sharing → Bitmap encoder: encodes clipboard image
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.jvm.kt - Platform sharing → System clipboard: copies image
capturableExtension/src/jvmMain/kotlin/dev/wonddak/capturable/extension/CaptureAsyncAndShare.jvm.kt - Capture and share → Web Share API: uses when available
README.md - Capture and share → Browser download: falls back to
README.md