Capacitor plugin for android.hardware.camera2
inspired from and based on @capacitor-community/camera-preview
all made by an Android amateur.
npm install @lihbr/capacitor-camera2
npx cap sync
start(...)
stop()
capture(...)
setViewFinderSize(...)
getShutterSpeedRange()
setShutterSpeed(...)
getApertureRange()
setAperture(...)
getIsoRange()
setIso(...)
getExposureCompensationInfo()
setExposureCompensation(...)
pictureToThumbnail(...)
getExifData(...)
- Type Aliases
start(options: Camera2Options) => Promise<void>
Param | Type |
---|---|
options |
Camera2Options |
stop() => Promise<void>
capture(options: { picturePath: string; thumbnailPath?: string; thumbnailWidth?: number; thumbnailHeight?: number; thumbnailQuality?: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ picturePath: string; thumbnailPath?: string; thumbnailWidth?: number; thumbnailHeight?: number; thumbnailQuality?: number; } |
setViewFinderSize(options: { width: number; height: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ width: number; height: number; } |
getShutterSpeedRange() => Promise<{ value: [min: number, max: number] | null; }>
Returns: Promise<{ value: [min: number, max: number] | null; }>
setShutterSpeed(options: { value: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ value: number; } |
getApertureRange() => Promise<{ value: [min: number, max: number] | null; }>
Returns: Promise<{ value: [min: number, max: number] | null; }>
setAperture(options: { value: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ value: number; } |
getIsoRange() => Promise<{ value: [min: number, max: number] | null; }>
Returns: Promise<{ value: [min: number, max: number] | null; }>
setIso(options: { value: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ value: number; } |
getExposureCompensationInfo() => Promise<{ range: [min: number, max: number] | null; step: number; }>
Returns: Promise<{ range: [min: number, max: number] | null; step: number; }>
setExposureCompensation(options: { value: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ value: number; } |
pictureToThumbnail(options: { picture: string; width: number; height: number; quality?: number; }) => Promise<{ thumbnail: string; }>
Param | Type |
---|---|
options |
{ picture: string; width: number; height: number; quality?: number; } |
Returns: Promise<{ thumbnail: string; }>
getExifData(options: { path: string; }) => Promise<{ iso: number | null; shutterSpeed: number | null; aperture: number | null; focalLength: number | null; }>
Param | Type |
---|---|
options |
{ path: string; } |
Returns: Promise<{ iso: number | null; shutterSpeed: number | null; aperture: number | null; focalLength: number | null; }>
{ x?: number; y?: number; width?: number; height?: number; paddingBottom?: number; toBack?: boolean; lockAndroidOrientation?: boolean; }
Whether you're helping me fix bugs, improve the docs, or spread the word, I'd love to have you as a contributor!
Asking a question: Open a new topic on GitHub Discussions explaining what you want to achieve / your question. I'll try to get back to you shortly.
Reporting a bug: Open an issue explaining your application's setup and the bug you're encountering.
Suggesting an improvement: Open an issue explaining your improvement or feature so we can discuss and learn more.
Submitting code changes: For small fixes, feel free to open a PR with a description of your changes. For large changes, please first open an issue so we can discuss if and how the changes should be implemented.
MIT License © 2024-PRESENT Lucie Haberer