HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
conformWindow.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 PXR_IMAGING_CAMERA_UTIL_CONFORM_WINDOW_H
8
#define PXR_IMAGING_CAMERA_UTIL_CONFORM_WINDOW_H
9
10
#include "
pxr/pxr.h
"
11
#include "
pxr/imaging/cameraUtil/api.h
"
12
13
PXR_NAMESPACE_OPEN_SCOPE
14
15
class
GfVec2d
;
16
class
GfVec4d
;
17
class
GfMatrix4d
;
18
class
GfRange2d
;
19
class
GfCamera
;
20
class
GfFrustum
;
21
22
/// \enum CameraUtilConformWindowPolicy
23
///
24
/// Policy of how to conform a window to the given aspect ratio.
25
/// An ASCII-art explanation is given in the corresponding .cpp file.
26
///
27
enum
CameraUtilConformWindowPolicy
{
28
/// Modify width
29
CameraUtilMatchVertically
,
30
/// Modify height
31
CameraUtilMatchHorizontally
,
32
/// Increase width or height
33
CameraUtilFit
,
34
/// Decrease width or height
35
CameraUtilCrop
,
36
/// Leave unchanged (This can result in stretching/shrinking if not pre-fit)
37
CameraUtilDontConform
38
};
39
40
/// Returns a window with aspect ratio \p targetAspect by applying
41
/// \p policy to \p window where \p window is encoded as GfRange2d.
42
CAMERAUTIL_API
43
GfRange2d
44
CameraUtilConformedWindow
(
45
const
GfRange2d
&window,
46
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
47
48
/// Returns a window with aspect ratio \p targetAspect by applying
49
/// \p policy to \p window where \p window is encoded as vector
50
/// (left, right, bottom, top) similarly to RenderMan's RiScreenWindow.
51
CAMERAUTIL_API
52
GfVec4d
53
CameraUtilConformedWindow
(
54
const
GfVec4d
&window,
55
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
56
57
/// Returns a window with aspect ratio \p targetAspect by applying
58
/// \p policy to \p window where \p window is encoded as vector
59
/// (width, height).
60
CAMERAUTIL_API
61
GfVec2d
62
CameraUtilConformedWindow
(
63
const
GfVec2d
&window,
64
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
65
66
/// Conforms the given \p projectionMatrix to have aspect ratio \p targetAspect
67
/// by applying \p policy.
68
///
69
/// Note that this function also supports mirroring about the x- or y-axis of
70
/// the image corresponding to flipping all signs in the second, respectively,
71
/// third column of the projection matrix. In other words, we get the same
72
/// result whether we flip the signs in the matrix and then give it to this
73
/// function or call this function first and flip the signs of the resulting
74
/// matrix.
75
CAMERAUTIL_API
76
GfMatrix4d
77
CameraUtilConformedWindow
(
78
const
GfMatrix4d
&projectionMatrix,
79
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
80
81
/// Conforms the given \p camera to have aspect ratio \p targetAspect
82
/// by applying \p policy.
83
CAMERAUTIL_API
84
void
85
CameraUtilConformWindow
(
86
GfCamera
*camera,
87
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
88
89
/// Conforms the given \p frustum to have aspect ratio \p targetAspect
90
/// by applying \p policy.
91
CAMERAUTIL_API
92
void
93
CameraUtilConformWindow
(
94
GfFrustum
*frustum,
95
CameraUtilConformWindowPolicy
policy,
double
targetAspect);
96
97
98
PXR_NAMESPACE_CLOSE_SCOPE
99
100
#endif
GfCamera
Object-based representation of a camera.
Definition:
camera.h:32
CameraUtilConformWindow
CAMERAUTIL_API void CameraUtilConformWindow(GfCamera *camera, CameraUtilConformWindowPolicy policy, double targetAspect)
PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_OPEN_SCOPE
Definition:
pxr.h:73
GfVec4d
Definition:
vec4d.h:45
CameraUtilMatchHorizontally
Modify height.
Definition:
conformWindow.h:31
GfVec2d
Definition:
vec2d.h:45
CameraUtilCrop
Decrease width or height.
Definition:
conformWindow.h:35
CameraUtilMatchVertically
Modify width.
Definition:
conformWindow.h:29
GfMatrix4d
Definition:
matrix4d.h:70
pxr.h
GfRange2d
Definition:
range2d.h:46
GfFrustum
Definition:
frustum.h:71
api.h
CameraUtilConformWindowPolicy
CameraUtilConformWindowPolicy
Definition:
conformWindow.h:27
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
CameraUtilDontConform
Leave unchanged (This can result in stretching/shrinking if not pre-fit)
Definition:
conformWindow.h:37
CAMERAUTIL_API
#define CAMERAUTIL_API
Definition:
api.h:23
CameraUtilConformedWindow
CAMERAUTIL_API GfRange2d CameraUtilConformedWindow(const GfRange2d &window, CameraUtilConformWindowPolicy policy, double targetAspect)
CameraUtilFit
Increase width or height.
Definition:
conformWindow.h:33
pxr
imaging
cameraUtil
conformWindow.h
Generated on Tue Aug 4 2026 02:23:54 for HDK by
1.8.6