-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshared_memory.h
More file actions
24 lines (18 loc) · 799 Bytes
/
shared_memory.h
File metadata and controls
24 lines (18 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "distortion.h"
#include <windows.h>
#include <stdexcept>
struct SharedMemoryData {
HANDLE hMapFile = NULL;
LPVOID pBuf = NULL;
HANDLE hImageEvent = NULL;
HANDLE hImageMutex = NULL;
char* imageMemBase = nullptr;
};
void setup_shared_memory(SharedMemoryData& data);
void cleanup_shared_memory(SharedMemoryData& data);
// Get distortion configuration for a given camera ID
bool get_distortion_config(SharedMemoryData& data, int cameraId, CameraParameters& params, CameraIntrinsics& intrinsics);
// Waits for a new frame, finds the latest image buffer, and copies it to the destination.
// Returns true on success, false on failure.
bool copy_latest_image_buffer(SharedMemoryData& data, void* leftCameraData, void* rightCameraData, size_t cameraDataSize);