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
73 ///
74 class HdCameraSchema : public HdSchema
75 {
76 public:
77  /// \name Schema retrieval
78  /// @{
79 
80  HdCameraSchema(HdContainerDataSourceHandle container)
81  : HdSchema(container) {}
82 
83  /// Retrieves a container data source with the schema's default name token
84  /// "camera" from the parent container and constructs a
85  /// HdCameraSchema instance.
86  /// Because the requested container data source may not exist, the result
87  /// should be checked with IsDefined() or a bool comparison before use.
88  HD_API
90  const HdContainerDataSourceHandle &fromParentContainer);
91 
92  /// @}
93 
94 // --(BEGIN CUSTOM CODE: Schema Methods)--
95 // --(END CUSTOM CODE: Schema Methods)--
96 
97  /// \name Member accessor
98  /// @{
99 
100  HD_API
102 
103  HD_API
105 
106  HD_API
108 
109  HD_API
111 
112  HD_API
114 
115  HD_API
117 
118  HD_API
120 
121  HD_API
123 
124  HD_API
126 
127  HD_API
129 
130  HD_API
132 
133  HD_API
135 
136  HD_API
138 
139  HD_API
141 
142  HD_API
144 
145  HD_API
147 
148  HD_API
150 
151  HD_API
153 
154  HD_API
156 
157  HD_API
159 
160  HD_API
162 
163  HD_API
165 
166  HD_API
168 
169  /// @}
170 
171  /// \name Schema location
172  /// @{
173 
174  /// Returns a token where the container representing this schema is found in
175  /// a container by default.
176  HD_API
177  static const TfToken &GetSchemaToken();
178 
179  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
180  /// where the container representing this schema is found by default.
181  HD_API
182  static const HdDataSourceLocator &GetDefaultLocator();
183 
184  /// @}
185 
186  /// \name Data source locators for members
187  ///
188  /// The following methods return an HdDataSourceLocator (relative to the
189  /// prim-level data source) where the data source for a member can be found.
190  ///
191  /// This is often useful for checking intersection against the
192  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
193  /// @{
194 
195  /// Prim-level relative data source locator to locate shutterOpen.
196  HD_API
198 
199  /// Prim-level relative data source locator to locate shutterClose.
200  HD_API
202 
203  /// Prim-level relative data source locator to locate exposure.
204  HD_API
205  static const HdDataSourceLocator &GetExposureLocator();
206 
207  /// Prim-level relative data source locator to locate exposureTime.
208  HD_API
210 
211  /// Prim-level relative data source locator to locate exposureIso.
212  HD_API
214 
215  /// Prim-level relative data source locator to locate exposureFStop.
216  HD_API
218 
219  /// Prim-level relative data source locator to locate exposureResponsivity.
220  HD_API
222 
223  /// Prim-level relative data source locator to locate linearExposureScale.
224  HD_API
226 
227  /// Prim-level relative data source locator to locate namespacedProperties.
228  HD_API
230  /// @}
231 
232  /// \name Schema construction
233  /// @{
234 
235  /// \deprecated Use Builder instead.
236  ///
237  /// Builds a container data source which includes the provided child data
238  /// sources. Parameters with nullptr values are excluded. This is a
239  /// low-level interface. For cases in which it's desired to define
240  /// the container with a sparse set of child fields, the Builder class
241  /// is often more convenient and readable.
242  HD_API
243  static HdContainerDataSourceHandle
245  const HdTokenDataSourceHandle &projection,
246  const HdFloatDataSourceHandle &horizontalAperture,
247  const HdFloatDataSourceHandle &verticalAperture,
248  const HdFloatDataSourceHandle &horizontalApertureOffset,
249  const HdFloatDataSourceHandle &verticalApertureOffset,
250  const HdFloatDataSourceHandle &focalLength,
251  const HdVec2fDataSourceHandle &clippingRange,
252  const HdVec4dArrayDataSourceHandle &clippingPlanes,
253  const HdFloatDataSourceHandle &fStop,
254  const HdFloatDataSourceHandle &focusDistance,
255  const HdDoubleDataSourceHandle &shutterOpen,
256  const HdDoubleDataSourceHandle &shutterClose,
257  const HdFloatDataSourceHandle &exposure,
258  const HdFloatDataSourceHandle &exposureTime,
259  const HdFloatDataSourceHandle &exposureIso,
260  const HdFloatDataSourceHandle &exposureFStop,
261  const HdFloatDataSourceHandle &exposureResponsivity,
262  const HdFloatDataSourceHandle &linearExposureScale,
263  const HdBoolDataSourceHandle &focusOn,
264  const HdFloatDataSourceHandle &dofAspect,
265  const HdContainerDataSourceHandle &splitDiopter,
266  const HdContainerDataSourceHandle &lensDistortion,
267  const HdContainerDataSourceHandle &namespacedProperties
268  );
269 
270  /// \class HdCameraSchema::Builder
271  ///
272  /// Utility class for setting sparse sets of child data source fields to be
273  /// filled as arguments into BuildRetained. Because all setter methods
274  /// return a reference to the instance, this can be used in the "builder
275  /// pattern" form.
276  class Builder
277  {
278  public:
279  HD_API
281  const HdTokenDataSourceHandle &projection);
282  HD_API
284  const HdFloatDataSourceHandle &horizontalAperture);
285  HD_API
287  const HdFloatDataSourceHandle &verticalAperture);
288  HD_API
290  const HdFloatDataSourceHandle &horizontalApertureOffset);
291  HD_API
293  const HdFloatDataSourceHandle &verticalApertureOffset);
294  HD_API
296  const HdFloatDataSourceHandle &focalLength);
297  HD_API
299  const HdVec2fDataSourceHandle &clippingRange);
300  HD_API
302  const HdVec4dArrayDataSourceHandle &clippingPlanes);
303  HD_API
304  Builder &SetFStop(
305  const HdFloatDataSourceHandle &fStop);
306  HD_API
308  const HdFloatDataSourceHandle &focusDistance);
309  HD_API
311  const HdDoubleDataSourceHandle &shutterOpen);
312  HD_API
314  const HdDoubleDataSourceHandle &shutterClose);
315  HD_API
317  const HdFloatDataSourceHandle &exposure);
318  HD_API
320  const HdFloatDataSourceHandle &exposureTime);
321  HD_API
323  const HdFloatDataSourceHandle &exposureIso);
324  HD_API
326  const HdFloatDataSourceHandle &exposureFStop);
327  HD_API
329  const HdFloatDataSourceHandle &exposureResponsivity);
330  HD_API
332  const HdFloatDataSourceHandle &linearExposureScale);
333  HD_API
335  const HdBoolDataSourceHandle &focusOn);
336  HD_API
338  const HdFloatDataSourceHandle &dofAspect);
339  HD_API
341  const HdContainerDataSourceHandle &splitDiopter);
342  HD_API
344  const HdContainerDataSourceHandle &lensDistortion);
345  HD_API
347  const HdContainerDataSourceHandle &namespacedProperties);
348 
349  /// Returns a container data source containing the members set thus far.
350  HD_API
351  HdContainerDataSourceHandle Build();
352 
353  private:
354  HdTokenDataSourceHandle _projection;
355  HdFloatDataSourceHandle _horizontalAperture;
356  HdFloatDataSourceHandle _verticalAperture;
357  HdFloatDataSourceHandle _horizontalApertureOffset;
358  HdFloatDataSourceHandle _verticalApertureOffset;
359  HdFloatDataSourceHandle _focalLength;
360  HdVec2fDataSourceHandle _clippingRange;
361  HdVec4dArrayDataSourceHandle _clippingPlanes;
363  HdFloatDataSourceHandle _focusDistance;
364  HdDoubleDataSourceHandle _shutterOpen;
365  HdDoubleDataSourceHandle _shutterClose;
366  HdFloatDataSourceHandle _exposure;
367  HdFloatDataSourceHandle _exposureTime;
368  HdFloatDataSourceHandle _exposureIso;
369  HdFloatDataSourceHandle _exposureFStop;
370  HdFloatDataSourceHandle _exposureResponsivity;
371  HdFloatDataSourceHandle _linearExposureScale;
372  HdBoolDataSourceHandle _focusOn;
373  HdFloatDataSourceHandle _dofAspect;
374  HdContainerDataSourceHandle _splitDiopter;
375  HdContainerDataSourceHandle _lensDistortion;
376  HdContainerDataSourceHandle _namespacedProperties;
377 
378  };
379 
380  /// Returns token data source for use as projection value.
381  ///
382  /// The following values will be stored statically and reused for future
383  /// calls:
384  /// - HdCameraSchemaTokens->perspective
385  /// - HdCameraSchemaTokens->orthographic
386  HD_API
388  const TfToken &projection);
389 
390  /// @}
391 };
392 
394 
395 #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.
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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:80
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)
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