HdCamera Class Reference

Hydra schema for a camera that pulls the params (see above) during Sync. More...

+ Inheritance diagram for HdCamera:

Public Types

enum  DirtyBits : HdDirtyBits {
  Clean = 0, DirtyTransform = 1 << 0, DirtyParams = 1 << 1, DirtyClipPlanes = 1 << 2,
  DirtyWindowPolicy = 1 << 3, AllDirty
}
 
enum  Projection { Perspective = 0, Orthographic }
 
using ClipPlanesVector = std::vector< GfVec4d >
 

Public Member Functions

HD_API HdCamera (SdfPath const &id)
 
HD_API void Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
 Sprim API. More...
 
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 this prim. More...
 
GfMatrix4d const & GetTransform () const
 Camera parameters accessor API. More...
 
Projection GetProjection () const
 Returns whether camera is orthographic and perspective. More...
 
float GetHorizontalAperture () const
 Returns horizontal aperture in world units. More...
 
float GetVerticalAperture () const
 Returns vertical aperture in world units. More...
 
float GetHorizontalApertureOffset () const
 Returns horizontal aperture offset in world units. More...
 
float GetVerticalApertureOffset () const
 Returns vertical aperture offset in world units. More...
 
float GetFocalLength () const
 Returns focal length in world units. More...
 
GfRange1f const & GetClippingRange () const
 Returns near and far plane in world units. More...
 
std::vector< GfVec4d > const & GetClipPlanes () const
 Returns any additional clipping planes defined in camera space. More...
 
float GetFStop () const
 Returns fstop of camera. More...
 
float GetFocusDistance () const
 Returns focus distance in world units. More...
 
bool GetFocusOn () const
 
float GetDofAspect () const
 
int GetSplitDiopterCount () const
 
float GetSplitDiopterAngle () const
 
float GetSplitDiopterOffset1 () const
 
float GetSplitDiopterWidth1 () const
 
float GetSplitDiopterFocusDistance1 () const
 
float GetSplitDiopterOffset2 () const
 
float GetSplitDiopterWidth2 () const
 
float GetSplitDiopterFocusDistance2 () const
 
double GetShutterOpen () const
 
double GetShutterClose () const
 
float GetExposure () const
 Get the raw exposure exponent value. More...
 
float GetLinearExposureScale () const
 Get the computed linear exposure scale from the underlying camera. More...
 
TfToken GetLensDistortionType () const
 
float GetLensDistortionK1 () const
 
float GetLensDistortionK2 () const
 
const GfVec2fGetLensDistortionCenter () const
 
float GetLensDistortionAnaSq () const
 
const GfVec2fGetLensDistortionAsym () const
 
float GetLensDistortionScale () const
 
float GetLensDistortionIor () const
 
const CameraUtilConformWindowPolicy & GetWindowPolicy () const
 Returns the window policy of the camera. More...
 
HD_API GfMatrix4d ComputeProjectionMatrix () const
 Convenience API for rasterizers. More...
 
- Public Member Functions inherited from HdSprim
HD_API HdSprim (SdfPath const &id)
 
SdfPath const & GetId () const
 Returns the identifier by which this state is known. More...
 
virtual HD_API void Finalize (HdRenderParam *renderParam)
 Finalizes object resources. More...
 

Protected Attributes

GfMatrix4d _transform
 
Projection _projection
 
float _horizontalAperture
 
float _verticalAperture
 
float _horizontalApertureOffset
 
float _verticalApertureOffset
 
float _focalLength
 
GfRange1f _clippingRange
 
std::vector< GfVec4d_clipPlanes
 
float _fStop
 
float _focusDistance
 
bool _focusOn
 
float _dofAspect
 
int _splitDiopterCount
 
float _splitDiopterAngle
 
float _splitDiopterOffset1
 
float _splitDiopterWidth1
 
float _splitDiopterFocusDistance1
 
float _splitDiopterOffset2
 
float _splitDiopterWidth2
 
float _splitDiopterFocusDistance2
 
double _shutterOpen
 
double _shutterClose
 
float _exposure
 
float _exposureTime
 
