7#ifndef PXR_IMAGING_HD_CAMERA_H
8#define PXR_IMAGING_HD_CAMERA_H
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/sprim.h"
15#include "pxr/imaging/cameraUtil/conformWindow.h"
24PXR_NAMESPACE_OPEN_SCOPE
31#define HD_CAMERA_TOKENS \
34 (horizontalAperture) \
36 (horizontalApertureOffset) \
37 (verticalApertureOffset) \
47 ((splitDiopterCount, "splitDiopter:count")) \
48 ((splitDiopterAngle, "splitDiopter:angle")) \
49 ((splitDiopterOffset1, "splitDiopter:offset1")) \
50 ((splitDiopterWidth1, "splitDiopter:width1")) \
51 ((splitDiopterFocusDistance1, "splitDiopter:focusDistance1")) \
52 ((splitDiopterOffset2, "splitDiopter:offset2")) \
53 ((splitDiopterWidth2, "splitDiopter:width2")) \
54 ((splitDiopterFocusDistance2, "splitDiopter:focusDistance2")) \
67 ((lensDistortionType, "lensDistortion:type")) \
68 ((lensDistortionK1, "lensDistortion:k1")) \
69 ((lensDistortionK2, "lensDistortion:k2")) \
70 ((lensDistortionCenter, "lensDistortion:center")) \
71 ((lensDistortionAnaSq, "lensDistortion:anaSq")) \
72 ((lensDistortionAsym, "lensDistortion:asym")) \
73 ((lensDistortionScale, "lensDistortion:scale")) \
74 ((lensDistortionIor, "lensDistortion:ior"))
89 using ClipPlanesVector = std::vector<GfVec4d>;
97 enum DirtyBits : HdDirtyBits
100 DirtyTransform = 1 << 0,
101 DirtyParams = 1 << 1,
102 DirtyClipPlanes = 1 << 2,
103 DirtyWindowPolicy = 1 << 3,
104 AllDirty = (DirtyTransform
123 HdDirtyBits *dirtyBits)
override;
148 return _horizontalAperture;
153 return _verticalAperture;
158 return _horizontalApertureOffset;
163 return _verticalApertureOffset;
173 return _clippingRange;
188 return _focusDistance;
191 bool GetFocusOn()
const {
195 float GetDofAspect()
const {
199 int GetSplitDiopterCount()
const {
200 return _splitDiopterCount;
203 float GetSplitDiopterAngle()
const {
204 return _splitDiopterAngle;
207 float GetSplitDiopterOffset1()
const {
208 return _splitDiopterOffset1;
211 float GetSplitDiopterWidth1()
const {
212 return _splitDiopterWidth1;
215 float GetSplitDiopterFocusDistance1()
const {
216 return _splitDiopterFocusDistance1;
219 float GetSplitDiopterOffset2()
const {
220 return _splitDiopterOffset2;
223 float GetSplitDiopterWidth2()
const {
224 return _splitDiopterWidth2;
227 float GetSplitDiopterFocusDistance2()
const {
228 return _splitDiopterFocusDistance2;
231 double GetShutterOpen()
const {
235 double GetShutterClose()
const {
236 return _shutterClose;
239 float GetExposure()
const {
243 TfToken GetLensDistortionType()
const {
244 return _lensDistortionType;
247 float GetLensDistortionK1()
const {
248 return _lensDistortionK1;
251 float GetLensDistortionK2()
const {
252 return _lensDistortionK2;
255 const GfVec2f& GetLensDistortionCenter()
const {
256 return _lensDistortionCenter;
259 float GetLensDistortionAnaSq()
const {
260 return _lensDistortionAnaSq;
263 const GfVec2f& GetLensDistortionAsym()
const {
264 return _lensDistortionAsym;
267 float GetLensDistortionScale()
const {
268 return _lensDistortionScale;
271 float GetLensDistortionIor()
const {
272 return _lensDistortionIor;
278 return _windowPolicy;
293 Projection _projection;
294 float _horizontalAperture;
295 float _verticalAperture;
296 float _horizontalApertureOffset;
297 float _verticalApertureOffset;
300 std::vector<GfVec4d> _clipPlanes;
304 float _focusDistance;
307 int _splitDiopterCount;
308 float _splitDiopterAngle;
309 float _splitDiopterOffset1;
310 float _splitDiopterWidth1;
311 float _splitDiopterFocusDistance1;
312 float _splitDiopterOffset2;
313 float _splitDiopterWidth2;
314 float _splitDiopterFocusDistance2;
318 double _shutterClose;
323 float _lensDistortionK1;
324 float _lensDistortionK2;
326 float _lensDistortionAnaSq;
328 float _lensDistortionScale;
329 float _lensDistortionIor;
333 CameraUtilConformWindowPolicy _windowPolicy;
336PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of double elements.
Basic type: 1-dimensional floating point range.
Basic type for a vector of 2 float components.
Hydra schema for a camera that pulls the params (see above) during Sync.
float GetHorizontalApertureOffset() const
Returns horizontal aperture offset in world units.
float GetFocusDistance() const
Returns focus distance in world units.
float GetHorizontalAperture() const
Returns horizontal aperture in world units.
HD_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Sprim API.
GfMatrix4d const & GetTransform() const
Camera parameters accessor API.
std::vector< GfVec4d > const & GetClipPlanes() const
Returns any additional clipping planes defined in camera space.
float GetFStop() const
Returns fstop of camera.
float GetVerticalAperture() const
Returns vertical aperture in world units.
float GetFocalLength() const
Returns focal length in world units.
HD_API HdDirtyBits GetInitialDirtyBitsMask() const override
Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of thi...
float GetVerticalApertureOffset() const
Returns vertical aperture offset in world units.
HD_API GfMatrix4d ComputeProjectionMatrix() const
Convenience API for rasterizers.
Projection GetProjection() const
Returns whether camera is orthographic and perspective.
GfRange1f const & GetClippingRange() const
Returns near and far plane in world units.
const CameraUtilConformWindowPolicy & GetWindowPolicy() const
Returns the window policy of the camera.
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.
Sprim (state prim) is a base class of managing state for non-drawable scene entity (e....
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.