HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
camera.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef USDGEOM_GENERATED_CAMERA_H
8 #define USDGEOM_GENERATED_CAMERA_H
9 
10 /// \file usdGeom/camera.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdGeom/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 #include "pxr/usd/usdGeom/tokens.h"
18 
19 #include "pxr/base/gf/camera.h"
20 
21 #include "pxr/base/vt/value.h"
22 
23 #include "pxr/base/gf/vec3d.h"
24 #include "pxr/base/gf/vec3f.h"
25 #include "pxr/base/gf/matrix4d.h"
26 
27 #include "pxr/base/tf/token.h"
28 #include "pxr/base/tf/type.h"
29 
31 
32 class SdfAssetPath;
33 
34 // -------------------------------------------------------------------------- //
35 // CAMERA //
36 // -------------------------------------------------------------------------- //
37 
38 /// \class UsdGeomCamera
39 ///
40 /// Transformable camera.
41 ///
42 /// Describes optical properties of a camera via a common set of attributes
43 /// that provide control over the camera's frustum as well as its depth of
44 /// field. For stereo, the left and right camera are individual prims tagged
45 /// through the \ref UsdGeomCamera::GetStereoRoleAttr() "stereoRole attribute".
46 ///
47 /// There is a corresponding class GfCamera, which can hold the state of a
48 /// camera (at a particular time). \ref UsdGeomCamera::GetCamera() and
49 /// \ref UsdGeomCamera::SetFromCamera() convert between a USD camera prim and
50 /// a GfCamera.
51 ///
52 /// To obtain the camera's location in world space, call the following on a
53 /// UsdGeomCamera 'camera':
54 /// \code
55 /// GfMatrix4d camXform = camera.ComputeLocalToWorldTransform(time);
56 /// \endcode
57 /// \note
58 /// <b>Cameras in USD are always "Y up", regardless of the stage's orientation
59 /// (i.e. UsdGeomGetStageUpAxis()).</b> 'camXform' positions the camera in the
60 /// world, and the inverse transforms the world such that the camera is at the
61 /// origin, looking down the -Z axis, with +Y as the up axis, and +X pointing to
62 /// the right. This describes a __right handed coordinate system__.
63 ///
64 /// \section UsdGeom_CameraUnits Units of Measure for Camera Properties
65 ///
66 /// Despite the familiarity of millimeters for specifying some physical
67 /// camera properties, UsdGeomCamera opts for greater consistency with all
68 /// other UsdGeom schemas, which measure geometric properties in scene units,
69 /// as determined by UsdGeomGetStageMetersPerUnit(). We do make a
70 /// concession, however, in that lens and filmback properties are measured in
71 /// __tenths of a scene unit__ rather than "raw" scene units. This means
72 /// that with the fallback value of .01 for _metersPerUnit_ - i.e. scene unit
73 /// of centimeters - then these "tenth of scene unit" properties are
74 /// effectively millimeters.
75 ///
76 /// \note If one adds a Camera prim to a UsdStage whose scene unit is not
77 /// centimeters, the fallback values for filmback properties will be
78 /// incorrect (or at the least, unexpected) in an absolute sense; however,
79 /// proper imaging through a "default camera" with focusing disabled depends
80 /// only on ratios of the other properties, so the camera is still usable.
81 /// However, it follows that if even one property is authored in the correct
82 /// scene units, then they all must be.
83 ///
84 /// \section UsdGeom_CameraExposure Camera Exposure Model
85 ///
86 /// UsdGeomCamera models exposure by a camera in terms of exposure time, ISO,
87 /// f-stop, and exposure compensation, mirroring the controls on a real camera.
88 /// These parameters are provided by \ref UsdGeomCamera::GetExposureTimeAttr(),
89 /// \ref UsdGeomCamera::GetExposureIsoAttr(),
90 /// \ref UsdGeomCamera::GetExposureFStopAttr(),
91 /// and \ref UsdGeomCamera::GetExposureAttr(), respectively.
92 /// \ref UsdGeomCamera::GetExposureResponsivityAttr() provides an additional
93 /// scaling factor to model the overall responsivity of the system,
94 /// including response of the sensor and loss by the lens.
95 ///
96 /// The calculated scaling factor can be obtained from
97 /// \ref UsdGeomCamera::ComputeLinearExposureScale(). It is computed as:
98 /// \code
99 /// linearExposureScale = exposureResponsivity *
100 /// (exposureTime * (exposureIso/100) * pow(2, exposure))
101 /// / (exposureFStop * exposureFStop)
102 /// \endcode
103 ///
104 /// This scaling factor is combined from two parts: The first, known as the
105 /// __imaging ratio__ (in _steradian-second_), converts from incident luminance
106 /// at the front of the lens system, in _nit_ (_cd/m^2_), to photometric
107 /// exposure at the sensor in _lux-second_. The second, `exposureResponsivity`
108 /// (in _inverse lux-second_), converts from photometric exposure at the sensor,
109 /// in _lux-second_, to a unitless output signal.
110 ///
111 /// For a thorough treatment of this topic, see
112 /// https://github.com/wetadigital/physlight/blob/main/docs/physLight-v1.3-1bdb6ec3-20230805.pdf,
113 /// Section 2.2. Note that we are essentially implementing Equation 2.7, but are
114 /// choosing C such that it exactly cancels with the factor of pi in the
115 /// numerator, replacing it with a responsivity factor that defaults to 1.
116 ///
117 /// Renderers should simply multiply the brightness of the image by the exposure
118 /// scale. The default values for the exposure-related attributes combine to
119 /// give a scale of 1.0.
120 ///
121 /// \sa \ref UsdGeom_LinAlgBasics
122 ///
123 ///
124 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
125 /// that are text/tokens, the actual token is published and defined in \ref UsdGeomTokens.
126 /// So to set an attribute to the value "rightHanded", use UsdGeomTokens->rightHanded
127 /// as the value.
128 ///
130 {
131 public:
132  /// Compile time constant representing what kind of schema this class is.
133  ///
134  /// \sa UsdSchemaKind
136 
137  /// Construct a UsdGeomCamera on UsdPrim \p prim .
138  /// Equivalent to UsdGeomCamera::Get(prim.GetStage(), prim.GetPath())
139  /// for a \em valid \p prim, but will not immediately throw an error for
140  /// an invalid \p prim
141  explicit UsdGeomCamera(const UsdPrim& prim=UsdPrim())
142  : UsdGeomXformable(prim)
143  {
144  }
145 
146  /// Construct a UsdGeomCamera on the prim held by \p schemaObj .
147  /// Should be preferred over UsdGeomCamera(schemaObj.GetPrim()),
148  /// as it preserves SchemaBase state.
149  explicit UsdGeomCamera(const UsdSchemaBase& schemaObj)
150  : UsdGeomXformable(schemaObj)
151  {
152  }
153 
154  /// Destructor.
156  virtual ~UsdGeomCamera();
157 
158  /// Return a vector of names of all pre-declared attributes for this schema
159  /// class and all its ancestor classes. Does not include attributes that
160  /// may be authored by custom/extended methods of the schemas involved.
162  static const TfTokenVector &
163  GetSchemaAttributeNames(bool includeInherited=true);
164 
165  /// Return a UsdGeomCamera holding the prim adhering to this
166  /// schema at \p path on \p stage. If no prim exists at \p path on
167  /// \p stage, or if the prim at that path does not adhere to this schema,
168  /// return an invalid schema object. This is shorthand for the following:
169  ///
170  /// \code
171  /// UsdGeomCamera(stage->GetPrimAtPath(path));
172  /// \endcode
173  ///
175  static UsdGeomCamera
176  Get(const UsdStagePtr &stage, const SdfPath &path);
177 
178  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
179  /// is defined (according to UsdPrim::IsDefined()) on this stage.
180  ///
181  /// If a prim adhering to this schema at \p path is already defined on this
182  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
183  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
184  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
185  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
186  /// current EditTarget for any nonexistent, or existing but not \a Defined
187  /// ancestors.
188  ///
189  /// The given \a path must be an absolute prim path that does not contain
190  /// any variant selections.
191  ///
192  /// If it is impossible to author any of the necessary PrimSpecs, (for
193  /// example, in case \a path cannot map to the current UsdEditTarget's
194  /// namespace) issue an error and return an invalid \a UsdPrim.
195  ///
196  /// Note that this method may return a defined prim whose typeName does not
197  /// specify this schema class, in case a stronger typeName opinion overrides
198  /// the opinion at the current EditTarget.
199  ///
201  static UsdGeomCamera
202  Define(const UsdStagePtr &stage, const SdfPath &path);
203 
204 protected:
205  /// Returns the kind of schema this class belongs to.
206  ///
207  /// \sa UsdSchemaKind
209  UsdSchemaKind _GetSchemaKind() const override;
210 
211 private:
212  // needs to invoke _GetStaticTfType.
213  friend class UsdSchemaRegistry;
215  static const TfType &_GetStaticTfType();
216 
217  static bool _IsTypedSchema();
218 
219  // override SchemaBase virtuals.
221  const TfType &_GetTfType() const override;
222 
223 public:
224  // --------------------------------------------------------------------- //
225  // PROJECTION
226  // --------------------------------------------------------------------- //
227  ///
228  ///
229  /// | ||
230  /// | -- | -- |
231  /// | Declaration | `token projection = "perspective"` |
232  /// | C++ Type | TfToken |
233  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
234  /// | \ref UsdGeomTokens "Allowed Values" | perspective, orthographic |
237 
238  /// See GetProjectionAttr(), and also
239  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
240  /// If specified, author \p defaultValue as the attribute's default,
241  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
242  /// the default for \p writeSparsely is \c false.
244  UsdAttribute CreateProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
245 
246 public:
247  // --------------------------------------------------------------------- //
248  // HORIZONTALAPERTURE
249  // --------------------------------------------------------------------- //
250  /// Horizontal aperture in tenths of a scene unit; see
251  /// \ref UsdGeom_CameraUnits . Default is the equivalent of
252  /// the standard 35mm spherical projector aperture.
253  ///
254  /// | ||
255  /// | -- | -- |
256  /// | Declaration | `float horizontalAperture = 20.955` |
257  /// | C++ Type | float |
258  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
261 
262  /// See GetHorizontalApertureAttr(), and also
263  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
264  /// If specified, author \p defaultValue as the attribute's default,
265  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
266  /// the default for \p writeSparsely is \c false.
268  UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
269 
270 public:
271  // --------------------------------------------------------------------- //
272  // VERTICALAPERTURE
273  // --------------------------------------------------------------------- //
274  /// Vertical aperture in tenths of a scene unit; see
275  /// \ref UsdGeom_CameraUnits . Default is the equivalent of
276  /// the standard 35mm spherical projector aperture.
277  ///
278  /// | ||
279  /// | -- | -- |
280  /// | Declaration | `float verticalAperture = 15.2908` |
281  /// | C++ Type | float |
282  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
285 
286  /// See GetVerticalApertureAttr(), and also
287  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
288  /// If specified, author \p defaultValue as the attribute's default,
289  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
290  /// the default for \p writeSparsely is \c false.
292  UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
293 
294 public:
295  // --------------------------------------------------------------------- //
296  // HORIZONTALAPERTUREOFFSET
297  // --------------------------------------------------------------------- //
298  /// Horizontal aperture offset in the same units as
299  /// horizontalAperture. Defaults to 0.
300  ///
301  /// | ||
302  /// | -- | -- |
303  /// | Declaration | `float horizontalApertureOffset = 0` |
304  /// | C++ Type | float |
305  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
308 
309  /// See GetHorizontalApertureOffsetAttr(), and also
310  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
311  /// If specified, author \p defaultValue as the attribute's default,
312  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
313  /// the default for \p writeSparsely is \c false.
315  UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
316 
317 public:
318  // --------------------------------------------------------------------- //
319  // VERTICALAPERTUREOFFSET
320  // --------------------------------------------------------------------- //
321  /// Vertical aperture offset in the same units as
322  /// verticalAperture. Defaults to 0.
323  ///
324  /// | ||
325  /// | -- | -- |
326  /// | Declaration | `float verticalApertureOffset = 0` |
327  /// | C++ Type | float |
328  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
331 
332  /// See GetVerticalApertureOffsetAttr(), and also
333  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
334  /// If specified, author \p defaultValue as the attribute's default,
335  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
336  /// the default for \p writeSparsely is \c false.
338  UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
339 
340 public:
341  // --------------------------------------------------------------------- //
342  // FOCALLENGTH
343  // --------------------------------------------------------------------- //
344  /// Perspective focal length in tenths of a scene unit; see
345  /// \ref UsdGeom_CameraUnits .
346  ///
347  /// | ||
348  /// | -- | -- |
349  /// | Declaration | `float focalLength = 50` |
350  /// | C++ Type | float |
351  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
354 
355  /// See GetFocalLengthAttr(), and also
356  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
357  /// If specified, author \p defaultValue as the attribute's default,
358  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
359  /// the default for \p writeSparsely is \c false.
361  UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
362 
363 public:
364  // --------------------------------------------------------------------- //
365  // CLIPPINGRANGE
366  // --------------------------------------------------------------------- //
367  /// Near and far clipping distances in scene units; see
368  /// \ref UsdGeom_CameraUnits .
369  ///
370  /// | ||
371  /// | -- | -- |
372  /// | Declaration | `float2 clippingRange = (1, 1000000)` |
373  /// | C++ Type | GfVec2f |
374  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float2 |
377 
378  /// See GetClippingRangeAttr(), and also
379  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
380  /// If specified, author \p defaultValue as the attribute's default,
381  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
382  /// the default for \p writeSparsely is \c false.
384  UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
385 
386 public:
387  // --------------------------------------------------------------------- //
388  // CLIPPINGPLANES
389  // --------------------------------------------------------------------- //
390  /// Additional, arbitrarily oriented clipping planes.
391  /// A vector (a,b,c,d) encodes a clipping plane that cuts off
392  /// (x,y,z) with a * x + b * y + c * z + d * 1 < 0 where (x,y,z)
393  /// are the coordinates in the camera's space.
394  ///
395  /// | ||
396  /// | -- | -- |
397  /// | Declaration | `float4[] clippingPlanes = []` |
398  /// | C++ Type | VtArray<GfVec4f> |
399  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float4Array |
402 
403  /// See GetClippingPlanesAttr(), and also
404  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
405  /// If specified, author \p defaultValue as the attribute's default,
406  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
407  /// the default for \p writeSparsely is \c false.
409  UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
410 
411 public:
412  // --------------------------------------------------------------------- //
413  // FSTOP
414  // --------------------------------------------------------------------- //
415  /// Lens aperture. Defaults to 0.0, which turns off depth of field effects.
416  ///
417  /// | ||
418  /// | -- | -- |
419  /// | Declaration | `float fStop = 0` |
420  /// | C++ Type | float |
421  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
423  UsdAttribute GetFStopAttr() const;
424 
425  /// See GetFStopAttr(), and also
426  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
427  /// If specified, author \p defaultValue as the attribute's default,
428  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
429  /// the default for \p writeSparsely is \c false.
431  UsdAttribute CreateFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
432 
433 public:
434  // --------------------------------------------------------------------- //
435  // FOCUSDISTANCE
436  // --------------------------------------------------------------------- //
437  /// Distance from the camera to the focus plane in scene units; see
438  /// \ref UsdGeom_CameraUnits .
439  ///
440  /// | ||
441  /// | -- | -- |
442  /// | Declaration | `float focusDistance = 0` |
443  /// | C++ Type | float |
444  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
447 
448  /// See GetFocusDistanceAttr(), and also
449  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
450  /// If specified, author \p defaultValue as the attribute's default,
451  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
452  /// the default for \p writeSparsely is \c false.
454  UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
455 
456 public:
457  // --------------------------------------------------------------------- //
458  // STEREOROLE
459  // --------------------------------------------------------------------- //
460  /// If different from mono, the camera is intended to be the left
461  /// or right camera of a stereo setup.
462  ///
463  /// | ||
464  /// | -- | -- |
465  /// | Declaration | `uniform token stereoRole = "mono"` |
466  /// | C++ Type | TfToken |
467  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
468  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
469  /// | \ref UsdGeomTokens "Allowed Values" | mono, left, right |
472 
473  /// See GetStereoRoleAttr(), and also
474  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
475  /// If specified, author \p defaultValue as the attribute's default,
476  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
477  /// the default for \p writeSparsely is \c false.
479  UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
480 
481 public:
482  // --------------------------------------------------------------------- //
483  // SHUTTEROPEN
484  // --------------------------------------------------------------------- //
485  /// Frame relative shutter open time in UsdTimeCode units (negative
486  /// value indicates that the shutter opens before the current
487  /// frame time). Used for motion blur.
488  ///
489  /// | ||
490  /// | -- | -- |
491  /// | Declaration | `double shutter:open = 0` |
492  /// | C++ Type | double |
493  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
496 
497  /// See GetShutterOpenAttr(), and also
498  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
499  /// If specified, author \p defaultValue as the attribute's default,
500  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
501  /// the default for \p writeSparsely is \c false.
503  UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
504 
505 public:
506  // --------------------------------------------------------------------- //
507  // SHUTTERCLOSE
508  // --------------------------------------------------------------------- //
509  /// Frame relative shutter close time, analogous comments from
510  /// shutter:open apply. A value greater or equal to shutter:open
511  /// should be authored, otherwise there is no exposure and a
512  /// renderer should produce a black image. Used for motion blur.
513  ///
514  /// | ||
515  /// | -- | -- |
516  /// | Declaration | `double shutter:close = 0` |
517  /// | C++ Type | double |
518  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
521 
522  /// See GetShutterCloseAttr(), and also
523  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
524  /// If specified, author \p defaultValue as the attribute's default,
525  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
526  /// the default for \p writeSparsely is \c false.
528  UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
529 
530 public:
531  // --------------------------------------------------------------------- //
532  // EXPOSURE
533  // --------------------------------------------------------------------- //
534  /// Exposure compensation, as a log base-2 value. The default
535  /// of 0.0 has no effect. A value of 1.0 will double the
536  /// image-plane intensities in a rendered image; a value of
537  /// -1.0 will halve them.
538  ///
539  /// | ||
540  /// | -- | -- |
541  /// | Declaration | `float exposure = 0` |
542  /// | C++ Type | float |
543  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
546 
547  /// See GetExposureAttr(), and also
548  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
549  /// If specified, author \p defaultValue as the attribute's default,
550  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
551  /// the default for \p writeSparsely is \c false.
553  UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
554 
555 public:
556  // --------------------------------------------------------------------- //
557  // EXPOSUREISO
558  // --------------------------------------------------------------------- //
559  /// The speed rating of the sensor or film when calculating exposure.
560  /// Higher numbers give a brighter image, lower numbers darker.
561  ///
562  /// | ||
563  /// | -- | -- |
564  /// | Declaration | `float exposure:iso = 100` |
565  /// | C++ Type | float |
566  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
569 
570  /// See GetExposureIsoAttr(), and also
571  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
572  /// If specified, author \p defaultValue as the attribute's default,
573  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
574  /// the default for \p writeSparsely is \c false.
576  UsdAttribute CreateExposureIsoAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
577 
578 public:
579  // --------------------------------------------------------------------- //
580  // EXPOSURETIME
581  // --------------------------------------------------------------------- //
582  /// Time in seconds that the sensor is exposed to light when calculating exposure.
583  /// Longer exposure times create a brighter image, shorter times darker.
584  /// Note that shutter:open and shutter:close model essentially the
585  /// same property of a physical camera, but are for specifying the
586  /// size of the motion blur streak which is for practical purposes
587  /// useful to keep separate.
588  ///
589  /// | ||
590  /// | -- | -- |
591  /// | Declaration | `float exposure:time = 1` |
592  /// | C++ Type | float |
593  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
596 
597  /// See GetExposureTimeAttr(), and also
598  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
599  /// If specified, author \p defaultValue as the attribute's default,
600  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
601  /// the default for \p writeSparsely is \c false.
603  UsdAttribute CreateExposureTimeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
604 
605 public:
606  // --------------------------------------------------------------------- //
607  // EXPOSUREFSTOP
608  // --------------------------------------------------------------------- //
609  /// f-stop of the aperture when calculating exposure. Smaller numbers
610  /// create a brighter image, larger numbers darker.
611  /// Note that the `fStop` attribute also models the diameter of the camera
612  /// aperture, but for specifying depth of field. For practical
613  /// purposes it is useful to keep the exposure and the depth of field
614  /// controls separate.
615  ///
616  ///
617  /// | ||
618  /// | -- | -- |
619  /// | Declaration | `float exposure:fStop = 1` |
620  /// | C++ Type | float |
621  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
624 
625  /// See GetExposureFStopAttr(), and also
626  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
627  /// If specified, author \p defaultValue as the attribute's default,
628  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
629  /// the default for \p writeSparsely is \c false.
631  UsdAttribute CreateExposureFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
632 
633 public:
634  // --------------------------------------------------------------------- //
635  // EXPOSURERESPONSIVITY
636  // --------------------------------------------------------------------- //
637  /// Scalar multiplier representing overall responsivity of the
638  /// sensor system to light when calculating exposure. Intended to be
639  /// used as a per camera/lens system measured scaling value.
640  ///
641  /// | ||
642  /// | -- | -- |
643  /// | Declaration | `float exposure:responsivity = 1` |
644  /// | C++ Type | float |
645  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
648 
649  /// See GetExposureResponsivityAttr(), and also
650  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
651  /// If specified, author \p defaultValue as the attribute's default,
652  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
653  /// the default for \p writeSparsely is \c false.
655  UsdAttribute CreateExposureResponsivityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
656 
657 public:
658  // ===================================================================== //
659  // Feel free to add custom code below this line, it will be preserved by
660  // the code generator.
661  //
662  // Just remember to:
663  // - Close the class declaration with };
664  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
665  // - Close the include guard with #endif
666  // ===================================================================== //
667  // --(BEGIN CUSTOM CODE)--
668 
669  /// Creates a GfCamera object from the attribute values at \p time.
670  ///
672  GfCamera GetCamera(const UsdTimeCode &time) const;
673 
674  /// Write attribute values from \p camera for \p time.
675  /// These attributes will be updated:
676  /// - projection
677  /// - horizontalAperture
678  /// - horizontalApertureOffset
679  /// - verticalAperture
680  /// - verticalApertureOffset
681  /// - focalLength
682  /// - clippingRange
683  /// - clippingPlanes
684  /// - fStop
685  /// - focalDistance
686  /// - xformOpOrder and xformOp:transform
687  ///
688  /// \note This will clear any existing xformOpOrder and replace
689  /// it with a single xformOp:transform entry. The xformOp:transform
690  /// property is created or updated here to match the transform
691  /// on \p camera . This operation will fail if there are stronger xform op
692  /// opinions in the composed layer stack that are stronger than that of
693  /// the current edit target.
694  ///
696  void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
697 
698  /// Computes the ratio between incident luminance and photometric exposure
699  /// (in lux-seconds), given the <tt>exposure</tt>, <tt>exposure:iso</tt>,
700  /// <tt>exposure:fStop</tt>, <tt>exposure:time</tt> and
701  /// <tt>exposure:responsivity</tt> attributes.
702  ///
703  /// This is expected to be applied as a multiplier to the brightness of the
704  /// image generated by the renderer, and given physically meaningful
705  /// lighting values in the scene, allows the exposure controls on
706  /// UsdGeomCamera to behave like those of a real camera.
707  ///
710 };
711 
713 
714 #endif
USDGEOM_API UsdAttribute GetVerticalApertureOffsetAttr() const
USDGEOM_API UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateExposureTimeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetVerticalApertureAttr() const
static constexpr UsdTimeCode Default()
Definition: timeCode.h:113
Object-based representation of a camera.
Definition: camera.h:32
USDGEOM_API UsdAttribute CreateExposureIsoAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GT_API const UT_StringHolder time
USDGEOM_API UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USDGEOM_API UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateProjectionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetFocusDistanceAttr() const
USDGEOM_API GfCamera GetCamera(const UsdTimeCode &time) const
USDGEOM_API UsdAttribute CreateExposureFStopAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API float ComputeLinearExposureScale(UsdTimeCode time=UsdTimeCode::Default()) const
USDGEOM_API UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetClippingPlanesAttr() const
USDGEOM_API void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time)
USDGEOM_API UsdAttribute GetClippingRangeAttr() const
Represents a concrete typed schema.
USDGEOM_API UsdAttribute GetHorizontalApertureOffsetAttr() const
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
virtual USDGEOM_API ~UsdGeomCamera()
Destructor.
USDGEOM_API UsdAttribute GetShutterCloseAttr() const
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDGEOM_API UsdAttribute GetStereoRoleAttr() const
UsdGeomCamera(const UsdSchemaBase &schemaObj)
Definition: camera.h:149
USDGEOM_API UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: path.h:273
USDGEOM_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static USDGEOM_API UsdGeomCamera Get(const UsdStagePtr &stage, const SdfPath &path)
static const UsdSchemaKind schemaKind
Definition: camera.h:135
UsdSchemaKind
Definition: common.h:112
USDGEOM_API UsdAttribute GetExposureFStopAttr() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDGEOM_API UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetExposureIsoAttr() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDGEOM_API UsdAttribute GetProjectionAttr() const
USDGEOM_API UsdAttribute GetExposureAttr() const
UsdGeomCamera(const UsdPrim &prim=UsdPrim())
Definition: camera.h:141
Definition: type.h:47
USDGEOM_API UsdAttribute GetFocalLengthAttr() const
USDGEOM_API UsdAttribute GetExposureResponsivityAttr() const
USDGEOM_API UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
#define USDGEOM_API
Definition: api.h:23
USDGEOM_API UsdAttribute GetFStopAttr() const
USDGEOM_API UsdAttribute CreateExposureResponsivityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateFStopAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetShutterOpenAttr() const
Definition: value.h:146
static USDGEOM_API UsdGeomCamera Define(const UsdStagePtr &stage, const SdfPath &path)
USDGEOM_API UsdAttribute GetHorizontalApertureAttr() const
USDGEOM_API UsdAttribute GetExposureTimeAttr() const