X11ScreenCaptureImageProvider.h
Go to the documentation of this file.
1#pragma once
2
3#include <opencv2/opencv.hpp>
4
6
8
9// Include X last.
10#include <X11/Xlib.h>
11#include <X11/Xutil.h>
12
13namespace visionx
14{
15
17 {
18 public:
20
21 // ManagedIceObject interface
22 protected:
23 std::string getDefaultName() const override;
24 static std::string GetDefaultName();
25
26 // CapturingImageProviderInterface interface
27 public:
28 // CapturingImageProvider interface
29 protected:
30 void onInitCapturingImageProvider() override;
31 void onExitCapturingImageProvider() override;
32 bool capture(void** ppImageBuffers) override;
33
34 // CapturingImageProvider interface
35 protected:
36 void onStartCapture(float framesPerSecond) override;
37 void onStopCapture() override;
38
39 // PropertyUser interface
40 public:
42
43 std::vector<imrec::ChannelPreferences>
44 getImageRecordingChannelPreferences(const Ice::Current&) override;
45
46 private:
47 static const std::string defaultName;
48
49 struct Properties
50 {
51 int screenNumber = 0;
52 int x = 0;
53 int y = 0;
54 int width = 1920;
55 int height = 1080;
56 int fps = 30;
57 } properties;
58
59 armarx::Clock clock;
60
61 Window window;
62 Display* display;
63 XImage* ximg = nullptr;
64 cv::Mat ximg_cv;
65 cv::Mat out;
66 };
67
68} // namespace visionx
Clock to get date/time from a specific clock type or wait for certain durations or until certain date...
Definition Clock.h:26
The CapturingImageProvider provides a callback function to trigger the capturing of images with diffe...
void onStartCapture(float framesPerSecond) override
This is called when the image provider capturing has been started.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onStopCapture() override
This is called when the image provider capturing has been stopped.
void onExitCapturingImageProvider() override
This is called when the Component::onExitComponent() setup is called.
std::vector< imrec::ChannelPreferences > getImageRecordingChannelPreferences(const Ice::Current &) override
void onInitCapturingImageProvider() override
This is called when the Component::onInitComponent() is called.
std::string getDefaultName() const override
Retrieve default name of component.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArmarX headers.