Comments on this document are welcomed.
This document specific settings for a takePicture() method to be defined as part of the Media Capture specification.
Introduction ------------

Various proposals have been provided to the Task Force regarding methods for taking a picture that can extend getUserMedia(). This proposal focused on picture settings that are compatible with the cameras associated with many handheld devices. It leverages the takePicture() method as described in Settings API Version 4.

The takePicture() method is currently defined on a a PictureDeviceTrack according to the cited proposal as follows:

void takePicture ()
Temporarily mutes the owning VideoDeviceTrack's stream, then asynchronously switches the camera into "high resolution picture mode", applies the PictureDeviceTrack settings (a snapshot from the time the takePicture API was called, and records/encodes an image using a user-agent determined format into a Blob object. Finally, queues a task to fire a "picture" event with the resulting Blob instance.
attribute EventHandler onpicture
Register/unregister for "picture" events. The handler should expect to get a PictureEvent object as its first parameter.

For the purposes of this proposal, the main focus is on the PictureDeviceTrack object and takePicture() method. In addition, the MediaSettingsRange is leveraged.

MediaSettingsRange -----------------
readonly attribute any max
The maximum value of this setting
readonly attribute any min
The minimum value of this setting
readonly attribute any initial
The initial value of this setting
void request (any value, optional boolean mandatory)
Creates an internal constraint based on the setting name with the provided value, adds that constraint into the pending constraint structure (to the MediaTrackConstraint array by default or replaces an entry in the MediaTrackConstraintSet if the mandatory flag is set) and queues a task (if not already queued) to process the pending constraint structure at the conclusion of this task.
MediaSettingsItem -----------------

The MediaSettingsItem interface is now defined, which allows for a single setting to be managed.

readonly attribute any value
Value of current setting.
readonly attribute any initial
The initial value of this setting
void request (any value, optional boolean mandatory)
Creates an internal constraint based on the setting name with the provided value, adds that constraint into the pending constraint structure (to the MediaTrackConstraint array by default or replaces an entry in the MediaTrackConstraintSet if the mandatory flag is set) and queues a task (if not already queued) to process the pending constraint structure at the conclusion of this task.

PictureSettings ---------------

A new object PictureSettings is defined to control the settings for takePicture(). PictureDeviceTrack implements PictureSettings.

The PictureSettings interface must be supported by the User Agent. However, any settings in this object that are not supported by the User Agent or selected camera may be ignored.

attribute MediaSettingsItem whiteBalanceMode
This feature control the white balance mode setting. Values are of type WhiteBalanceModeEnum.
attribute MediaSettingsItem autoExposureMode
This feature control the auto exposure mode setting. Values are of type ExposureModeEnum.
attribute MediaSettingsRange exposureCompensation
This feature changes the exposure level for recorded images. Values are numeric.
attribute MediaSettingsItem iso
This feature control the camera ISO setting. Values are of type ISOModeEnum.
attribute MediaSettingsItem redEyeReduction
This feature turns on or off the camera red eye reduction and is boolean - on is true
attribute MediaSettingsRange brightness
This feature controls the brightness setting of the camera. Values are numeric.
attribute MediaSettingsRange constrast
This feature controls the contrast setting of the camera. Values are numeric.
attribute MediaSettingsRange saturation
This feature controls the saturation setting of the camera. Values are numeric.
attribute MediaSettingsRange sharpness
This feature controls the sharpness setting of the camera. Values are numeric.

#####WhiteBalanceModeEnum
auto
auto
incandescent
2500-3500 Kelvin
fluorescent
4000-5000 Kelvin
warm-fluorescent
5000-5500 Kelvin
daylight
5000-6500 Kelvin
cloudy-daylight
6500-8000 Kelvin
twilight
8000-9000 Kelvin
shade
9000-10000 Kelvin

#####ExposureModeEnum
frame-average
Average of light information from entire scene
center-weighted
Sensitivity concentrated towards center of viewfinder
spot-metering
Spot-centered weighting

#####ISOModeEnum
auto
Automatic adjustment
100
100 ASA rating
200
200 ASA rating
400
400 ASA rating
800
800 ASA rating
1250
1250 ASA rating

Example: Taking a picture after turning on Red Eye Reduction -------
    navigator.getUserMedia({video: true}, gotMedia, failedToGetMedia);
    
    function gotMedia(mediastream) {
       var videoDevice = mediastream.videoTracks[0];
       // Check if this device supports a picture mode...
       var pictureDevice = videoDevice.pictureDeviceTrack;
       if (pictureDevice) {
             pictureDevice.onpicture = showPicture;
             if (pictureDevice.redEyeReduction) {
                pictureDevice.redEyeReduction.request(true,true);
                }
             else
                console.log('No red eye reduction');
             pictureDevice.takePicture();
             }
           }

    function showPicture(e) {
           var img = document.querySelector("img");
           img.src = URL.createObjectURL(e.data);
           }
           
    function failedToGetMedia{
       console.log('Stream failure');
       }