// Copyright 2024 Bytedance Inc. All Rights Reserved. // Author: tianlei.richard@qq.com (tianlei.richard) #include "rasterizer.h" #include Rasterizer::Rasterizer(const int width, const int height) : width_(width), height_(height), pixels_(std::vector>( height, std::vector(width, std::numeric_limits::infinity()))) {} void Rasterizer::rasterize(const Triangle &t) { const auto &aabb = t.axis_align_bbox(); const int x_min = aabb.x; const int x_max = aabb.x + aabb.width; const int y_min = aabb.y; const int y_max = aabb.y + aabb.height; for (int i = x_min; i < x_max; ++i) { for (int j = y_min; j < y_max; ++j) { } } }