This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
HdCamera Class Reference

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

#include <camera.h>

+ 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.
 
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.
 
GfMatrix4d const & GetTransform () const
 Camera parameters accessor API.
 
Projection GetProjection () const
 Returns whether camera is orthographic and perspective.
 
float GetHorizontalAperture () const
 Returns horizontal aperture in world units.
 
float GetVerticalAperture () const
 Returns vertical aperture in world units.
 
float GetHorizontalApertureOffset () const
 Returns horizontal aperture offset in world units.
 
float GetVerticalApertureOffset () const
 Returns vertical aperture offset in world units.
 
float GetFocalLength () const
 Returns focal length in world units.
 
GfRange1f const & GetClippingRange () const
 Returns near and far plane in world units.
 
std::vector< GfVec4d > const & GetClipPlanes () const
 Returns any additional clipping planes defined in camera space.
 
float GetFStop () const
 Returns fstop of camera.
 
float GetFocusDistance () const
 Returns focus distance in world units.
 
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
 
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.
 
HD_API GfMatrix4d ComputeProjectionMatrix () const
 Convenience API for rasterizers.
 
- 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.
 
virtual void Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits)=0
 Synchronizes state from the delegate to this object.
 
virtual HD_API void Finalize (HdRenderParam *renderParam)
 Finalizes object resources.
 
virtual HdDirtyBits GetInitialDirtyBitsMask () const =0
 Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of this prim.
 

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
 
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 86 of file camera.h.

Member Typedef Documentation

◆ ClipPlanesVector

using ClipPlanesVector = std::vector<GfVec4d>

Definition at line 89 of file camera.h.

Member Enumeration Documentation

◆ DirtyBits

enum DirtyBits : HdDirtyBits

Definition at line 97 of file camera.h.

◆ Projection

enum Projection

Definition at line 110 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 172 of file camera.h.

◆ GetClipPlanes()

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

Returns any additional clipping planes defined in camera space.

Definition at line 177 of file camera.h.

◆ GetDofAspect()

float GetDofAspect ( ) const
inline

Definition at line 195 of file camera.h.

◆ GetExposure()

float GetExposure ( ) const
inline

Definition at line 239 of file camera.h.

◆ GetFocalLength()

float GetFocalLength ( ) const
inline

Returns focal length in world units.

Definition at line 167 of file camera.h.

◆ GetFocusDistance()

float GetFocusDistance ( ) const
inline

Returns focus distance in world units.

Definition at line 187 of file camera.h.

◆ GetFocusOn()

bool GetFocusOn ( ) const
inline

Definition at line 191 of file camera.h.

◆ GetFStop()

float GetFStop ( ) const
inline

Returns fstop of camera.

Definition at line 182 of file camera.h.

◆ GetHorizontalAperture()

float GetHorizontalAperture ( ) const
inline

Returns horizontal aperture in world units.

Definition at line 147 of file camera.h.

◆ GetHorizontalApertureOffset()

float GetHorizontalApertureOffset ( ) const
inline

Returns horizontal aperture offset in world units.

Definition at line 157 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.

◆ GetLensDistortionAnaSq()

float GetLensDistortionAnaSq ( ) const
inline

Definition at line 259 of file camera.h.

◆ GetLensDistortionAsym()

const GfVec2f & GetLensDistortionAsym ( ) const
inline

Definition at line 263 of file camera.h.

◆ GetLensDistortionCenter()

const GfVec2f & GetLensDistortionCenter ( ) const
inline

Definition at line 255 of file camera.h.

◆ GetLensDistortionIor()

float GetLensDistortionIor ( ) const
inline

Definition at line 271 of file camera.h.

◆ GetLensDistortionK1()

float GetLensDistortionK1 ( ) const
inline

Definition at line 247 of file camera.h.

◆ GetLensDistortionK2()

float GetLensDistortionK2 ( ) const
inline

Definition at line 251 of file camera.h.

◆ GetLensDistortionScale()

float GetLensDistortionScale ( ) const
inline

Definition at line 267 of file camera.h.

◆ GetLensDistortionType()

TfToken GetLensDistortionType ( ) const
inline

Definition at line 243 of file camera.h.

◆ GetProjection()

Projection GetProjection ( ) const
inline

Returns whether camera is orthographic and perspective.

Definition at line 142 of file camera.h.

◆ GetShutterClose()

double GetShutterClose ( ) const
inline

Definition at line 235 of file camera.h.

◆ GetShutterOpen()

double GetShutterOpen ( ) const
inline

Definition at line 231 of file camera.h.

◆ GetSplitDiopterAngle()

float GetSplitDiopterAngle ( ) const
inline

Definition at line 203 of file camera.h.

◆ GetSplitDiopterCount()

int GetSplitDiopterCount ( ) const
inline

Definition at line 199 of file camera.h.

◆ GetSplitDiopterFocusDistance1()

float GetSplitDiopterFocusDistance1 ( ) const
inline

