18 #ifndef EQFABRIC_VIEWPORT_H 19 #define EQFABRIC_VIEWPORT_H 22 #include <eq/fabric/types.h> 23 #include <eq/fabric/vmmlib.h> 25 #include <lunchbox/debug.h> 31 std::ostream&
operator<<(std::ostream& os,
const Viewport& vp);
49 Viewport(
const float x_,
const float y_,
const float w_,
const float h_)
80 LBASSERTINFO(rhs.
isValid(), rhs);
92 x = (
x - rhs.
x) / rhs.
w;
93 y = (
y - rhs.
y) / rhs.
h;
102 return (
x == rhs.
x &&
y == rhs.
y &&
w == rhs.
w &&
h == rhs.
h);
111 return (
x != rhs.
x ||
y != rhs.
y ||
w != rhs.
w ||
h != rhs.
h);
121 return (
x >= 0.0f &&
y >= 0.0f &&
w >= 0.0f &&
h >= 0.0f);
157 const float sEx =
static_cast<float>(
x +
w);
158 const float sEy =
static_cast<float>(
y +
h);
159 const float dEx =
static_cast<float>(rhs.
x + rhs.
w);
160 const float dEy =
static_cast<float>(rhs.
y + rhs.
h);
162 x = LB_MAX(
x, rhs.
x);
163 y = LB_MAX(
y, rhs.
y);
164 w = LB_MIN(sEx, dEx) -
x;
165 h = LB_MIN(sEy, dEy) -
y;
173 x = LB_MIN(x, rhs.
x);
174 y = LB_MIN(
y, rhs.
y);
196 const Vector4i& overdraw);
208 os <<
"[ " << vp.
x <<
" " << vp.
y <<
" " << vp.
w <<
" " << vp.
h <<
" ]";
214 #endif // EQFABRIC_VIEWPORT_H
Defines export visibility macros for library EqualizerFabric.
A fractional viewport with methods for manipulation.
bool operator!=(const Viewport &rhs) const
Viewport getCoverage(const Viewport &with) const
Compute the coverage of another viewport on this viewport.
Viewport(const Vector4f &from)
Construct a fractional viewport from a Vector4f.
void intersect(const Viewport &rhs)
Create the intersection of the two viewports.
Viewport()
Construct a full fractional viewport.
void transform(const Viewport &rhs)
Transform this viewport into the rhs viewport space.
void invalidate()
Make the viewport invalid.
bool operator==(const Viewport &rhs) const
Viewport(const float x_, const float y_, const float w_, const float h_)
Construct a fractional viewport with default values.
The Equalizer client library.
static EQFABRIC_API const Viewport FULL
A full viewport.
EQFABRIC_API void applyView(const Viewport &segmentVP, const Viewport &viewVP, const PixelViewport &pvp, const Vector4i &overdraw)
Apply the view coverage to this viewport.
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
void apply(const Viewport &rhs)
Apply (accumulate) another viewport.
Holds a 2D pixel viewport with methods for manipulation.
void unite(const Viewport &rhs)
Create the union of the two viewports.