kodi
IScreenshotSurface.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
12 {
13 public:
14  virtual ~IScreenshotSurface() = default;
15  virtual bool Capture() { return false; }
16  virtual void CaptureVideo(bool blendToBuffer) {}
17 
18  int GetWidth() const { return m_width; }
19  int GetHeight() const { return m_height; }
20  int GetStride() const { return m_stride; }
21  unsigned char* GetBuffer() const { return m_buffer; }
22  void ReleaseBuffer()
23  {
24  if (m_buffer)
25  {
26  delete m_buffer;
27  m_buffer = nullptr;
28  }
29  };
30 
31 protected:
32  int m_width{0};
33  int m_height{0};
34  int m_stride{0};
35  unsigned char* m_buffer{nullptr};
36 };
Definition: IScreenshotSurface.h:11