blob: 59dced40179bdd93d81c3b47ae73a5f7199c6a3c [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"
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000015
16namespace webrtc {
17
Zijie He9c0914f2017-07-26 17:52:38 -070018// Creates a DesktopFrame to contain only the area of |rect| in the original
19// |frame|.
20// |frame| should not be nullptr. |rect| is in |frame| coordinate, i.e.
21// |frame|->top_left() does not impact the area of |rect|.
sergeyu5d910282016-06-07 16:41:58 -070022// Returns nullptr frame if |rect| is not contained by the bounds of |frame|.
Mirko Bonadei16fe3f22018-10-08 13:09:14 +000023std::unique_ptr<DesktopFrame> CreateCroppedDesktopFrame(
24 std::unique_ptr<DesktopFrame> frame,
25 const DesktopRect& rect);
sergeyu5d910282016-06-07 16:41:58 -070026
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000027} // namespace webrtc
28
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020029#endif // MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_