blob: bbc3c86cad6bca222d287a5a3377db0cceb8717a [file] [log] [blame]
jiayl@webrtc.org0e710702014-11-11 18:15:55 +00001/*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
12#define MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000013
Yves Gerey3e707812018-11-28 16:47:49 +010014#include <memory>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/desktop_capture/desktop_frame.h"
Yves Gerey3e707812018-11-28 16:47:49 +010017#include "modules/desktop_capture/desktop_geometry.h"
Mirko Bonadei3d255302018-10-11 10:50:45 +020018#include "rtc_base/system/rtc_export.h"
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000019
20namespace webrtc {
21
Zijie He9c0914f2017-07-26 17:52:38 -070022// Creates a DesktopFrame to contain only the area of |rect| in the original
23// |frame|.
24// |frame| should not be nullptr. |rect| is in |frame| coordinate, i.e.
25// |frame|->top_left() does not impact the area of |rect|.
sergeyu5d910282016-06-07 16:41:58 -070026// Returns nullptr frame if |rect| is not contained by the bounds of |frame|.
Mirko Bonadei3d255302018-10-11 10:50:45 +020027std::unique_ptr<DesktopFrame> RTC_EXPORT
28CreateCroppedDesktopFrame(std::unique_ptr<DesktopFrame> frame,
29 const DesktopRect& rect);
sergeyu5d910282016-06-07 16:41:58 -070030
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000031} // namespace webrtc
32
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020033#endif // MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_