forked from microsoft/HoloLensForCV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppMain.h
74 lines (56 loc) · 2.47 KB
/
AppMain.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
namespace ComputeOnDevice
{
class AppMain : public Holographic::AppMainBase
{
public:
AppMain(
const std::shared_ptr<Graphics::DeviceResources>& deviceResources);
// IDeviceNotify
virtual void OnDeviceLost() override;
virtual void OnDeviceRestored() override;
// IAppMain
virtual void OnHolographicSpaceChanged(
_In_ Windows::Graphics::Holographic::HolographicSpace^ holographicSpace) override;
virtual void OnSpatialInput(
_In_ Windows::UI::Input::Spatial::SpatialInteractionSourceState^ pointerState) override;
virtual void OnUpdate(
_In_ Windows::Graphics::Holographic::HolographicFrame^ holographicFrame,
_In_ const Graphics::StepTimer& stepTimer) override;
virtual void OnPreRender() override;
virtual void OnRender() override;
private:
// Initializes access to HoloLens sensors.
void StartHoloLensMediaFrameSourceGroup();
private:
std::vector<std::shared_ptr<Rendering::SlateRenderer> >_slateRendererList;
std::shared_ptr<Rendering::SlateRenderer> _currentSlateRenderer;
// Selected HoloLens media frame source group
HoloLensForCV::MediaFrameSourceGroupType _selectedHoloLensMediaFrameSourceGroupType;
HoloLensForCV::MediaFrameSourceGroup^ _holoLensMediaFrameSourceGroup;
bool _holoLensMediaFrameSourceGroupStarted;
// HoloLens media frame server manager
HoloLensForCV::SensorFrameStreamer^ _sensorFrameStreamer;
Windows::Foundation::DateTime _latestSelectedCameraTimestamp;
cv::Mat _undistortMap1;
cv::Mat _undistortMap2;
bool _undistortMapsInitialized;
cv::Mat _undistortedPVCameraImage;
cv::Mat _resizedPVCameraImage;
cv::Mat _blurredPVCameraImage;
cv::Mat _cannyPVCameraImage;
std::vector<Rendering::Texture2DPtr> _visualizationTextureList;
Rendering::Texture2DPtr _currentVisualizationTexture;
bool _isActiveRenderer;
};
}