blob: 6782398a6ab1e21d35e115bc4801a6acf32814c8 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020014#include "modules/desktop_capture/desktop_frame.h"
Mirko Bonadei3d255302018-10-11 10:50:45 +020015#include "rtc_base/system/rtc_export.h"
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000016
17namespace webrtc {
18
Zijie He9c0914f2017-07-26 17:52:38 -070019// Creates a DesktopFrame to contain only the area of |rect| in the original
20// |frame|.
21// |frame| should not be nullptr. |rect| is in |frame| coordinate, i.e.
22// |frame|->top_left() does not impact the area of |rect|.
sergeyu5d910282016-06-07 16:41:58 -070023// Returns nullptr frame if |rect| is not contained by the bounds of |frame|.
Mirko Bonadei3d255302018-10-11 10:50:45 +020024std::unique_ptr<DesktopFrame> RTC_EXPORT
25CreateCroppedDesktopFrame(std::unique_ptr<DesktopFrame> frame,
26 const DesktopRect& rect);
sergeyu5d910282016-06-07 16:41:58 -070027
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000028} // namespace webrtc
29
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020030#endif // MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_