Blender  V3.3
Functions
zbuf.c File Reference
#include <string.h>
#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.c.

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 31 of file zbuf.c.

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

◆ zbuf_free_span()

void zbuf_free_span ( ZSpan zspan)

Definition at line 42 of file zbuf.c.

References MEM_SAFE_FREE, ZSpan::span1, and ZSpan::span2.

◆ 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(*)(void *, int, int, float, float func 
)

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

Definition at line 159 of file zbuf.c.

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

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