diff --git a/docs/_posts/2018-12-20-capture-size.md b/docs/_posts/2018-12-20-capture-size.md index 5e34b529..b4a76b34 100644 --- a/docs/_posts/2018-12-20-capture-size.md +++ b/docs/_posts/2018-12-20-capture-size.md @@ -9,9 +9,11 @@ date: 2018-12-20 22:07:22 disqus: 1 --- -If you are planning to use the snapshot APIs, the size of the media output is that of the preview, -accounting for any cropping made when [measuring the view](preview-size.html). -If you are planning to use the standard APIs for capturing, then what follows applies. +If you are planning to use the snapshot APIs, the size of the media output is that of the preview stream, +accounting for any cropping made when [measuring the view](preview-size.html) and other constraints. +Please read the [Snapshot Size](snapshot-size.html) document. + +If you are planning to use the standard APIs, then what follows applies. ### Controlling Size diff --git a/docs/_posts/2018-12-20-capturing-media.md b/docs/_posts/2018-12-20-capturing-media.md index 1538f7ae..2138b383 100644 --- a/docs/_posts/2018-12-20-capturing-media.md +++ b/docs/_posts/2018-12-20-capturing-media.md @@ -46,8 +46,8 @@ resulting snapshots are square as well, no matter what the sensor available size |------|-----|-------|--------------------------|------------------------|---------|-----------| |`takePicture()`|Pictures|Standard|`yes`|`no`|`no`|That of `setPictureSize`| |`takeVideo(File)`|Videos|Standard|`no`|`yes`|`no`|That of `setVideoSize`| -|`takePictureSnapshot()`|Pictures|Snapshot|`yes`|`yes`|`yes`|That of the view| -|`takeVideoSnapshot(File)`|Videos|Snapshot|`yes`|`yes`|`yes`|That of the view| +|`takePictureSnapshot()`|Pictures|Snapshot|`yes`|`yes`|`yes`|That of the preview stream, [or less](snapshot-size.html)| +|`takeVideoSnapshot(File)`|Videos|Snapshot|`yes`|`yes`|`yes`|That of the preview stream, [or less](snapshot-size.html)| Please note that the video snaphot features requires: diff --git a/docs/_posts/2018-12-20-debugging.md b/docs/_posts/2018-12-20-debugging.md index dc7e1ab4..2e2d302d 100644 --- a/docs/_posts/2018-12-20-debugging.md +++ b/docs/_posts/2018-12-20-debugging.md @@ -2,7 +2,7 @@ layout: page title: "Debugging" category: docs -order: 10 +order: 12 date: 2018-12-20 20:02:38 disqus: 1 --- diff --git a/docs/_posts/2018-12-20-error-handling.md b/docs/_posts/2018-12-20-error-handling.md index 72c98cb1..1a24041e 100644 --- a/docs/_posts/2018-12-20-error-handling.md +++ b/docs/_posts/2018-12-20-error-handling.md @@ -2,7 +2,7 @@ layout: page title: "Error Handling" category: docs -order: 9 +order: 11 date: 2018-12-20 20:02:31 disqus: 1 --- diff --git a/docs/_posts/2018-12-20-more-features.md b/docs/_posts/2018-12-20-more-features.md index 984dd940..a971f84a 100644 --- a/docs/_posts/2018-12-20-more-features.md +++ b/docs/_posts/2018-12-20-more-features.md @@ -4,7 +4,7 @@ title: "More features" subtitle: "Undocumented features & more" description: "Undocumented features & more" category: docs -order: 11 +order: 13 date: 2018-12-20 20:41:20 disqus: 1 --- diff --git a/docs/_posts/2018-12-20-runtime-permissions.md b/docs/_posts/2018-12-20-runtime-permissions.md index 0cbcd03c..5027a65f 100644 --- a/docs/_posts/2018-12-20-runtime-permissions.md +++ b/docs/_posts/2018-12-20-runtime-permissions.md @@ -4,7 +4,7 @@ title: "Runtime Permissions" subtitle: "Permissions and Manifest setup" description: "Permissions and Manifest setup" category: docs -order: 8 +order: 10 date: 2018-12-20 20:03:03 disqus: 1 --- diff --git a/docs/_posts/2019-02-24-snapshot-size.md b/docs/_posts/2019-02-24-snapshot-size.md new file mode 100644 index 00000000..8703a232 --- /dev/null +++ b/docs/_posts/2019-02-24-snapshot-size.md @@ -0,0 +1,58 @@ +--- +layout: page +title: "Snapshot Size" +subtitle: "Sizing the snapshots output" +description: "Sizing the snapshots output" +category: docs +order: 9 +date: 2019-02-24 17:36:39 +disqus: 1 +--- + +Snapshots are captured from the preview stream instead of using a separate capture channel. +They are extremely fast, small in size, and give you a low-quality output that can be easily +uploaded or processed. + +The snapshot size is based on the size of the preview stream, which is described in the [Preview Size](preview-size.html) document. +Although the preview stream size is customizable, note that this is considered an advanced feature, +as the best preview stream size selector already does a good job for the vast majority of use cases. + +When taking snapshots, the preview stream size is then changed to match some constraints. + +### Matching the preview ratio + +Snapshots will automatically be cropped to match the preview aspect ratio. This means that if your +preview is square, you can finally take a square picture or video, regardless of the available sensor sizes. + +Take a look at the [Preview Size](preview-size.html) document to learn about preview sizing. + +### Other constraints + +You can refine the size further by applying `maxWidth` and a `maxHeight` constraints: + +```java +cameraView.setSnapshotMaxWidth(500); +cameraView.setSnapshotMaxHeight(500); +``` + +These values apply to both picture and video snapshots. If the snapshot dimensions exceed these values +(both default `Integer.MAX_VALUE`), the snapshot will be scaled down to match the constraints. + +This is very useful as it decouples the snapshot size logic from the preview. By using small constraints, +you can have a pleasant, good looking preview stream, while still capturing fast, low-res snapshots +with no issues. + +### XML Attributes + +```xml + +``` + +### Related APIs + +|Method|Description| +|------|-----------| +|`setSnapshotMaxWidth(int)`|Sets the max width for snapshots. If out of bounds, the output will be scaled down.| +|`setSnapshotMaxHeight(int)`|Sets the max height for snapshots. If out of bounds, the output will be scaled down.| \ No newline at end of file