HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdCamera Class Reference

#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 ~HdCamera () override
 
HD_API void Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
 Sprim API. More...
 
HD_API HdDirtyBits GetInitialDirtyBitsMask () const override
 
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
 
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
 
HD_API GfMatrix4d ComputeProjectionMatrix () const
 Convenience API for rasterizers. More...
 
- Public Member Functions inherited from HdSprim
HD_API HdSprim (SdfPath const &id)
 
virtual HD_API ~HdSprim ()
 
SdfPath const & GetId () const
 
virtual HD_API void Finalize (HdRenderParam *renderParam)
 

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

Member Typedef Documentation

using HdCamera::ClipPlanesVector = std::vector<GfVec4d>

Definition at line 106 of file camera.h.

Member Enumeration Documentation

Enumerator
Clean 
DirtyTransform 
DirtyParams 
DirtyClipPlanes 
DirtyWindowPolicy 
AllDirty 

Definition at line 114 of file camera.h.

Enumerator
Perspective 
Orthographic 

Definition at line 127 of file camera.h.

Constructor & Destructor Documentation

HD_API HdCamera::HdCamera ( SdfPath const &  id)
HD_API HdCamera::~HdCamera ( )
override

Member Function Documentation

HD_API GfMatrix4d HdCamera::ComputeProjectionMatrix ( ) const

Convenience API for rasterizers.

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

GfRange1f const& HdCamera::GetClippingRange ( ) const
inline

Returns near and far plane in world units.

Definition at line 189 of file camera.h.

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

Returns any additional clipping planes defined in camera space.

Definition at line 194 of file camera.h.

float HdCamera::GetDofAspect ( ) const
inline

Definition at line 212 of file camera.h.

float HdCamera::GetExposure ( ) const
inline

Definition at line 256 of file camera.h.

float HdCamera::GetFocalLength ( ) const
inline

Returns focal length in world units.

Definition at line 184 of file camera.h.

float HdCamera::GetFocusDistance ( ) const
inline

Returns focus distance in world units.

Definition at line 204 of file camera.h.

bool HdCamera::GetFocusOn ( ) const
inline

Definition at line 208 of file camera.h.

float HdCamera::GetFStop ( ) const
inline

Returns fstop of camera.

Definition at line 199 of file camera.h.

float HdCamera::GetHorizontalAperture ( ) const
inline

Returns horizontal aperture in world units.

Definition at line 164 of file camera.h.

float HdCamera::GetHorizontalApertureOffset ( ) const
inline

Returns horizontal aperture offset in world units.

Definition at line 174 of file camera.h.

HD_API HdDirtyBits HdCamera::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.

float HdCamera::GetLensDistortionAnaSq ( ) const
inline

Definition at line 276 of file camera.h.

const GfVec2f& HdCamera::GetLensDistortionAsym ( ) const
inline

Definition at line 280 of file camera.h.

const GfVec2f& HdCamera::GetLensDistortionCenter ( ) const
inline

Definition at line 272 of file camera.h.

float HdCamera::GetLensDistortionIor ( ) const
inline

Definition at line 288 of file camera.h.

float HdCamera::GetLensDistortionK1 ( ) const
inline

Definition at line 264 of file camera.h.

float HdCamera::GetLensDistortionK2 ( ) const
inline

Definition at line 268 of file camera.h.

float HdCamera::GetLensDistortionScale ( ) const
inline

Definition at line 284 of file camera.h.

TfToken HdCamera::GetLensDistortionType ( ) const
inline

Definition at line 260 of file camera.h.

Projection HdCamera::GetProjection ( ) const
inline

Returns whether camera is orthographic and perspective.

Definition at line 159 of file camera.h.

double HdCamera::GetShutterClose ( ) const
inline

Definition at line 252 of file camera.h.

double HdCamera::GetShutterOpen ( ) const
inline

Definition at line 248 of file camera.h.

float HdCamera::GetSplitDiopterAngle ( ) const
inline

Definition at line 220 of file camera.h.

int HdCamera::GetSplitDiopterCount ( ) const
inline

Definition at line 216 of file camera.h.

float HdCamera::GetSplitDiopterFocusDistance1 ( ) const
inline

Definition at line 232 of file camera.h.

float HdCamera::GetSplitDiopterFocusDistance2 ( ) const
inline

Definition at line 244 of file camera.h.

