Loading...
Searching...
No Matches
camera.h
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H
25#define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H
26
27#include "pxr/pxr.h"
28#include "hdPrman/api.h"
29#include "hdPrman/renderParam.h"
30#include "pxr/imaging/hd/camera.h"
31#include "pxr/imaging/hd/timeSampleArray.h"
32
33#include "pxr/base/vt/array.h"
34
35PXR_NAMESPACE_OPEN_SCOPE
36
37class HdSceneDelegate;
38
47class HdPrmanCamera final : public HdCamera
48{
49public:
54 {
55 float shutterOpenTime;
56 float shutterCloseTime;
57 VtArray<float> shutteropening;
58 };
59
60 HDPRMAN_API
61 HdPrmanCamera(SdfPath const& id);
62
63 HDPRMAN_API
64 ~HdPrmanCamera() override;
65
67 HDPRMAN_API
68 void Sync(HdSceneDelegate *sceneDelegate,
69 HdRenderParam *renderParam,
70 HdDirtyBits *dirtyBits) override;
71
73 HDPRMAN_API
76 return _sampleXforms;
77 }
78
79#if HD_API_VERSION < 52
80 float GetLensDistortionK1() const {
81 return _lensDistortionK1;
82 }
83
84 float GetLensDistortionK2() const {
85 return _lensDistortionK2;
86 }
87
88 const GfVec2f &GetLensDistortionCenter() const {
89 return _lensDistortionCenter;
90 }
91
92 float GetLensDistortionAnaSq() const {
93 return _lensDistortionAnaSq;
94 }
95
96 const GfVec2f &GetLensDistortionAsym() const {
97 return _lensDistortionAsym;
98 }
99
100 float GetLensDistortionScale() const {
101 return _lensDistortionScale;
102 }
103#endif
104
139 return _shutterCurve;
140 }
141
142 float GetApertureAngle() const {
143 return _apertureAngle;
144 }
145
146 float GetApertureDensity() const {
147 return _apertureAngle;
148 }
149
150 float GetApertureNSides() const {
151 return _apertureNSides;
152 }
153
154 float GetApertureRoundness() const {
155 return _apertureRoundness;
156 }
157
158private:
160
161#if HD_API_VERSION < 52
162 float _lensDistortionK1;
163 float _lensDistortionK2;
164 GfVec2f _lensDistortionCenter;
165 float _lensDistortionAnaSq;
166 GfVec2f _lensDistortionAsym;
167 float _lensDistortionScale;
168#endif
169
180 ShutterCurve _shutterCurve;
181
182 float _apertureAngle;
183 float _apertureDensity;
184 int _apertureNSides;
185 float _apertureRoundness;
186};
187
188
189PXR_NAMESPACE_CLOSE_SCOPE
190
191#endif // EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CAMERA_H
Basic type for a vector of 2 float components.
Definition: vec2f.h:63
Hydra schema for a camera that pulls the params (see above) during Sync.
Definition: camera.h:104
A representation for cameras that pulls on camera parameters used by Riley cameras.
Definition: camera.h:48
HDPRMAN_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Synchronizes state from the delegate to this object.
HDPRMAN_API HdTimeSampleArray< GfMatrix4d, HDPRMAN_MAX_TIME_SAMPLES > const & GetTimeSampleXforms() const
Returns the time sampled xforms that were queried during Sync.
Definition: camera.h:75
const ShutterCurve & GetShutterCurve() const
Get the shutter curve of the camera.
Definition: camera.h:138
See GetShutterCurve() below for a description of what these values represent.
Definition: camera.h:54
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:228
An array of a value sampled over time, in struct-of-arrays layout.