blob: 107fe7f4cafdfeb2f0f1cbc2509e9c216aadf10e [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
11#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
12#define WEBRTC_MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
13
14#include "webrtc/modules/desktop_capture/desktop_frame.h"
15
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|.
23std::unique_ptr<DesktopFrame> CreateCroppedDesktopFrame(
24 std::unique_ptr<DesktopFrame> frame,
25 const DesktopRect& rect);
26
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000027} // namespace webrtc
28
29#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
30