ujizin/Camposer
소개
Compose Multiplatform용 카메라 라이브러리 📸✨
웹 및 앱 개발What you can do
- 📸 Take pictures
- 🎥 Record videos
- 🎯 Focus support (tap to focus)
- 🎛️ Exposure compensation
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalCamposer
📸 A Compose Multiplatform camera library for taking photos, recording videos, controlling flash/torch, zooming, and more.
✨ Check out the sample projects
🚀 Quick Start
Add the dependencies to your module build.gradle.kts, then sync your project:
// Android
dependencies {
implementation("io.github.ujizin:camposer:<version>")
}
// Kotlin Multiplatform
sourceSets {
commonMain.dependencies {
implementation("io.github.ujizin:camposer:<version>")
// Required when you want to use code analysis features (e.g., QR code scanning).
implementation("io.github.ujizin:camposer-code-scanner:<version>")
}
}
🧩 Basic Usage
To show the CameraPreview composable, use the example below:
val controller = remember { CameraController() }
val cameraSession = rememberCameraSession(controller)
var camSelector by remember { mutableStateOf(CamSelector.Back) }
CameraPreview(
cameraSession = cameraSession,
camSelector = camSelector,
) {
// Camera Preview UI
}
✨ Features
- 📸 Take pictures
- 🎥 Record videos
- 🔍 Zoom
- 🎯 Focus support (tap to focus)
- ⚡ Flash mode
- 🔦 Torch
- 🎛️ Exposure compensation
- 🖼️ Image/video quality controls
- 🔭 Multi-camera lens support (Ultra-wide, Wide & Telephoto)
- ⏱️ 30/60 FPS video recording
- 🎬 Video stabilization (iOS only for now)
- 🧠 Image analyzer (code scanner)
📚 Documentation
Visit the docs to learn more: ujizin.github.io/Camposer
🛠️ Usage Examples
📸 Taking Pictures
Use CameraSession and call takePicture:
// Capture into a temporary byte array
cameraSession.takePicture { result ->
/* ... */
}
// Capture into a file
cameraSession.takePicture(fileName) { result -> /* ... */ }
🎥 Recording Videos
Set captureMode = CaptureMode.Video in CameraPreview, then call startRecording and stopRecording.
cameraSession.startRecording(fileName) { result ->
/* ... */
}
cameraSession.stopRecording()
🔄 Switching Cameras
To switch cameras, pass camSelector to CameraPreview (as shown above) and update its state.
// Front camera
camSelector = CamSelector.Front
// Back camera
camSelector = CamSelector.Back
// Toggle camera selector
camSelector = camSelector.inverse
➕ More
To explore additional features, check the documentation.
Have fun code()! 👨💻
✨ Inspiration
Camposer includes features inspired by react-native-vision-camera.
📄 License
Copyright 2022 ujizin (Lucas Yuji)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
관련 프로젝트 살펴보기
불러오는 중…