nngn
Loading...
Searching...
No Matches
anonymous_namespace{rasterizer.cpp} Namespace Reference

Typedefs

using write_f = void(FrameBuffer::*)(std::size_t, std::size_t, texel4)
 

Functions

auto to_clip (mat4 proj, nngn::Vertex v0, nngn::Vertex v1, auto &&f)
 Transforms world-space vertices into clip space.
 
bool clip (vec3 bl, vec3 tr)
 Checks whether a sprite lies entirely outside of the clip volume.
 
std::size_t clamp_floor (float max, float v)
 Clamps value between 0 and max, rounds toward -infinity.
 
std::size_t clamp_ceil (float max, float v)
 Clamps value between 0 and max, rounds toward +infinity.
 
float uv_coord (float p0, std::size_t p, float p1, float t0, float t1)
 Calculates texture coordinates for a given position in a sprite.
 
vec2 to_screen (uvec2 size, vec3 v)
 Transforms clip-space vertices into screen space.
 
write_f write_fn_for_mode (nngn::Graphics::TerminalMode m)
 
void sprite (std::span< const nngn::Vertex > vbo, std::span< const u32 > ebo, mat4 proj, std::span< const Texture > textures, FrameBuffer *fb, TerminalMode mode, auto &&pos_f)
 

Typedef Documentation

◆ write_f

typedef void(FrameBuffer::* anonymous_namespace{rasterizer.cpp}::write_f)(std::size_t, std::size_t, texel4)

Function Documentation

◆ clamp_ceil()

std::size_t anonymous_namespace{rasterizer.cpp}::clamp_ceil ( float  max,
float  v 
)

Clamps value between 0 and max, rounds toward +infinity.

Here is the caller graph for this function:

◆ clamp_floor()

std::size_t anonymous_namespace{rasterizer.cpp}::clamp_floor ( float  max,
float  v 
)

Clamps value between 0 and max, rounds toward -infinity.

Here is the caller graph for this function:

◆ clip()

bool anonymous_namespace{rasterizer.cpp}::clip ( vec3  bl,
vec3  tr 
)

Checks whether a sprite lies entirely outside of the clip volume.

Here is the caller graph for this function:

◆ sprite()

void anonymous_namespace{rasterizer.cpp}::sprite ( std::span< const nngn::Vertex vbo,
std::span< const u32 >  ebo,
mat4  proj,
std::span< const Texture textures,
FrameBuffer fb,
TerminalMode  mode,
auto &&  pos_f 
)
Here is the call graph for this function:

◆ to_clip()

auto anonymous_namespace{rasterizer.cpp}::to_clip ( mat4  proj,
nngn::Vertex  v0,
nngn::Vertex  v1,
auto &&  f 
)
inline

Transforms world-space vertices into clip space.

Returns
{bl, tr, bt, tt}: vertices / texture coordinates
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_screen()

vec2 anonymous_namespace{rasterizer.cpp}::to_screen ( uvec2  size,
vec3  v 
)

Transforms clip-space vertices into screen space.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uv_coord()

float anonymous_namespace{rasterizer.cpp}::uv_coord ( float  p0,
std::size_t  p,
float  p1,
float  t0,
float  t1 
)

Calculates texture coordinates for a given position in a sprite.

Here is the caller graph for this function:

◆ write_fn_for_mode()

write_f anonymous_namespace{rasterizer.cpp}::write_fn_for_mode ( nngn::Graphics::TerminalMode  m)
Here is the call graph for this function:
Here is the caller graph for this function: