mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
* implement set videomode via json api * refactor grabbers: - new base class - move shared code to base class * fix osx * rework all cmakelist files with auto file collection. except leddevices (need further restructuring) * store current video and grabbing mode * add json stuff * remove grabbingmode - we do not want to expose it
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#pragma once
|
|
|
|
// OSX includes
|
|
#include <CoreGraphics/CoreGraphics.h>
|
|
|
|
// Utils includes
|
|
#include <utils/ColorRgb.h>
|
|
#include <hyperion/Grabber.h>
|
|
|
|
///
|
|
/// The OsxFrameGrabber is used for creating snapshots of the display (screenshots)
|
|
///
|
|
class OsxFrameGrabber : public Grabber
|
|
{
|
|
public:
|
|
///
|
|
/// Construct a OsxFrameGrabber that will capture snapshots with specified dimensions.
|
|
///
|
|
/// @param[in] display The index of the display to capture
|
|
/// @param[in] width The width of the captured screenshot
|
|
/// @param[in] height The heigth of the captured screenshot
|
|
///
|
|
OsxFrameGrabber(const unsigned display, const unsigned width, const unsigned height);
|
|
~OsxFrameGrabber();
|
|
|
|
///
|
|
/// Captures a single snapshot of the display and writes the data to the given image. The
|
|
/// provided image should have the same dimensions as the configured values (_width and
|
|
/// _height)
|
|
///
|
|
/// @param[out] image The snapped screenshot (should be initialized with correct width and
|
|
/// height)
|
|
///
|
|
void grabFrame(Image<ColorRgb> & image);
|
|
|
|
private:
|
|
/// display
|
|
const unsigned _screenIndex;
|
|
|
|
/// Reference to the captured diaplay
|
|
CGDirectDisplayID _display;
|
|
};
|