Chromium Code Reviews| Index: webrtc/modules/desktop_capture/desktop_frame_rotator.h |
| diff --git a/webrtc/modules/desktop_capture/desktop_frame_rotator.h b/webrtc/modules/desktop_capture/desktop_frame_rotator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3ac31dfa60eac744dac9c8983a765c306fdadb0b |
| --- /dev/null |
| +++ b/webrtc/modules/desktop_capture/desktop_frame_rotator.h |
| @@ -0,0 +1,47 @@ |
| +/* |
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_ROTATOR_H_ |
| +#define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_ROTATOR_H_ |
| + |
| +#include "webrtc/modules/desktop_capture/desktop_frame.h" |
| +#include "webrtc/modules/desktop_capture/desktop_geometry.h" |
| + |
| +namespace webrtc { |
| + |
| +// Represents the rotation of a DesktopFrame. |
| +enum class Rotation { |
| + CLOCK_WISE_0, |
| + CLOCK_WISE_90, |
| + CLOCK_WISE_180, |
| + CLOCK_WISE_270, |
| +}; |
| + |
| +// Rotates input DesktopFrame |src|, copies pixel in a rotated rectangle |rect| |
| +// into another DesktopFrame |target|, and adds |rect| into |
| +// |target|->mutable_updated_region(). Returns false if |target| is nullptr or |
| +// it does not cover the |rect|. |
| +bool CopyRotatedRectTo(const DesktopFrame& src, |
|
Sergey Ulanov
2016/11/15 20:50:22
s/src/source/
Hzj_jie
2016/11/16 01:18:33
Done.
|
| + DesktopRect rect, |
| + Rotation rotation, |
| + DesktopFrame* target); |
| + |
| +// Rotates input DesktopFrame |src|, copies pixel in a unrotated rectangle |
|
Sergey Ulanov
2016/11/15 20:50:22
I'm not sure I understand the difference between t
Hzj_jie
2016/11/16 01:18:33
Yes, exactly, |rect| is in |target| coordinate in
|
| +// |rect| into another DesktopFrame |target|, and adds rotated |rect| into |
| +// |target|->mutable_updated_region(). Returns false if |target| is nullptr or |
| +// it does not cover the |rect|. |
| +bool CopyUnrotatedRectTo(const DesktopFrame& src, |
| + DesktopRect rect, |
| + Rotation rotation, |
| + DesktopFrame* target); |
| + |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_ROTATOR_H_ |