Definition at line 215 of file camera.h.

◆ GetSplitDiopterFocusDistance2()

float GetSplitDiopterFocusDistance2 ( ) const
inline

Definition at line 227 of file camera.h.

◆ GetSplitDiopterOffset1()

float GetSplitDiopterOffset1 ( ) const
inline

Definition at line 207 of file camera.h.

◆ GetSplitDiopterOffset2()

float GetSplitDiopterOffset2 ( ) const
inline

Definition at line 219 of file camera.h.

◆ GetSplitDiopterWidth1()

float GetSplitDiopterWidth1 ( ) const
inline

Definition at line 211 of file camera.h.

◆ GetSplitDiopterWidth2()

float GetSplitDiopterWidth2 ( ) const
inline

Definition at line 223 of file camera.h.

◆ GetTransform()

GfMatrix4d const & GetTransform ( ) const
inline

Camera parameters accessor API.

Returns camera transform

Definition at line 137 of file camera.h.

◆ GetVerticalAperture()

float GetVerticalAperture ( ) const
inline

Returns vertical aperture in world units.

Definition at line 152 of file camera.h.

◆ GetVerticalApertureOffset()

float GetVerticalApertureOffset ( ) const
inline

Returns vertical aperture offset in world units.

Definition at line 162 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 277 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.

Reimplemented in HdPrmanCamera.

Member Data Documentation

◆ _clippingRange

GfRange1f _clippingRange
protected

Definition at line 299 of file camera.h.

◆ _clipPlanes

std::vector<GfVec4d> _clipPlanes
protected

Definition at line 300 of file camera.h.

◆ _dofAspect

float _dofAspect
protected

Definition at line 306 of file camera.h.

◆ _exposure

float _exposure
protected

Definition at line 319 of file camera.h.

◆ _focalLength

float _focalLength
protected

Definition at line 298 of file camera.h.

◆ _focusDistance

float _focusDistance
protected

Definition at line 304 of file camera.h.

◆ _focusOn

bool _focusOn
protected

Definition at line 305 of file camera.h.

◆ _fStop

float _fStop
protected

Definition at line 303 of file camera.h.

◆ _horizontalAperture

float _horizontalAperture
protected

Definition at line 294 of file camera.h.

◆ _horizontalApertureOffset

float _horizontalApertureOffset
protected

Definition at line 296 of file camera.h.

◆ _lensDistortionAnaSq

float _lensDistortionAnaSq
protected

Definition at line 326 of file camera.h.

◆ _lensDistortionAsym

GfVec2f _lensDistortionAsym
protected

Definition at line 327 of file camera.h.

◆ _lensDistortionCenter

GfVec2f _lensDistortionCenter
protected

Definition at line 325 of file camera.h.

◆ _lensDistortionIor

float _lensDistortionIor
protected

Definition at line 329 of file camera.h.

◆ _lensDistortionK1

float _lensDistortionK1
protected

Definition at line 323 of file camera.h.

◆ _lensDistortionK2

float _lensDistortionK2
protected

Definition at line 324 of file camera.h.

◆ _lensDistortionScale

float _lensDistortionScale
protected

Definition at line 328 of file camera.h.

◆ _lensDistortionType

TfToken _lensDistortionType
protected

Definition at line 322 of file camera.h.

◆ _projection

Projection _projection
protected

Definition at line 293 of file camera.h.

◆ _shutterClose

double _shutterClose
protected

Definition at line 318 of file camera.h.

◆ _shutterOpen

double _shutterOpen
protected

Definition at line 317 of file camera.h.

◆ _splitDiopterAngle

float _splitDiopterAngle
protected

Definition at line 308 of file camera.h.

◆ _splitDiopterCount

int _splitDiopterCount
protected

Definition at line 307 of file camera.h.

◆ _splitDiopterFocusDistance1

float _splitDiopterFocusDistance1
protected

Definition at line 311 of file camera.h.

◆ _splitDiopterFocusDistance2

float _splitDiopterFocusDistance2
protected

Definition at line 314 of file camera.h.

◆ _splitDiopterOffset1

float _splitDiopterOffset1
protected

Definition at line 309 of file camera.h.

◆ _splitDiopterOffset2

float _splitDiopterOffset2
protected

Definition at line 312 of file camera.h.

◆ _splitDiopterWidth1

float _splitDiopterWidth1
protected

Definition at line 310 of file camera.h.

◆ _splitDiopterWidth2

float _splitDiopterWidth2
protected

Definition at line 313 of file camera.h.

◆ _transform

GfMatrix4d _transform
protected

Definition at line 292 of file camera.h.

◆ _verticalAperture

float _verticalAperture
protected

Definition at line 295 of file camera.h.

◆ _verticalApertureOffset

float _verticalApertureOffset
protected

Definition at line 297 of file camera.h.

◆ _windowPolicy

CameraUtilConformWindowPolicy _windowPolicy
protected

Definition at line 333 of file camera.h.


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