25 lines
446 B
C
25 lines
446 B
C
|
// Copyright 2024 Bytedance Inc. All Rights Reserved.
|
||
|
// Author: tianlei.richard@qq.com (tianlei.richard)
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include "triangle.h"
|
||
|
#include <opencv2/core/core.hpp>
|
||
|
#include <vector>
|
||
|
|
||
|
class Rasterizer {
|
||
|
public:
|
||
|
using RasterizeRange = cv::Rect2i;
|
||
|
|
||
|
public:
|
||
|
Rasterizer(const int width, const int height);
|
||
|
|
||
|
public:
|
||
|
void rasterize(const Triangle &t);
|
||
|
|
||
|
private:
|
||
|
int width_;
|
||
|
int height_;
|
||
|
std::vector<std::vector<int>> pixels_;
|
||
|
};
|