add usd-21-05-win64_py37

This commit is contained in:
Sébastien Albert committed 2021-12-07 17:16:25 +01:00
1 parent 41d23e71ba
commit 66bc054336
15675 files changed
+3061008

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
//
// Copyright 2017 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef PXR_IMAGING_CAMERA_UTIL_API_H
#define PXR_IMAGING_CAMERA_UTIL_API_H
#include "pxr/base/arch/export.h"
#if defined(PXR_STATIC)
# define CAMERAUTIL_API
# define CAMERAUTIL_API_TEMPLATE_CLASS(...)
# define CAMERAUTIL_API_TEMPLATE_STRUCT(...)
# define CAMERAUTIL_LOCAL
#else
# if defined(CAMERAUTIL_EXPORTS)
# define CAMERAUTIL_API ARCH_EXPORT
# define CAMERAUTIL_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define CAMERAUTIL_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define CAMERAUTIL_API ARCH_IMPORT
# define CAMERAUTIL_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define CAMERAUTIL_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define CAMERAUTIL_LOCAL ARCH_HIDDEN
#endif
#endif // PXR_IMAGING_CAMERA_UTIL_API_H
@@ -0,0 +1,117 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef PXR_IMAGING_CAMERA_UTIL_CONFORM_WINDOW_H
#define PXR_IMAGING_CAMERA_UTIL_CONFORM_WINDOW_H
#include "pxr/pxr.h"
#include "pxr/imaging/cameraUtil/api.h"
PXR_NAMESPACE_OPEN_SCOPE
class GfVec2d;
class GfVec4d;
class GfMatrix4d;
class GfRange2d;
class GfCamera;
class GfFrustum;
/// \enum CameraUtilConformWindowPolicy
///
/// Policy of how to conform a window to the given aspect ratio.
/// An ASCII-art explanation is given in the corresponding .cpp file.
///
enum CameraUtilConformWindowPolicy {
/// Modify width
CameraUtilMatchVertically,
/// Modify height
CameraUtilMatchHorizontally,
/// Increase width or height
CameraUtilFit,
/// Decrease width or height
CameraUtilCrop,
/// Leave unchanged (This can result in stretching/shrinking if not pre-fit)
CameraUtilDontConform
};
/// Returns a window with aspect ratio \p targetAspect by applying
/// \p policy to \p window where \p window is encoded as GfRange2d.
CAMERAUTIL_API
GfRange2d
CameraUtilConformedWindow(
const GfRange2d &window,
CameraUtilConformWindowPolicy policy, double targetAspect);
/// Returns a window with aspect ratio \p targetAspect by applying
/// \p policy to \p window where \p window is encoded as vector
/// (left, right, bottom, top) similarly to RenderMan's RiScreenWindow.
CAMERAUTIL_API
GfVec4d
CameraUtilConformedWindow(
const GfVec4d &window,
CameraUtilConformWindowPolicy policy, double targetAspect);
/// Returns a window with aspect ratio \p targetAspect by applying
/// \p policy to \p window where \p window is encoded as vector
/// (width, height).
CAMERAUTIL_API
GfVec2d
CameraUtilConformedWindow(
const GfVec2d &window,
CameraUtilConformWindowPolicy policy, double targetAspect);
/// Conforms the given \p projectionMatrix to have aspect ratio \p targetAspect
/// by applying \p policy.
///
/// Note that this function also supports mirroring about the x- or y-axis of
/// the image corresponding to flipping all signs in the second, respectively,
/// third column of the projection matrix. In other words, we get the same
/// result whether we flip the signs in the matrix and then give it to this
/// function or call this function first and flip the signs of the resulting
/// matrix.
CAMERAUTIL_API
GfMatrix4d
CameraUtilConformedWindow(
const GfMatrix4d &projectionMatrix,
CameraUtilConformWindowPolicy policy, double targetAspect);
/// Conforms the given \p camera to have aspect ratio \p targetAspect
/// by applying \p policy.
CAMERAUTIL_API
void
CameraUtilConformWindow(
GfCamera *camera,
CameraUtilConformWindowPolicy policy, double targetAspect);
/// Conforms the given \p frustum to have aspect ratio \p targetAspect
/// by applying \p policy.
CAMERAUTIL_API
void
CameraUtilConformWindow(
GfFrustum *frustum,
CameraUtilConformWindowPolicy policy, double targetAspect);
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+138
View File
@@ -0,0 +1,138 @@
//
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef PXR_IMAGING_CAMERA_UTIL_FRAMING_H
#define PXR_IMAGING_CAMERA_UTIL_FRAMING_H
#include "pxr/pxr.h"
#include "pxr/imaging/cameraUtil/api.h"
#include "pxr/imaging/cameraUtil/conformWindow.h"
#include "pxr/base/gf/rect2i.h"
#include "pxr/base/gf/range2f.h"
PXR_NAMESPACE_OPEN_SCOPE
/// \class CameraUtilFraming
///
/// Framing information. That is information determining how the filmback
/// plane of a camera maps to the pixels of the rendered image (displayWindow
/// together with pixelAspectRatio and window policy) and what pixels of the
/// image will be filled by the renderer (dataWindow).
///
/// The concepts of displayWindow and dataWindow are similar to the ones in
/// OpenEXR, including that the x- and y-axis of the coordinate system point
/// left and down, respectively.
///
/// In fact, these windows mean the same here and in OpenEXR if the
/// displayWindow has the same aspect ratio (when accounting for the
/// pixelAspectRatio) as the filmback plane of the camera has (that is the
/// ratio of the horizontalAperture to verticalAperture of, e.g., Usd's Camera
/// or GfCamera).
///
/// In particular, overscan can be achieved by making the dataWindow larger
/// than the displayWindow.
///
/// If the aspect ratios differ, a window policy is applied to the
/// displayWindow to determine how the pixels correspond to the
/// filmback plane. One such window policy is to take the largest
/// rect that fits (centered) into the displayWindow and has the
/// camera's aspect ratio. For example, if the displayWindow and dataWindow
/// are the same and both have an aspect ratio smaller than the camera, the
/// image is created by enlarging the camera frustum slightly in the bottom
/// and top direction.
///
/// When using the AOVs, the render buffer size is determined
/// independently from the framing info. However, the dataWindow is
/// supposed to be contained in the render buffer rect (in particular,
/// the dataWindow cannot contain pixels withs negative coordinates -
/// this restriction does not apply if, e.g., hdPrman circumvents AOVs
/// and writes directly to EXR). In other words, unlike in OpenEXR,
/// the rect of pixels for which we allocate storage can differ from
/// the rect the renderer fills with data (dataWindow).
///
/// For example, an application can set the render buffer size to match
/// the widget size but use a dataWindow and displayWindow that only fills
/// the render buffer horizontally to have slates at the top and bottom.
///
class CameraUtilFraming final
{
public:
/// Creates an invalid framing, i.e., with empty display and data
/// window.
CAMERAUTIL_API
CameraUtilFraming();
/// Creates a framing with given display and data window and pixel
/// aspect ratio.
///
CAMERAUTIL_API
CameraUtilFraming(
const GfRange2f &displayWindow,
const GfRect2i &dataWindow,
float pixelAspectRatio = 1.0);
/// Creates a framing with equal display and data window (and
/// assuming square pixels).
///
CAMERAUTIL_API
explicit CameraUtilFraming(
const GfRect2i &dataWindow);
/// Is display and data window non-empty.
CAMERAUTIL_API
bool IsValid() const;
CAMERAUTIL_API
bool operator==(const CameraUtilFraming& other) const;
CAMERAUTIL_API
bool operator!=(const CameraUtilFraming& other) const;
/// Given the projectionMatrix computed from a camera, applies
/// the framing. To obtain a correct result, a rasterizer needs
/// to use the resulting projection matrix and set the viewport
/// to the data window.
///
CAMERAUTIL_API
GfMatrix4d ApplyToProjectionMatrix(
const GfMatrix4d &projectionMatrix,
CameraUtilConformWindowPolicy windowPolicy) const;
/// The display window. It will be conformed to the camera's
/// aspect ratio and then mapped to the filmback plane.
GfRange2f displayWindow;
/// The data window. That is the rect of pixels that the renderer
/// will fill.
GfRect2i dataWindow;
/// The ratio of the width to the height of a pixel - same as
/// OpenEXR.
float pixelAspectRatio;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
@@ -0,0 +1,78 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef PXR_IMAGING_CAMERA_UTIL_SCREEN_WINDOW_PARAMETERS_H
#define PXR_IMAGING_CAMERA_UTIL_SCREEN_WINDOW_PARAMETERS_H
#include "pxr/pxr.h"
#include "pxr/imaging/cameraUtil/api.h"
#include "pxr/base/gf/camera.h"
PXR_NAMESPACE_OPEN_SCOPE
/// \class CameraUtilScreenWindowParameters
///
/// Given a camera object, compute parameters suitable for setting up
/// RenderMan.
///
class CameraUtilScreenWindowParameters
{
public:
/// Constructs screenwindow parameter. The optional \p fitDirection
/// indicates in which direction the screenwindow will have length 2.
CAMERAUTIL_API
CameraUtilScreenWindowParameters(const GfCamera &camera,
GfCamera::FOVDirection fitDirection =
GfCamera::FOVHorizontal);
/// The vector (left, right, bottom, top) defining the rectangle in the
/// image plane.
/// Give these parameters to RiScreenWindow.
const GfVec4d & GetScreenWindow() const { return _screenWindow; }
/// The field of view. More precisely, the full angle perspective field
/// of view (in degrees) between screen space coordinates (-1,0) and
/// (1,0).
/// Give these parameters to RiProjection as parameter after
/// "perspective".
double GetFieldOfView() const { return _fieldOfView; }
/// Returns the inverse of the transform for a camera that is y-Up
/// and z-facing (vs the OpenGL camera that is (-z)-facing).
/// Write this transform with RiConcatTransform before
/// RiWorldBegin.
const GfMatrix4d & GetZFacingViewMatrix() const {
return _zFacingViewMatrix;
}
private:
GfVec4d _screenWindow;
double _fieldOfView;
GfMatrix4d _zFacingViewMatrix;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // PXR_IMAGING_CAMERA_UTIL_SCREEN_WINDOW_PARAMETERS_H