创建光栅化目录

This commit is contained in:
2025-06-29 16:08:25 +08:00
parent 2fe2ef5d74
commit 2520e9589f
6 changed files with 19 additions and 6 deletions
-49
View File
@@ -1,49 +0,0 @@
#pragma once
#include "dvc_config.h"
#include "math/dvc_vector2.h"
#include "math/dvc_vector3.h"
DV_CORE_BEGIN_NAMESPACE
class DV_CORE_API Rasterizer
{
//Draw Line
public:
typedef std::function<void(const std::pair<int32_t, int32_t>&, float)> DrawLineCallback;
//Bresenham's line algorithm
static void drawLine(int32_t canvasWidth, int32_t canvasHeight,
const fVector2& start, const fVector2& end,
DrawLineCallback callback);
//Draw Triangle
public:
typedef std::function<void(const std::pair<int32_t, int32_t>& pos, const fVector3& percent)> DrawTriangleCallback;
struct DebugParam
{
bool debug;
const char* szOutputFileName;
int32_t x;
int32_t y;
FILE* fpOutput;
int32_t tile_id;
int32_t coarse_id;
int32_t fine_id;
int32_t edge_id;
};
//Larrabee algorithm
static void drawTriangleLarrabee(int32_t canvasWidth, int32_t canvasHeight,
const fVector2& v0, const fVector2& v1, const fVector2& v2,
DrawTriangleCallback callback, bool ccw=true, const DebugParam* debugParam=nullptr);
//Scaleline algorithm
static void drawTriangleScanline(int32_t canvasWidth, int32_t canvasHeight,
const fVector2& v0, const fVector2& v1, const fVector2& v2,
DrawTriangleCallback callback, bool ccw = true);
};
DV_CORE_END_NAMESPACE