OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module media.mojom; | |
6 | |
7 // Equivalent to idl MediaSettingsRange, arbitrary range representing the | |
8 // allowed variations of a Capability or an Option. | |
9 // https://www.w3.org/TR/image-capture/#MediaSettingsRange | |
10 struct Range { | |
11 double max; | |
12 double min; | |
13 double current; | |
14 double step; | |
15 }; | |
16 | |
17 // https://www.w3.org/TR/image-capture/#MeteringMode | |
18 enum MeteringMode { NONE, MANUAL, SINGLE_SHOT, CONTINUOUS }; | |
19 | |
20 // https://www.w3.org/TR/image-capture/#FillLightMode | |
21 enum FillLightMode { NONE, OFF, AUTO, FLASH, TORCH }; | |
22 | |
23 // Equivalent to idl PhotoCapabilities, | |
24 // https://www.w3.org/TR/image-capture/#PhotoCapabilities | |
25 struct PhotoCapabilities { | |
26 MeteringMode white_balance_mode; | |
27 Range color_temperature; | |
28 MeteringMode exposure_mode; | |
29 Range exposure_compensation; | |
30 Range iso; | |
31 bool red_eye_reduction; | |
32 MeteringMode focus_mode; | |
33 | |
34 Range brightness; | |
35 Range contrast; | |
36 Range saturation; | |
37 Range sharpness; | |
38 Range height; | |
39 Range width; | |
40 Range zoom; | |
41 FillLightMode fill_light_mode; | |
42 }; | |
43 | |
44 // Equivalent to idl Point2D. | |
45 // TODO(mcasas): use gfx::mojom::PointF after https://crbug.com/640049. | |
46 struct Point2D { | |
47 float x; | |
48 float y; | |
49 }; | |
50 | |
51 // Equivalent to idl PhotoSettings, | |
52 // https://www.w3.org/TR/image-capture/#PhotoSettings | |
53 struct PhotoSettings { | |
54 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. | |
55 bool has_white_balance_mode; | |
56 MeteringMode white_balance_mode; | |
57 bool has_color_temperature; | |
58 double color_temperature; | |
59 bool has_exposure_mode; | |
60 MeteringMode exposure_mode; | |
61 bool has_exposure_compensation; | |
62 double exposure_compensation; | |
63 bool has_iso; | |
64 double iso; | |
65 bool has_red_eye_reduction; | |
66 bool red_eye_reduction; | |
67 bool has_focus_mode; | |
68 MeteringMode focus_mode; | |
69 array<Point2D> points_of_interest; | |
70 | |
71 bool has_brightness; | |
72 double brightness; | |
73 bool has_contrast; | |
74 double contrast; | |
75 bool has_saturation; | |
76 double saturation; | |
77 bool has_sharpness; | |
78 double sharpness; | |
79 bool has_zoom; | |
80 double zoom; | |
81 bool has_width; | |
82 double width; | |
83 bool has_height; | |
84 double height; | |
85 bool has_fill_light_mode; | |
86 FillLightMode fill_light_mode; | |
87 }; | |
88 | |
89 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. | |
90 struct Blob { | |
91 string mime_type; | |
92 array<uint8> data; | |
93 }; | |
94 | |
95 // |source_id| is the renderer-side UUID identifier of the image capture device. | |
96 interface ImageCapture | |
97 { | |
98 // Retrieves the image capture device capabilities and current settings. | |
99 // https://www.w3.org/TR/image-capture/#dom-imagecapture-getphotocapabilitie
s | |
100 GetCapabilities(string source_id) | |
101 => (PhotoCapabilities capabilities); | |
102 | |
103 // Sets the |settings| on the associated video capture device. | |
104 // https://www.w3.org/TR/image-capture/#dom-imagecapture-setoptions | |
105 SetOptions(string source_id, PhotoSettings settings) | |
106 => (bool success); | |
107 | |
108 // Takes a Photo from the given |source_id|, returning it encoded in |blob| | |
109 // with the format specified in its |mime_type|. | |
110 // https://www.w3.org/TR/image-capture/#dom-imagecapture-takephoto | |
111 TakePhoto(string source_id) | |
112 => (Blob blob); | |
113 }; | |
OLD | NEW |