-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnrealImageCapture.h
30 lines (21 loc) · 1 KB
/
UnrealImageCapture.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include "CoreMinimal.h"
#include "PIPCamera.h"
#include "common/ImageCaptureBase.hpp"
class UnrealImageCapture : public msr::airlib::ImageCaptureBase
{
public:
typedef msr::airlib::ImageCaptureBase::ImageType ImageType;
UnrealImageCapture(const std::vector<APIPCamera*>& cameras);
virtual ~UnrealImageCapture();
virtual void getImages(const std::vector<ImageRequest>& requests, std::vector<ImageResponse>& responses) override;
private:
void getSceneCaptureImage(const std::vector<msr::airlib::ImageCaptureBase::ImageRequest>& requests,
std::vector<msr::airlib::ImageCaptureBase::ImageResponse>& responses, bool use_safe_method);
void addScreenCaptureHandler(UWorld *world);
bool getScreenshotScreen(ImageType image_type, std::vector<uint8_t>& compressedPng);
void updateCameraVisibility(APIPCamera* camera, const msr::airlib::ImageCaptureBase::ImageRequest& request);
private:
std::vector<APIPCamera*> cameras_;
std::vector<uint8_t> last_compressed_png_;
};