| 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 FaceDetector_h | 5 #ifndef FaceDetector_h |
| 6 #define FaceDetector_h | 6 #define FaceDetector_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 static FaceDetector* create(ScriptState*); | 25 static FaceDetector* create(ScriptState*); |
| 26 | 26 |
| 27 ScriptPromise detect(ScriptState*, const CanvasImageSourceUnion&); | 27 ScriptPromise detect(ScriptState*, const CanvasImageSourceUnion&); |
| 28 DECLARE_TRACE(); | 28 DECLARE_TRACE(); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 explicit FaceDetector(LocalFrame&); | 31 explicit FaceDetector(LocalFrame&); |
| 32 ScriptPromise detectFacesOnImageElement(ScriptPromiseResolver*, | 32 ScriptPromise detectFacesOnImageElement(ScriptPromiseResolver*, |
| 33 const HTMLImageElement*); | 33 const HTMLImageElement*); |
| 34 ScriptPromise detectFacesOnImageBitmap(ScriptPromiseResolver*, ImageBitmap*); | 34 ScriptPromise detectFacesOnImageBitmap(ScriptPromiseResolver*, ImageBitmap*); |
| 35 ScriptPromise detectFacesOnVideoElement(ScriptPromiseResolver*, |
| 36 const HTMLVideoElement*); |
| 35 | 37 |
| 38 ScriptPromise detectFacesOnData(ScriptPromiseResolver*, |
| 39 uint8_t* data, |
| 40 int size, |
| 41 int width, |
| 42 int height); |
| 36 void onDetectFace(ScriptPromiseResolver*, | 43 void onDetectFace(ScriptPromiseResolver*, |
| 37 mojom::blink::FaceDetectionResultPtr); | 44 mojom::blink::FaceDetectionResultPtr); |
| 38 | 45 |
| 39 mojom::blink::ShapeDetectionPtr m_service; | 46 mojom::blink::ShapeDetectionPtr m_service; |
| 40 | 47 |
| 41 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; | 48 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; |
| 42 }; | 49 }; |
| 43 | 50 |
| 44 } // namespace blink | 51 } // namespace blink |
| 45 | 52 |
| 46 #endif // FaceDetector_h | 53 #endif // FaceDetector_h |
| OLD | NEW |