float _exposureIso
 
float _exposureFStop
 
float _exposureResponsivity
 
float _linearExposureScale
 
TfToken _lensDistortionType
 
float _lensDistortionK1
 
float _lensDistortionK2
 
GfVec2f _lensDistortionCenter
 
float _lensDistortionAnaSq
 
GfVec2f _lensDistortionAsym
 
float _lensDistortionScale
 
float _lensDistortionIor
 
CameraUtilConformWindowPolicy _windowPolicy
 

Detailed Description

Hydra schema for a camera that pulls the params (see above) during Sync.

Backends that use additional camera parameters can inherit from HdCamera and pull on them.

Definition at line 91 of file camera.h.

Member Function Documentation

◆ ComputeProjectionMatrix()

HD_API GfMatrix4d ComputeProjectionMatrix ( ) const

Convenience API for rasterizers.

Computes the projection matrix for a camera from its physical properties.

◆ GetClippingRange()

GfRange1f const& GetClippingRange ( ) const
inline

Returns near and far plane in world units.

Definition at line 177 of file camera.h.

◆ GetClipPlanes()

std::vector<GfVec4d> const& GetClipPlanes ( ) const
inline

Returns any additional clipping planes defined in camera space.

Definition at line 182 of file camera.h.

◆ GetExposure()

float GetExposure ( ) const
inline

Get the raw exposure exponent value.

This the same as the value stored in the exposure attribute on the underlying camera. Note that in most cases, you will want to use GetLinearExposureScale() instead of this method, as it is the computed end result of all related exposure attributes. GetExposure() is retained as-is for backward compatibility.

Definition at line 251 of file camera.h.

◆ GetFocalLength()

float GetFocalLength ( ) const
inline

Returns focal length in world units.

Definition at line 172 of file camera.h.

◆ GetFocusDistance()

float GetFocusDistance ( ) const
inline

Returns focus distance in world units.

Definition at line 192 of file camera.h.

◆ GetFStop()

float GetFStop ( ) const
inline

Returns fstop of camera.

Definition at line 187 of file camera.h.

◆ GetHorizontalAperture()

float GetHorizontalAperture ( ) const
inline

Returns horizontal aperture in world units.

Definition at line 152 of file camera.h.

◆ GetHorizontalApertureOffset()

float GetHorizontalApertureOffset ( ) const
inline

Returns horizontal aperture offset in world units.

Definition at line 162 of file camera.h.

◆ GetInitialDirtyBitsMask()

HD_API HdDirtyBits GetInitialDirtyBitsMask ( ) const
overridevirtual

Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of this prim.

Typically this would be all dirty bits.

Implements HdSprim.

◆ GetLinearExposureScale()

float GetLinearExposureScale ( ) const
inline

Get the computed linear exposure scale from the underlying camera.

Scaling the image brightness by this value will cause the various exposure controls on UsdGeomCamera to behave like those of a real camera to control the exposure of the image.

Definition at line 260 of file camera.h.

◆ GetProjection()

Projection GetProjection ( ) const
inline

Returns whether camera is orthographic and perspective.

Definition at line 147 of file camera.h.

◆ GetTransform()

GfMatrix4d const& GetTransform ( ) const
inline

Camera parameters accessor API.

Returns camera transform

Definition at line 142 of file camera.h.

◆ GetVerticalAperture()

float GetVerticalAperture ( ) const
inline

Returns vertical aperture in world units.

Definition at line 157 of file camera.h.

◆ GetVerticalApertureOffset()

float GetVerticalApertureOffset ( ) const
inline

Returns vertical aperture offset in world units.

Definition at line 167 of file camera.h.

◆ GetWindowPolicy()

const CameraUtilConformWindowPolicy& GetWindowPolicy ( ) const
inline

Returns the window policy of the camera.

If no opinion is authored, we default to "CameraUtilFit"

Definition at line 298 of file camera.h.

◆ Sync()

HD_API void Sync ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdDirtyBits *  dirtyBits 
)
overridevirtual

Sprim API.

Synchronizes state from the delegate to this object.

Implements HdSprim.


The documentation for this class was generated from the following file: