#include <painter_surface.hpp>
A Viewport specifies the sub-region within a Surface to which one renders.
Definition at line 70 of file painter_surface.hpp.
◆ Viewport()
fastuidraw::PainterSurface::Viewport::Viewport |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
◆ compute_clip_equations()
void fastuidraw::PainterSurface::Viewport::compute_clip_equations |
( |
ivec2 |
surface_dims, |
|
|
vecN< vec3, 4 > * |
out_clip_equations |
|
) |
| const |
Computes the clip-equations (in normalized device coordinates) of this Viewport against a surface with the given dimensions.
- Parameters
-
| surface_dims | dimension of surface |
[out] | out_clip_equations | location to which to write the clip equations |
◆ compute_normalized_clip_rect()
void fastuidraw::PainterSurface::Viewport::compute_normalized_clip_rect |
( |
ivec2 |
surface_dims, |
|
|
Rect * |
out_rect |
|
) |
| const |
Computes the rectangle in normalized device coordinates of the intersection of a backing surface with the given dimensions against this Viewport.
- Parameters
-
| surface_dims | dimension of surface |
[out] | out_rect | location to which to write the clipping rectangle in normalized device coordinates |
◆ compute_normalized_device_coords()
vec2 fastuidraw::PainterSurface::Viewport::compute_normalized_device_coords |
( |
vec2 |
pixel | ) |
const |
|
inline |
Compute normalized device coordinates from pixel coordinates.
- Parameters
-
pixel | pixel coordinates where (0, 0) corresponds to bottom left of the surface |
Definition at line 153 of file painter_surface.hpp.
◆ compute_normalized_device_coords_from_viewport_coords() [1/2]
vec2 fastuidraw::PainterSurface::Viewport::compute_normalized_device_coords_from_viewport_coords |
( |
vec2 |
viewport_coords | ) |
const |
|
inline |
Compute normalized device coordinates from viewport coordinates.
- Parameters
-
viewport_coords | viewport coordinates |
Definition at line 168 of file painter_surface.hpp.
◆ compute_normalized_device_coords_from_viewport_coords() [2/2]
vec2 fastuidraw::PainterSurface::Viewport::compute_normalized_device_coords_from_viewport_coords |
( |
ivec2 |
viewport_coords | ) |
const |
|
inline |
Compute normalized device coordinates from viewport coordinates.
- Parameters
-
viewport_coords | viewport coordinates |
Definition at line 182 of file painter_surface.hpp.
◆ compute_pixel_coordinates()
vec2 fastuidraw::PainterSurface::Viewport::compute_pixel_coordinates |
( |
vec2 |
ndc | ) |
const |
|
inline |
Compute pixel coordinates from normalized device coords using this Viewport values. The pixel coordinates are so that (0, 0) is the bottom left.
- Parameters
-
ndc | normalized device coordinates |
Definition at line 97 of file painter_surface.hpp.
◆ compute_viewport_coordinates() [1/3]
static vec2 fastuidraw::PainterSurface::Viewport::compute_viewport_coordinates |
( |
vec2 |
ndc, |
|
|
vec2 |
dims |
|
) |
| |
|
inlinestatic |
Compute viewport coordiantes from normalized device coordinates
- Parameters
-
ndc | normalized device coordinates |
dims | size of viewport (i.e. the value of m_dimensions) |
Definition at line 113 of file painter_surface.hpp.
◆ compute_viewport_coordinates() [2/3]
static vec2 fastuidraw::PainterSurface::Viewport::compute_viewport_coordinates |
( |
vec2 |
ndc, |
|
|
ivec2 |
dims |
|
) |
| |
|
inlinestatic |
Compute viewport coordiantes from normalized device coordinates
- Parameters
-
ndc | normalized device coordinates |
dims | size of viewport (i.e. the value of m_dimensions) |
Definition at line 128 of file painter_surface.hpp.
◆ compute_viewport_coordinates() [3/3]
vec2 fastuidraw::PainterSurface::Viewport::compute_viewport_coordinates |
( |
vec2 |
ndc | ) |
const |
|
inline |
Compute viewport coordinates from normalized device coords using this Viewport values. The viewport coordinates are so that (0, 0) corresponds to pixel coordinates of value m_origin.
- Parameters
-
ndc | normalized device coordinates |
Definition at line 141 of file painter_surface.hpp.
◆ compute_visible_dimensions()
ivec2 fastuidraw::PainterSurface::Viewport::compute_visible_dimensions |
( |
ivec2 |
surface_dims | ) |
const |
|
inline |
Computes the dimensions of the intersection of this viewport against a surface with the given resolution.
- Parameters
-
surface_dims | dimension of surface |
Definition at line 236 of file painter_surface.hpp.
◆ visible_dimensions()
ivec2 fastuidraw::PainterSurface::Viewport::visible_dimensions |
( |
void |
| ) |
const |
|
inline |
Returne the size needed by a surface to contain the viewport, i.e. how many pixels the viewport covers.
Definition at line 217 of file painter_surface.hpp.
◆ m_dimensions
ivec2 fastuidraw::PainterSurface::Viewport::m_dimensions |
◆ m_origin
ivec2 fastuidraw::PainterSurface::Viewport::m_origin |
The documentation for this class was generated from the following file: