2024-03-01 21:31:47 +08:00
|
|
|
// Copyright 2024 Bytedance Inc. All Rights Reserved.
|
|
|
|
// Author: tianlei.richard@qq.com (tianlei.richard)
|
|
|
|
|
2024-03-01 16:00:08 +08:00
|
|
|
#include <Eigen/Dense>
|
|
|
|
|
|
|
|
#include <opencv2/core/core.hpp>
|
|
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
|
|
|
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
#include "spdlog/fmt/ostr.h" // github.com/gabime/spdlog/issues/1638
|
|
|
|
|
2024-03-01 21:31:47 +08:00
|
|
|
#include "rasterizer.h"
|
|
|
|
#include "triangle.h"
|
|
|
|
|
2024-03-01 16:00:08 +08:00
|
|
|
using namespace Eigen;
|
|
|
|
using namespace cv;
|
|
|
|
|
2024-03-01 21:31:47 +08:00
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
const int width = 1280;
|
|
|
|
const int height = 720;
|
|
|
|
|
|
|
|
Triangle t{Triangle::PointType{1, 1, 0}, Triangle::PointType{3, 1, 0},
|
|
|
|
Triangle::PointType{2, 4, 0}};
|
2024-03-01 16:00:08 +08:00
|
|
|
|
2024-03-01 21:31:47 +08:00
|
|
|
Rasterizer rasterizer{width, height};
|
|
|
|
rasterizer.rasterize(t);
|
2024-03-01 16:00:08 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|