Compare commits

...

2 Commits

Author SHA1 Message Date
Simon Stern
61697900c4
Merge pull request #2668 from orifmilod/docs/api
Enhance documentation: added missing properties in props index and added more explanation for api, fixed anchor redirecting to the explanation bug
2020-01-10 18:46:56 -05:00
milad440550
be66463c20 Enhance documentation: added missing properties in props index and added more explanation for api, fixed anchor redirecting to the explanation bug 2020-01-10 11:22:11 +01:00

View File

@ -6,15 +6,15 @@ title: Work in progress
[**wip**] [**wip**]
- [`zoom`](API.md#zoom) - [`zoom`](API.md#zoom)
- [`maxZoom`](API.md#maxZoom) - [`maxZoom`](API.md#maxzoom)
- [`type`](API.md#type) - [`type`](API.md#type)
- [`cameraId`](API.md#cameraId) - [`cameraId`](API.md#cameraid)
- [`flashMode`](API.md#flashMode) - [`flashMode`](API.md#flashmode)
- [`exposure`](API.md#exposure) - [`exposure`](API.md#exposure)
- [`whiteBalance`](API.md#whiteBalance) - [`whiteBalance`](API.md#whitebalance)
- [`autoFocus`](API.md#autoFocus) - [`autoFocus`](API.md#autofocus)
- [`ratio`](API.md#ratio) - [`ratio`](API.md#ratio)
- [`focusDepth`](API.md#focusDepth) - [`focusDepth`](API.md#focusdepth)
- [`onMountError`](API.md#onMountError) - [`onMountError`](API.md#onMountError)
- [`onCameraReady`](API.md#onCameraReady) - [`onCameraReady`](API.md#onCameraReady)
@ -35,29 +35,30 @@ title: Work in progress
This property specifies the zoom value of the camera. Ranges from 0 to 1. Default to 0. This property specifies the zoom value of the camera. Ranges from 0 to 1. Default to 0.
| Type | Default Value | | Type | Default Value | Plathform |
| ---- | -------- | | ------ | ------------- | --------- |
| number | 0 | | number | 0 | IOS |
--- ---
### `maxZoom` ### `maxZoom`
The maximum zoom value of the camera. Defaults to 0. Locks the max zoom value to the provided value
A value less than or equal to `1` will use the camera's max zoom, while a value greater than `1` will use that value as the max available zoom. \
| Type | Default Value | A float from `0` to `any`
| ---- | -------- | | Type | Default Value |
| ------ | ------------- |
| number | 0 | | number | 0 |
--- ---
### `type` ### `type`
This property defines which camera on the phone the component is using. This property defines which camera on the phone the component is using. \
Possible values: Possible values:
- `front` - `front`
- `back` - `back`
| Type | Default Value | | Type | Default Value |
| ---- | -------- | | ------ | ------------- |
| number | 'back' | | number | 'back' |
--- ---
@ -65,23 +66,78 @@ Possible values:
For selecting from multiple cameras on Android devices. See [2492](https://github.com/react-native-community/react-native-camera/pull/2492) for more info. Can be retrieved with `getCameraIds()` For selecting from multiple cameras on Android devices. See [2492](https://github.com/react-native-community/react-native-camera/pull/2492) for more info. Can be retrieved with `getCameraIds()`
| Type | Default Value | Platform | | Type | Default Value | Platform |
| ---- | -------- | -------- | | ------ | ------------- | -------- |
| String | `null` | Android | | String | `null` | Android |
--- ---
### `flashMode` ### `flashMode`
Determines the state of the camera flash. Has the following possible states. Determines the state of the camera flash. \
```off: '1', Possible values:
on: 'auto', - `auto`
auto: 'torch', - `on`
torch: 'off' - `off`
``` - `torch`
| Type | Default Value | | Type | Default Value |
| ---- | -------- | | ------ | ------------- |
| object | `{ off: 1 }` | | String | `off` |
---
### `whiteBalance`
A cameras white balance setting allows you to control the color temperature in your photos by cooling down or warming up the colors.\
The idea is that you select the appropriate white balance setting for the type of light that youre shooting in, and then your camera automatically adjusts the colors to eliminate any warm or cool color casts from your light source. \
Possible values:
- `auto`
- `sunny`
- `cloudy`
- `shadow`
- `incandescent`
- `fluorescent`
| Type | Default Value | Plathform |
| ------ | ------------- | --------- |
| String | `auto` | IOS |
---
### `autoFocus`
Determines if camera should auto focus by itself. It allows your camera to adjusts lens position automatically depending on the pixels seen by your camera. \
Possible values:
- `on`
- `off`
| Type | Default Value |
| ------ | ------------- |
| String | `on` |
---
### `ratio`
A string representing the camera ratio in the format 'height:width'. \
You can use `getSupportedRatiosAsync` method to get ratio strings supported by your camera on Android.
| Type | Default Value | Plathform |
| ------ | ------------- | --------- |
| String | `4:3` | Android |
---
### `focusDepth`
Manually set camera focus. Only works with autoFocus set to `off`. The value `0` is minimum focus depth, `1` is maximum focus depth.\
For a medium focus depth, for example, you could use `0.5`.
| Type | Default Value |
| ----- | ------------- |
| flaot | `null` |
---
### `onMountError`
Function to be called when native code emit onMountError event, when there is a problem mounting the camera.
---
### `onCameraReady`
Function to be called when native code emit onCameraReady event, when camera is ready. This event will also fire when changing cameras (by type or cameraId).
--- ---