HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cameraSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_CAMERA_SCHEMA_H
19 #define PXR_IMAGING_HD_CAMERA_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
27 
28 #include "pxr/imaging/hd/schema.h"
29 
30 // --(BEGIN CUSTOM CODE: Includes)--
31 // --(END CUSTOM CODE: Includes)--
32 
34 
35 // --(BEGIN CUSTOM CODE: Declares)--
36 // --(END CUSTOM CODE: Declares)--
37 
38 #define HD_CAMERA_SCHEMA_TOKENS \
39  (camera) \
40  (projection) \
41  (horizontalAperture) \
42  (verticalAperture) \
43  (horizontalApertureOffset) \
44  (verticalApertureOffset) \
45  (focalLength) \
46  (clippingRange) \
47  (clippingPlanes) \
48  (fStop) \
49  (focusDistance) \
50  (shutterOpen) \
51  (shutterClose) \
52  (exposure) \
53  (exposureTime) \
54  (exposureIso) \
55  (exposureFStop) \
56  (exposureResponsivity) \
57  (linearExposureScale) \
58  (focusOn) \
59  (dofAspect) \
60  (splitDiopter) \
61  (lensDistortion) \
62  (namespacedProperties) \
63  (perspective) \
64  (orthographic) \
65 
66 TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API,
68 
69 //-----------------------------------------------------------------------------
70 
71 
72 class HdCameraSchema : public HdSchema
73 {
74 public:
75  /// \name Schema retrieval
76  /// @{
77 
78  HdCameraSchema(HdContainerDataSourceHandle container)
79  : HdSchema(container) {}
80 
81  /// Retrieves a container data source with the schema's default name token
82  /// "camera" from the parent container and constructs a
83  /// HdCameraSchema instance.
84  /// Because the requested container data source may not exist, the result
85  /// should be checked with IsDefined() or a bool comparison before use.
86  HD_API
88  const HdContainerDataSourceHandle &fromParentContainer);
89 
90  /// @}
91 
92 // --(BEGIN CUSTOM CODE: Schema Methods)--
93 // --(END CUSTOM CODE: Schema Methods)--
94 
95  /// \name Member accessor
96  /// @{
97 
98  HD_API
100 
101  HD_API
103 
104  HD_API
106 
107  HD_API
109 
110  HD_API
112 
113  HD_API
115 
116  HD_API
118 
119  HD_API
121 
122  HD_API
124 
125  HD_API
127 
128  HD_API
130 
131  HD_API
133 
134  HD_API
136 
137  HD_API
139 
140  HD_API
142 
143  HD_API
145 
146  HD_API
148 
149  HD_API
151 
152  HD_API
154 
155  HD_API
157 
158  HD_API
160 
161  HD_API
163 
164  HD_API
166 
167  /// @}
168 
169  /// \name Schema location
170  /// @{
171 
172  /// Returns a token where the container representing this schema is found in
173  /// a container by default.
174  HD_API
175  static const TfToken &GetSchemaToken();
176 
177  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
178  /// where the container representing this schema is found by default.
179  HD_API
180  static const HdDataSourceLocator &GetDefaultLocator();
181 
182  /// @}
183 
184  /// \name Data source locators for members
185  ///
186  /// The following methods return an HdDataSourceLocator (relative to the
187  /// prim-level data source) where the data source for a member can be found.
188  ///
189  /// This is often useful for checking intersection against the
190  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
191  /// @{
192 
193  /// Prim-level relative data source locator to locate shutterOpen.
194  HD_API
196 
197  /// Prim-level relative data source locator to locate shutterClose.
198  HD_API
200 
201  /// Prim-level relative data source locator to locate exposure.
202  HD_API
203  static const HdDataSourceLocator &GetExposureLocator();
204 
205  /// Prim-level relative data source locator to locate exposureTime.
206  HD_API
208 
209  /// Prim-level relative data source locator to locate exposureIso.
210  HD_API
212 
213  /// Prim-level relative data source locator to locate exposureFStop.
214  HD_API
216 
217  /// Prim-level relative data source locator to locate exposureResponsivity.
218  HD_API
220 
221  /// Prim-level relative data source locator to locate linearExposureScale.
222  HD_API
224 
225  /// Prim-level relative data source locator to locate namespacedProperties.
226  HD_API
228  /// @}
229 
230  /// \name Schema construction
231  /// @{
232 
233  /// \deprecated Use Builder instead.
234  ///
235  /// Builds a container data source which includes the provided child data
236  /// sources. Parameters with nullptr values are excluded. This is a
237  /// low-level interface. For cases in which it's desired to define
238  /// the container with a sparse set of child fields, the Builder class
239  /// is often more convenient and readable.
240  HD_API
241  static HdContainerDataSourceHandle
243  const HdTokenDataSourceHandle &projection,
244  const HdFloatDataSourceHandle &horizontalAperture,
245  const HdFloatDataSourceHandle &verticalAperture,
246  const HdFloatDataSourceHandle &horizontalApertureOffset,
247  const HdFloatDataSourceHandle &verticalApertureOffset,
248  const HdFloatDataSourceHandle &focalLength,
249  const HdVec2fDataSourceHandle &clippingRange,
250  const HdVec4dArrayDataSourceHandle &clippingPlanes,
251  const HdFloatDataSourceHandle &fStop,
252  const HdFloatDataSourceHandle &focusDistance,
253  const HdDoubleDataSourceHandle &shutterOpen,
254  const HdDoubleDataSourceHandle &shutterClose,
255  const HdFloatDataSourceHandle &exposure,
256  const HdFloatDataSourceHandle &exposureTime,
257  const HdFloatDataSourceHandle &exposureIso,
258  const HdFloatDataSourceHandle &exposureFStop,
259  const HdFloatDataSourceHandle &exposureResponsivity,
260  const HdFloatDataSourceHandle &linearExposureScale,
261  const HdBoolDataSourceHandle &focusOn,
262  const HdFloatDataSourceHandle &dofAspect,
263  const HdContainerDataSourceHandle &splitDiopter,
264  const HdContainerDataSourceHandle &lensDistortion,
265  const HdContainerDataSourceHandle &namespacedProperties
266  );
267 
268  /// \class HdCameraSchema::Builder
269  ///
270  /// Utility class for setting sparse sets of child data source fields to be
271  /// filled as arguments into BuildRetained. Because all setter methods
272  /// return a reference to the instance, this can be used in the "builder
273  /// pattern" form.
274  class Builder
275  {
276  public:
277  HD_API
279  const HdTokenDataSourceHandle &projection);
280  HD_API
282  const HdFloatDataSourceHandle &horizontalAperture);
283  HD_API
285  const HdFloatDataSourceHandle &verticalAperture);
286  HD_API
288  const HdFloatDataSourceHandle &horizontalApertureOffset);
289  HD_API
291  const HdFloatDataSourceHandle &verticalApertureOffset);
292  HD_API
294  const HdFloatDataSourceHandle &focalLength);
295  HD_API
297  const HdVec2fDataSourceHandle &clippingRange);
298  HD_API
300  const HdVec4dArrayDataSourceHandle &clippingPlanes);
301  HD_API
302  Builder &SetFStop(
303  const HdFloatDataSourceHandle &fStop);
304  HD_API
306  const HdFloatDataSourceHandle &focusDistance);
307  HD_API
309  const HdDoubleDataSourceHandle &shutterOpen);
310  HD_API
312  const HdDoubleDataSourceHandle &shutterClose);
313  HD_API
315  const HdFloatDataSourceHandle &exposure);
316  HD_API
318  const HdFloatDataSourceHandle &exposureTime);
319  HD_API
321  const HdFloatDataSourceHandle &exposureIso);
322  HD_API
324  const HdFloatDataSourceHandle &exposureFStop);
325  HD_API
327  const HdFloatDataSourceHandle &exposureResponsivity);
328  HD_API
330  const HdFloatDataSourceHandle &linearExposureScale);
331  HD_API
333  const HdBoolDataSourceHandle &focusOn);
334  HD_API
336  const HdFloatDataSourceHandle &dofAspect);
337  HD_API
339  const HdContainerDataSourceHandle &splitDiopter);
340  HD_API
342  const HdContainerDataSourceHandle &lensDistortion);
343  HD_API
345  const HdContainerDataSourceHandle &namespacedProperties);
346 
347  /// Returns a container data source containing the members set thus far.
348  HD_API
349  HdContainerDataSourceHandle Build();
350 
351  private:
352  HdTokenDataSourceHandle _projection;
353  HdFloatDataSourceHandle _horizontalAperture;
354  HdFloatDataSourceHandle _verticalAperture;
355  HdFloatDataSourceHandle _horizontalApertureOffset;
356  HdFloatDataSourceHandle _verticalApertureOffset;
357  HdFloatDataSourceHandle _focalLength;
358  HdVec2fDataSourceHandle _clippingRange;
359  HdVec4dArrayDataSourceHandle _clippingPlanes;
361  HdFloatDataSourceHandle _focusDistance;
362  HdDoubleDataSourceHandle _shutterOpen;
363  HdDoubleDataSourceHandle _shutterClose;
364  HdFloatDataSourceHandle _exposure;
365  HdFloatDataSourceHandle _exposureTime;
366  HdFloatDataSourceHandle _exposureIso;
367  HdFloatDataSourceHandle _exposureFStop;
368  HdFloatDataSourceHandle _exposureResponsivity;
369  HdFloatDataSourceHandle _linearExposureScale;
370  HdBoolDataSourceHandle _focusOn;
371  HdFloatDataSourceHandle _dofAspect;
372  HdContainerDataSourceHandle _splitDiopter;
373  HdContainerDataSourceHandle _lensDistortion;
374  HdContainerDataSourceHandle _namespacedProperties;
375 
376  };
377 
378  /// Returns token data source for use as projection value.
379  ///
380  /// The following values will be stored statically and reused for future
381  /// calls:
382  /// - HdCameraSchemaTokens->perspective
383  /// - HdCameraSchemaTokens->orthographic
384  HD_API
386  const TfToken &projection);
387 
388  /// @}
389 };
390 
392 
393 #endif
static HD_API const HdDataSourceLocator & GetExposureResponsivityLocator()
Prim-level relative data source locator to locate exposureResponsivity.
HD_API Builder & SetFocusOn(const HdBoolDataSourceHandle &focusOn)
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HD_API HdSplitDiopterSchema GetSplitDiopter() const
HD_API HdFloatDataSourceHandle GetExposureResponsivity() const
HD_API HdVec4dArrayDataSourceHandle GetClippingPlanes() const
HdFloatDataSource::Handle HdFloatDataSourceHandle
HD_API HdFloatDataSourceHandle GetFocusDistance() const
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &projection, const HdFloatDataSourceHandle &horizontalAperture, const HdFloatDataSourceHandle &verticalAperture, const HdFloatDataSourceHandle &horizontalApertureOffset, const HdFloatDataSourceHandle &verticalApertureOffset, const HdFloatDataSourceHandle &focalLength, const HdVec2fDataSourceHandle &clippingRange, const HdVec4dArrayDataSourceHandle &clippingPlanes, const HdFloatDataSourceHandle &fStop, const HdFloatDataSourceHandle &focusDistance, const HdDoubleDataSourceHandle &shutterOpen, const HdDoubleDataSourceHandle &shutterClose, const HdFloatDataSourceHandle &exposure, const HdFloatDataSourceHandle &exposureTime, const HdFloatDataSourceHandle &exposureIso, const HdFloatDataSourceHandle &exposureFStop, const HdFloatDataSourceHandle &exposureResponsivity, const HdFloatDataSourceHandle &linearExposureScale, const HdBoolDataSourceHandle &focusOn, const HdFloatDataSourceHandle &dofAspect, const HdContainerDataSourceHandle &splitDiopter, const HdContainerDataSourceHandle &lensDistortion, const HdContainerDataSourceHandle &namespacedProperties)
static HD_API HdTokenDataSourceHandle BuildProjectionDataSource(const TfToken &projection)
static HD_API const HdDataSourceLocator & GetExposureTimeLocator()
Prim-level relative data source locator to locate exposureTime.
HD_API HdFloatDataSourceHandle GetHorizontalAperture() const
HD_API Builder & SetExposure(const HdFloatDataSourceHandle &exposure)
static HD_API const HdDataSourceLocator & GetShutterCloseLocator()
Prim-level relative data source locator to locate shutterClose.
HD_API Builder & SetShutterOpen(const HdDoubleDataSourceHandle &shutterOpen)
#define HD_API
Definition: api.h:23
HD_API HdDoubleDataSourceHandle GetShutterClose() const
HD_API HdFloatDataSourceHandle GetLinearExposureScale() const
static HD_API const HdDataSourceLocator & GetNamespacedPropertiesLocator()
Prim-level relative data source locator to locate namespacedProperties.
HD_API HdTokenDataSourceHandle GetProjection() const
HD_API HdFloatDataSourceHandle GetExposureFStop() const
HD_API HdFloatDataSourceHandle GetFocalLength() const
HD_API Builder & SetNamespacedProperties(const HdContainerDataSourceHandle &namespacedProperties)
#define HD_CAMERA_SCHEMA_TOKENS
Definition: cameraSchema.h:38
HD_API HdVec2fDataSourceHandle GetClippingRange() const
HD_API Builder & SetLensDistortion(const HdContainerDataSourceHandle &lensDistortion)
HD_API Builder & SetSplitDiopter(const HdContainerDataSourceHandle &splitDiopter)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:70
HD_API HdFloatDataSourceHandle GetExposure() const
HD_API HdFloatDataSourceHandle GetVerticalApertureOffset() const
HD_API HdFloatDataSourceHandle GetDofAspect() const
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetProjection(const HdTokenDataSourceHandle &projection)
HD_API Builder & SetFStop(const HdFloatDataSourceHandle &fStop)
HD_API Builder & SetShutterClose(const HdDoubleDataSourceHandle &shutterClose)
HD_API HdFloatDataSourceHandle GetExposureIso() const
HD_API HdFloatDataSourceHandle GetVerticalAperture() const
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API Builder & SetFocalLength(const HdFloatDataSourceHandle &focalLength)
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
static HD_API const TfToken & GetSchemaToken()
HdCameraSchema(HdContainerDataSourceHandle container)
Definition: cameraSchema.h:78
static HD_API const HdDataSourceLocator & GetShutterOpenLocator()
Prim-level relative data source locator to locate shutterOpen.
HD_API Builder & SetExposureTime(const HdFloatDataSourceHandle &exposureTime)
HD_API Builder & SetDofAspect(const HdFloatDataSourceHandle &dofAspect)
TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API, HD_CAMERA_SCHEMA_TOKENS)
HD_API Builder & SetExposureFStop(const HdFloatDataSourceHandle &exposureFStop)
static HD_API const HdDataSourceLocator & GetLinearExposureScaleLocator()
Prim-level relative data source locator to locate linearExposureScale.
static HD_API const HdDataSourceLocator & GetExposureFStopLocator()
Prim-level relative data source locator to locate exposureFStop.
HD_API HdFloatDataSourceHandle GetExposureTime() const
HD_API HdLensDistortionSchema GetLensDistortion() const
HD_API Builder & SetExposureIso(const HdFloatDataSourceHandle &exposureIso)
static HD_API HdCameraSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetClippingRange(const HdVec2fDataSourceHandle &clippingRange)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API const HdDataSourceLocator & GetExposureLocator()
Prim-level relative data source locator to locate exposure.
HD_API Builder & SetVerticalApertureOffset(const HdFloatDataSourceHandle &verticalApertureOffset)
HD_API Builder & SetFocusDistance(const HdFloatDataSourceHandle &focusDistance)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdVec4dArrayDataSource::Handle HdVec4dArrayDataSourceHandle
HD_API Builder & SetLinearExposureScale(const HdFloatDataSourceHandle &linearExposureScale)
HD_API HdDoubleDataSourceHandle GetShutterOpen() const
HD_API HdFloatDataSourceHandle GetFStop() const
static HD_API const HdDataSourceLocator & GetExposureIsoLocator()
Prim-level relative data source locator to locate exposureIso.
HD_API Builder & SetExposureResponsivity(const HdFloatDataSourceHandle &exposureResponsivity)
HD_API HdBoolDataSourceHandle GetFocusOn() const
HD_API Builder & SetVerticalAperture(const HdFloatDataSourceHandle &verticalAperture)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdFloatDataSourceHandle GetHorizontalApertureOffset() const
HD_API Builder & SetHorizontalApertureOffset(const HdFloatDataSourceHandle &horizontalApertureOffset)
HD_API Builder & SetClippingPlanes(const HdVec4dArrayDataSourceHandle &clippingPlanes)
HD_API Builder & SetHorizontalAperture(const HdFloatDataSourceHandle &horizontalAperture)
HD_API HdSampledDataSourceContainerContainerSchema GetNamespacedProperties() const