image-capture.idl (4002B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: MediaStream Image Capture (https://w3c.github.io/mediacapture-image/) 5 6 [Exposed=Window, SecureContext] 7 interface ImageCapture { 8 constructor(MediaStreamTrack videoTrack); 9 Promise<Blob> takePhoto(optional PhotoSettings photoSettings = {}); 10 Promise<PhotoCapabilities> getPhotoCapabilities(); 11 Promise<PhotoSettings> getPhotoSettings(); 12 13 Promise<ImageBitmap> grabFrame(); 14 15 readonly attribute MediaStreamTrack track; 16 }; 17 18 dictionary PhotoCapabilities { 19 RedEyeReduction redEyeReduction; 20 MediaSettingsRange imageHeight; 21 MediaSettingsRange imageWidth; 22 sequence<FillLightMode> fillLightMode; 23 }; 24 25 dictionary PhotoSettings { 26 FillLightMode fillLightMode; 27 double imageHeight; 28 double imageWidth; 29 boolean redEyeReduction; 30 }; 31 32 dictionary MediaSettingsRange { 33 double max; 34 double min; 35 double step; 36 }; 37 38 enum RedEyeReduction { 39 "never", 40 "always", 41 "controllable" 42 }; 43 44 enum FillLightMode { 45 "auto", 46 "off", 47 "flash" 48 }; 49 50 partial dictionary MediaTrackSupportedConstraints { 51 boolean whiteBalanceMode = true; 52 boolean exposureMode = true; 53 boolean focusMode = true; 54 boolean pointsOfInterest = true; 55 56 boolean exposureCompensation = true; 57 boolean exposureTime = true; 58 boolean colorTemperature = true; 59 boolean iso = true; 60 61 boolean brightness = true; 62 boolean contrast = true; 63 boolean pan = true; 64 boolean saturation = true; 65 boolean sharpness = true; 66 boolean focusDistance = true; 67 boolean tilt = true; 68 boolean zoom = true; 69 boolean torch = true; 70 }; 71 72 partial dictionary MediaTrackCapabilities { 73 sequence<DOMString> whiteBalanceMode; 74 sequence<DOMString> exposureMode; 75 sequence<DOMString> focusMode; 76 77 MediaSettingsRange exposureCompensation; 78 MediaSettingsRange exposureTime; 79 MediaSettingsRange colorTemperature; 80 MediaSettingsRange iso; 81 82 MediaSettingsRange brightness; 83 MediaSettingsRange contrast; 84 MediaSettingsRange saturation; 85 MediaSettingsRange sharpness; 86 87 MediaSettingsRange focusDistance; 88 MediaSettingsRange pan; 89 MediaSettingsRange tilt; 90 MediaSettingsRange zoom; 91 92 sequence<boolean> torch; 93 }; 94 95 partial dictionary MediaTrackConstraintSet { 96 ConstrainDOMString whiteBalanceMode; 97 ConstrainDOMString exposureMode; 98 ConstrainDOMString focusMode; 99 ConstrainPoint2D pointsOfInterest; 100 101 ConstrainDouble exposureCompensation; 102 ConstrainDouble exposureTime; 103 ConstrainDouble colorTemperature; 104 ConstrainDouble iso; 105 106 ConstrainDouble brightness; 107 ConstrainDouble contrast; 108 ConstrainDouble saturation; 109 ConstrainDouble sharpness; 110 111 ConstrainDouble focusDistance; 112 (boolean or ConstrainDouble) pan; 113 (boolean or ConstrainDouble) tilt; 114 (boolean or ConstrainDouble) zoom; 115 116 ConstrainBoolean torch; 117 }; 118 119 partial dictionary MediaTrackSettings { 120 DOMString whiteBalanceMode; 121 DOMString exposureMode; 122 DOMString focusMode; 123 sequence<Point2D> pointsOfInterest; 124 125 double exposureCompensation; 126 double exposureTime; 127 double colorTemperature; 128 double iso; 129 130 double brightness; 131 double contrast; 132 double saturation; 133 double sharpness; 134 135 double focusDistance; 136 double pan; 137 double tilt; 138 double zoom; 139 140 boolean torch; 141 }; 142 143 dictionary ConstrainPoint2DParameters { 144 sequence<Point2D> exact; 145 sequence<Point2D> ideal; 146 }; 147 148 typedef (sequence<Point2D> or ConstrainPoint2DParameters) ConstrainPoint2D; 149 150 enum MeteringMode { 151 "none", 152 "manual", 153 "single-shot", 154 "continuous" 155 }; 156 157 dictionary Point2D { 158 double x = 0.0; 159 double y = 0.0; 160 };