cropped_desktop_frame.h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  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. #ifndef MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
  11. #define MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_
  12. #include <memory>
  13. #include "modules/desktop_capture/desktop_frame.h"
  14. #include "modules/desktop_capture/desktop_geometry.h"
  15. #include "rtc_base/system/rtc_export.h"
  16. namespace webrtc {
  17. // Creates a DesktopFrame to contain only the area of |rect| in the original
  18. // |frame|.
  19. // |frame| should not be nullptr. |rect| is in |frame| coordinate, i.e.
  20. // |frame|->top_left() does not impact the area of |rect|.
  21. // Returns nullptr frame if |rect| is not contained by the bounds of |frame|.
  22. std::unique_ptr<DesktopFrame> RTC_EXPORT
  23. CreateCroppedDesktopFrame(std::unique_ptr<DesktopFrame> frame,
  24. const DesktopRect& rect);
  25. } // namespace webrtc
  26. #endif // MODULES_DESKTOP_CAPTURE_CROPPED_DESKTOP_FRAME_H_