Blender V4.3
zbuf.cc File Reference
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "zbuf.h"

Go to the source code of this file.

Functions

void zbuf_alloc_span (ZSpan *zspan, int rectx, int recty)
 
void zbuf_free_span (ZSpan *zspan)
 
static void zbuf_init_span (ZSpan *zspan)
 
static void zbuf_add_to_span (ZSpan *zspan, const float v1[2], const float v2[2])
 
void zspan_scanconvert (ZSpan *zspan, void *handle, float *v1, float *v2, float *v3, void(*func)(void *, int, int, float, float))
 

Detailed Description

Note
Some of this logic has been duplicated in COM_VectorBlurOperation.cc changes here may also apply also apply to that file.

Definition in file zbuf.cc.

Function Documentation

◆ zbuf_add_to_span()

static void zbuf_add_to_span ( ZSpan * zspan,
const float v1[2],
const float v2[2] )
static

◆ zbuf_alloc_span()

void zbuf_alloc_span ( struct ZSpan * zspan,
int rectx,
int recty )

Each Z-buffer has coordinates transformed to local rect coordinates, so we can simply clip.

Definition at line 32 of file zbuf.cc.

References MEM_mallocN, ZSpan::rectx, ZSpan::recty, ZSpan::span1, and ZSpan::span2.

Referenced by RE_bake_pixels_populate(), and blender::render::texturemargin::TextureMarginMap::TextureMarginMap().

◆ zbuf_free_span()

void zbuf_free_span ( ZSpan * zspan)

◆ zbuf_init_span()

static void zbuf_init_span ( ZSpan * zspan)
static

◆ zspan_scanconvert()

void zspan_scanconvert ( struct ZSpan * zspan,
void * handle,
float * v1,
float * v2,
float * v3,
void(* func )(void *, int, int, float, float) )

Scan-convert for strand triangles, calls function for each x, y coordinate and gives UV barycentrics and z.

Definition at line 160 of file zbuf.cc.

References double(), floor(), max_ff(), max_ii(), ZSpan::maxp2, ZSpan::maxy1, ZSpan::maxy2, min_ff(), min_ii(), ZSpan::minp2, ZSpan::miny1, ZSpan::miny2, ZSpan::rectx, ZSpan::span1, ZSpan::span2, v, v2, x, y, zbuf_add_to_span(), and zbuf_init_span().

Referenced by blender::render::texturemargin::TextureMarginMap::rasterize_tri(), and RE_bake_pixels_populate().