6#include <Common/assertion.h>
60 Viewport(
std::move(baseSizePx), math::
TAABB2D<int64>({0, 0}, {baseSizePx.x(), baseSizePx.y() }))
64 m_baseSizePx(
std::move(baseSizePx)),
65 m_windowPx (
std::move(windowPx))
67 PH_ASSERT(!m_windowPx.
isEmpty());
84 return intersectedWindowPx;
89 return static_cast<std::size_t
>(m_baseSizePx.
x()) * m_baseSizePx.
y();
104 return "viewport base: " + m_baseSizePx.
toString() +
", window: " + m_windowPx.
toString();
bool hasView() const
Whether there is any viewable area in the viewport.
Definition Viewport.h:97
std::size_t numCroppedRegionPixels() const
Definition Viewport.h:92
Viewport()
Creates empty viewport.
Definition Viewport.h:55
std::size_t numBasePixels() const
Definition Viewport.h:87
const math::TVector2< uint32 > & getBaseSizePx() const
The full size of this viewport.
Definition Viewport.h:70
const math::TAABB2D< int64 > & getWindowPx() const
The window that limits the viewing area of this viewport.
Definition Viewport.h:75
math::TAABB2D< int64 > getCroppedRegionPx() const
The viewing area of this viewport. The difference between cropped region and window is that cropped r...
Definition Viewport.h:80
std::string toString() const
Definition Viewport.h:102
A 2-D Axis-Aligned Bounding Box (AABB).
Definition TAABB2D.h:26
TAABB2D & intersectWith(const TAABB2D &other)
Definition TAABB2D.ipp:86
bool isEmpty() const
Definition TAABB2D.ipp:193
std::string toString() const
Definition TAABB2D.ipp:235
T getArea() const
Definition TAABB2D.ipp:69
Represents a 2-D vector.
Definition TVector2.h:19
T & x()
Definition TVector2.ipp:38
T & y()
Definition TVector2.ipp:44
std::string toString() const
Definition TArithmeticArrayBase.ipp:825
The root for all renderer implementations.
Definition EEngineProject.h:6