-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHololuxScreenshot.h
49 lines (40 loc) · 1.42 KB
/
HololuxScreenshot.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <HololuxRenderer.h>
#include "MineolaHelper.h"
#include "IHololuxScreenshot.h"
class HololuxScreenshot : public IHololuxScreenshot {
public:
HololuxScreenshot() = default;
// Initialize the render engine. Return 0 upon success.
int init() override;
// Load Hololux LightField model. Return 0 upon success.
int loadModel(const char *modelFile) override;
// Set camera position and fov. Return 0 upon success.
int setCamera(float x, float y, float z, float fovYInRadian) override;
// Rotate the model by [angleInRadian] around world Y axis from the initial pose,
// set the clear color (RGBA, [0.0 - 1.0]),
// and write resulting image to [buffer].
// Image will always be width x height x 4, in scanline order.
// Buffer size is assumed to be at least width*height*4.
// Return 0 upon success.
int getImageByAngle(
uint8_t *buffer,
int width,
int height,
float angleInRadian,
std::array<float, 4> clear_color
) override;
// Destroy all resources.
~HololuxScreenshot();
private:
friend void HololuxScreenshotOnDownloadSuccess(void *app_ctx);
friend void HololuxScreenshotOnDownloadError(void *app_ctx);
private:
MineolaHelper helper_;
PHOLOLUXRENDERER renderer_{nullptr};
bool download_successful_{false};
std::shared_ptr<mineola::SceneNode> model_node_;
mineola::math::Rbt initial_pose_;
uint32_t current_width_{0};
uint32_t current_height_{0};
};