5 URealSenseDevice::URealSenseDevice(
const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
30 auto Sensor = NewNamedObject<URealSenseSensor>(
this, ObjName);
47 for (
int i = 0;
i < Count;
i++)
52 Sensors.Add(NewSensor(RsSensor, TEXT(
"RealSenseSensor")));
59 for (
auto* Sensor : Sensors)
69 for (
auto* Sensor : Sensors)
71 for (
const auto& Profile : Sensor->StreamProfiles)
86 TArray<FRealSenseStreamProfile> Result;
88 for (
auto* Sensor : Sensors)
90 for (
const auto& Profile : Sensor->StreamProfiles)
104 for (
auto* Sensor : Sensors)
106 if (Sensor->SupportsProfile(Profile))
117 return LoadPreset(
RsDevice, FileName);
122 return SavePreset(
RsDevice, FileName);
129 IFileHandle* FileHandle = PlatformFile.OpenRead(*FileName);
136 auto Size = FileHandle->Size();
137 std::vector<uint8> Data;
140 if (!FileHandle->Read(&Data[0], Size))
142 REALSENSE_ERR(TEXT(
"Read failed: %s Size=%u"), *FileName, (
unsigned int)Size);
167 IFileHandle* FileHandle = PlatformFile.OpenWrite(*FileName);
185 if (!FileHandle->Write(Data, Size))
int rs2_get_sensors_count(const rs2_sensor_list *info_list, rs2_error **error)
const char * get_message() const
rs2_sensor * rs2_create_sensor(const rs2_sensor_list *list, int index, rs2_error **error)
void SetHandle(struct rs2_sensor *Handle)
bool SavePreset(const FString &FileName)
void rs2_delete_device(rs2_device *device)
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
class URealSenseSensor * GetSensor(ERealSenseStreamType StreamType)
void rs2_load_json(rs2_device *dev, const void *json_content, unsigned content_size, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
#define REALSENSE_ERR(Format,...)
virtual ~URealSenseDevice()
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
rs2_raw_data_buffer * rs2_serialize_json(rs2_device *dev, rs2_error **error)
class URealSenseSensor * NewSensor(struct rs2_sensor *Handle, const TCHAR *Name)
bool LoadPreset(const FString &FileName)
UTexture2D * Get(TUniquePtr< T > &Dtex)
rs2_sensor_list * rs2_query_sensors(const rs2_device *device, rs2_error **error)
void SetHandle(struct rs2_context *Handle)
struct rs2_device * GetHandle()
#define REALSENSE_TRACE(Format,...)
void rs2_delete_sensor_list(rs2_sensor_list *info_list)
FString uestr(const char *str)
TArray< FRealSenseStreamProfile > GetStreamProfiles(ERealSenseStreamType StreamType)
void SetHandle(struct rs2_device *Handle)
bool SupportsProfile(FRealSenseStreamProfile Profile)
const char * rs2_get_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)