@lihbr/capacitor-camera2
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

@lihbr/capacitor-camera2

npm version npm downloads Bundle Conventional Commits License

Capacitor plugin for android.hardware.camera2 inspired from and based on @capacitor-community/camera-preview all made by an Android amateur.

Install

npm install @lihbr/capacitor-camera2
npx cap sync

API

start(...)

start(options: Camera2Options) => Promise<void>
Param Type
options Camera2Options

stop()

stop() => Promise<void>

capture(...)

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(...)

setViewFinderSize(options: { width: number; height: number; }) => Promise<void>
Param Type
options { width: number; height: number; }

getShutterSpeedRange()

getShutterSpeedRange() => Promise<{ value: [min: number, max: number] | null; }>

Returns: Promise<{ value: [min: number, max: number] | null; }>


setShutterSpeed(...)

setShutterSpeed(options: { value: number; }) => Promise<void>
Param Type
options { value: number; }

getApertureRange()

getApertureRange() => Promise<{ value: [min: number, max: number] | null; }>

Returns: Promise<{ value: [min: number, max: number] | null; }>


setAperture(...)

setAperture(options: { value: number; }) => Promise<void>
Param Type
options { value: number; }

getIsoRange()

getIsoRange() => Promise<{ value: [min: number, max: number] | null; }>

Returns: Promise<{ value: [min: number, max: number] | null; }>


setIso(...)

setIso(options: { value: number; }) => Promise<void>
Param Type
options { value: number; }

getExposureCompensationInfo()

getExposureCompensationInfo() => Promise<{ range: [min: number, max: number] | null; step: number; }>

Returns: Promise<{ range: [min: number, max: number] | null; step: number; }>


setExposureCompensation(...)

setExposureCompensation(options: { value: number; }) => Promise<void>
Param Type
options { value: number; }

pictureToThumbnail(...)

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(...)

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; }>


Type Aliases

Camera2Options

{ x?: number; y?: number; width?: number; height?: number; paddingBottom?: number; toBack?: boolean; lockAndroidOrientation?: boolean; }

Contributing

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.

License

MIT License © 2024-PRESENT Lucie Haberer

Readme

Keywords

Package Sidebar

Install

npm i @lihbr/capacitor-camera2

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

109 kB

Total Files

31

Last publish

Collaborators

  • lihbr