-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathUsdFrame.h
44 lines (33 loc) · 1006 Bytes
/
UsdFrame.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
// Copyright 2020 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "UsdBaseObject.h"
#include "UsdParameterizedObject.h"
class UsdRenderer;
class UsdWorld;
struct UsdFrameData
{
UsdUint2 size = {0, 0};
ANARIDataType color = ANARI_UNKNOWN;
ANARIDataType depth = ANARI_UNKNOWN;
};
class UsdFrame : public UsdParameterizedBaseObject<UsdFrame, UsdFrameData>
{
public:
UsdFrame(UsdBridge* bridge);
~UsdFrame();
void remove(UsdDevice* device) override {}
const void* mapBuffer(const char* channel,
uint32_t *width,
uint32_t *height,
ANARIDataType *pixelType);
void unmapBuffer(const char* channel);
void saveUsd(UsdDevice* device);
protected:
bool deferCommit(UsdDevice* device) override;
bool doCommitData(UsdDevice* device) override;
void doCommitRefs(UsdDevice* device) override {}
char* ReserveBuffer(ANARIDataType format);
char* mappedColorMem = nullptr;
char* mappedDepthMem = nullptr;
};