float HdCamera::GetSplitDiopterOffset1 ( ) const
inline

Definition at line 224 of file camera.h.

float HdCamera::GetSplitDiopterOffset2 ( ) const
inline

Definition at line 236 of file camera.h.

float HdCamera::GetSplitDiopterWidth1 ( ) const
inline

Definition at line 228 of file camera.h.

float HdCamera::GetSplitDiopterWidth2 ( ) const
inline

Definition at line 240 of file camera.h.

GfMatrix4d const& HdCamera::GetTransform ( ) const
inline

Camera parameters accessor API.

Returns camera transform

Definition at line 154 of file camera.h.

float HdCamera::GetVerticalAperture ( ) const
inline

Returns vertical aperture in world units.

Definition at line 169 of file camera.h.

float HdCamera::GetVerticalApertureOffset ( ) const
inline

Returns vertical aperture offset in world units.

Definition at line 179 of file camera.h.

const CameraUtilConformWindowPolicy& HdCamera::GetWindowPolicy ( ) const
inline

Returns the window policy of the camera. If no opinion is authored, we default to "CameraUtilFit"

Definition at line 294 of file camera.h.

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

Sprim API.

Synchronizes state from the delegate to this object.

Implements HdSprim.

Member Data Documentation

GfRange1f HdCamera::_clippingRange
protected

Definition at line 316 of file camera.h.

std::vector<GfVec4d> HdCamera::_clipPlanes
protected

Definition at line 317 of file camera.h.

float HdCamera::_dofAspect
protected

Definition at line 323 of file camera.h.

float HdCamera::_exposure
protected

Definition at line 336 of file camera.h.

float HdCamera::_focalLength
protected

Definition at line 315 of file camera.h.

float HdCamera::_focusDistance
protected

Definition at line 321 of file camera.h.

bool HdCamera::_focusOn
protected

Definition at line 322 of file camera.h.

float HdCamera::_fStop
protected

Definition at line 320 of file camera.h.

float HdCamera::_horizontalAperture
protected

Definition at line 311 of file camera.h.

float HdCamera::_horizontalApertureOffset
protected

Definition at line 313 of file camera.h.

float HdCamera::_lensDistortionAnaSq
protected

Definition at line 343 of file camera.h.

GfVec2f HdCamera::_lensDistortionAsym
protected

Definition at line 344 of file camera.h.

GfVec2f HdCamera::_lensDistortionCenter
protected

Definition at line 342 of file camera.h.

float HdCamera::_lensDistortionIor
protected

Definition at line 346 of file camera.h.

float HdCamera::_lensDistortionK1
protected

Definition at line 340 of file camera.h.

float HdCamera::_lensDistortionK2
protected

Definition at line 341 of file camera.h.

float HdCamera::_lensDistortionScale
protected

Definition at line 345 of file camera.h.

TfToken HdCamera::_lensDistortionType
protected

Definition at line 339 of file camera.h.

Projection HdCamera::_projection
protected

Definition at line 310 of file camera.h.

double HdCamera::_shutterClose
protected

Definition at line 335 of file camera.h.

double HdCamera::_shutterOpen
protected

Definition at line 334 of file camera.h.

float HdCamera::_splitDiopterAngle
protected

Definition at line 325 of file camera.h.

int HdCamera::_splitDiopterCount
protected

Definition at line 324 of file camera.h.

float HdCamera::_splitDiopterFocusDistance1
protected

Definition at line 328 of file camera.h.

float HdCamera::_splitDiopterFocusDistance2
protected

Definition at line 331 of file camera.h.

float HdCamera::_splitDiopterOffset1
protected

Definition at line 326 of file camera.h.

float HdCamera::_splitDiopterOffset2
protected

Definition at line 329 of file camera.h.

float HdCamera::_splitDiopterWidth1
protected

Definition at line 327 of file camera.h.

float HdCamera::_splitDiopterWidth2
protected

Definition at line 330 of file camera.h.

GfMatrix4d HdCamera::_transform
protected

Definition at line 309 of file camera.h.

float HdCamera::_verticalAperture
protected

Definition at line 312 of file camera.h.

float HdCamera::_verticalApertureOffset
protected

Definition at line 314 of file camera.h.

CameraUtilConformWindowPolicy HdCamera::_windowPolicy
protected

Definition at line 350 of file camera.h.


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