OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PhotoCapabilities_h | 5 #ifndef PhotoCapabilities_h |
6 #define PhotoCapabilities_h | 6 #define PhotoCapabilities_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "media/capture/mojo/image_capture.mojom-blink.h" | 9 #include "media/capture/mojo/image_capture.mojom-blink.h" |
10 #include "modules/imagecapture/MediaSettingsRange.h" | 10 #include "modules/imagecapture/MediaSettingsRange.h" |
11 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class PhotoCapabilities final | 15 class PhotoCapabilities final |
16 : public GarbageCollectedFinalized<PhotoCapabilities>, | 16 : public GarbageCollectedFinalized<PhotoCapabilities>, |
17 public ScriptWrappable { | 17 public ScriptWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 | 19 |
20 public: | 20 public: |
21 static PhotoCapabilities* create(); | 21 static PhotoCapabilities* create(); |
22 virtual ~PhotoCapabilities() = default; | 22 virtual ~PhotoCapabilities() = default; |
23 | 23 |
24 MediaSettingsRange* iso() const { return m_iso; } | |
25 void setIso(MediaSettingsRange* value) { m_iso = value; } | |
26 | |
27 MediaSettingsRange* imageHeight() const { return m_imageHeight; } | 24 MediaSettingsRange* imageHeight() const { return m_imageHeight; } |
28 void setImageHeight(MediaSettingsRange* value) { m_imageHeight = value; } | 25 void setImageHeight(MediaSettingsRange* value) { m_imageHeight = value; } |
29 | 26 |
30 MediaSettingsRange* imageWidth() const { return m_imageWidth; } | 27 MediaSettingsRange* imageWidth() const { return m_imageWidth; } |
31 void setImageWidth(MediaSettingsRange* value) { m_imageWidth = value; } | 28 void setImageWidth(MediaSettingsRange* value) { m_imageWidth = value; } |
32 | 29 |
33 MediaSettingsRange* zoom() const { return m_zoom; } | |
34 void setZoom(MediaSettingsRange* value) { m_zoom = value; } | |
35 | |
36 String focusMode() const; | |
37 void setFocusMode(media::mojom::blink::MeteringMode focusMode) { | |
38 m_focusMode = focusMode; | |
39 } | |
40 | |
41 String exposureMode() const; | |
42 void setExposureMode(media::mojom::blink::MeteringMode exposureMode) { | |
43 m_exposureMode = exposureMode; | |
44 } | |
45 | |
46 MediaSettingsRange* exposureCompensation() const { | |
47 return m_exposureCompensation; | |
48 } | |
49 void setExposureCompensation(MediaSettingsRange* value) { | |
50 m_exposureCompensation = value; | |
51 } | |
52 | |
53 String whiteBalanceMode() const; | |
54 void setWhiteBalanceMode(media::mojom::blink::MeteringMode whiteBalanceMode) { | |
55 m_whiteBalanceMode = whiteBalanceMode; | |
56 } | |
57 | |
58 String fillLightMode() const; | 30 String fillLightMode() const; |
59 void setFillLightMode(media::mojom::blink::FillLightMode fillLightMode) { | 31 void setFillLightMode(media::mojom::blink::FillLightMode fillLightMode) { |
60 m_fillLightMode = fillLightMode; | 32 m_fillLightMode = fillLightMode; |
61 } | 33 } |
62 | 34 |
63 bool redEyeReduction() const { return m_redEyeReduction; } | 35 bool redEyeReduction() const { return m_redEyeReduction; } |
64 void setRedEyeReduction(bool redEyeReduction) { | 36 void setRedEyeReduction(bool redEyeReduction) { |
65 m_redEyeReduction = redEyeReduction; | 37 m_redEyeReduction = redEyeReduction; |
66 } | 38 } |
67 | 39 |
68 MediaSettingsRange* colorTemperature() const { return m_colorTemperature; } | |
69 void setColorTemperature(MediaSettingsRange* value) { | |
70 m_colorTemperature = value; | |
71 } | |
72 | |
73 MediaSettingsRange* brightness() const { return m_brightness; } | |
74 void setBrightness(MediaSettingsRange* value) { m_brightness = value; } | |
75 | |
76 MediaSettingsRange* contrast() const { return m_contrast; } | |
77 void setContrast(MediaSettingsRange* value) { m_contrast = value; } | |
78 | |
79 MediaSettingsRange* saturation() const { return m_saturation; } | |
80 void setSaturation(MediaSettingsRange* value) { m_saturation = value; } | |
81 | |
82 MediaSettingsRange* sharpness() const { return m_sharpness; } | |
83 void setSharpness(MediaSettingsRange* value) { m_sharpness = value; } | |
84 | |
85 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
86 | 41 |
87 private: | 42 private: |
88 PhotoCapabilities() = default; | 43 PhotoCapabilities() = default; |
89 | 44 |
90 Member<MediaSettingsRange> m_iso; | |
91 Member<MediaSettingsRange> m_imageHeight; | 45 Member<MediaSettingsRange> m_imageHeight; |
92 Member<MediaSettingsRange> m_imageWidth; | 46 Member<MediaSettingsRange> m_imageWidth; |
93 Member<MediaSettingsRange> m_zoom; | |
94 media::mojom::blink::MeteringMode m_focusMode = | |
95 media::mojom::blink::MeteringMode::NONE; | |
96 media::mojom::blink::MeteringMode m_exposureMode = | |
97 media::mojom::blink::MeteringMode::NONE; | |
98 Member<MediaSettingsRange> m_exposureCompensation; | |
99 media::mojom::blink::MeteringMode m_whiteBalanceMode = | |
100 media::mojom::blink::MeteringMode::NONE; | |
101 media::mojom::blink::FillLightMode m_fillLightMode = | 47 media::mojom::blink::FillLightMode m_fillLightMode = |
102 media::mojom::blink::FillLightMode::NONE; | 48 media::mojom::blink::FillLightMode::NONE; |
103 bool m_redEyeReduction; | 49 bool m_redEyeReduction; |
104 Member<MediaSettingsRange> m_colorTemperature; | |
105 Member<MediaSettingsRange> m_brightness; | |
106 Member<MediaSettingsRange> m_contrast; | |
107 Member<MediaSettingsRange> m_saturation; | |
108 Member<MediaSettingsRange> m_sharpness; | |
109 }; | 50 }; |
110 | 51 |
111 } // namespace blink | 52 } // namespace blink |
112 | 53 |
113 #endif // PhotoCapabilities_h | 54 #endif // PhotoCapabilities_h |
OLD | NEW |