hyperion.ng
DispmanxFrameGrabber.h
1 #pragma once
2 
3 // BCM includes
4 #ifdef PLATFORM_RPI
5  #pragma GCC system_header
6  #include <bcm_host.h>
7 #else
8  #include <grabber/DispmanxFrameGrabberMock.h>
9 #endif
10 
11 // Utils includes
12 #include <utils/Image.h>
13 #include <utils/ColorRgba.h>
14 #include <hyperion/Grabber.h>
15 
21 {
22 public:
29  DispmanxFrameGrabber(const unsigned width, const unsigned height);
31 
32 
41  int grabFrame(Image<ColorRgb> & image);
42 
45  virtual bool setWidthHeight(int width, int height);
46 
47 private:
53  void setFlags(const int vc_flags);
54 
58  void freeResources();
59 
61  DISPMANX_DISPLAY_HANDLE_T _vc_display;
62 
64  DISPMANX_RESOURCE_HANDLE_T _vc_resource;
65 
67  VC_RECT_T _rectangle;
68 
70  int _vc_flags;
71 
72  // temp buffer when capturing with unsupported pitch size or
73  // when we need to crop the image
74  ColorRgba* _captureBuffer;
75 
76  // size of the capture buffer in Pixels
77  unsigned _captureBufferSize;
78 
79  // rgba output buffer
80  Image<ColorRgba> _image_rgba;
81 
82 };
Definition: ColorRgba.h:9
int grabFrame(Image< ColorRgb > &image)
Captures a single snapshot of the display and writes the data to the given image. ...
Definition: DispmanxFrameGrabber.cpp:92
virtual bool setWidthHeight(int width, int height)
Set new width and height for dispmanx, overwrite Grabber.h impl.
Definition: DispmanxFrameGrabber.cpp:65
DispmanxFrameGrabber(const unsigned width, const unsigned height)
Construct a DispmanxFrameGrabber that will capture snapshots with specified dimensions.
Definition: DispmanxFrameGrabber.cpp:9
The DispmanxFrameGrabber is used for creating snapshots of the display (screenshots) with a downsized...
Definition: DispmanxFrameGrabber.h:20
The Grabber class is responsible to apply image resizes (with or without ImageResampler) Overwrite th...
Definition: Grabber.h:17
Definition: DispmanxFrameGrabberMock.h:21