完善V1.4踢乒乓球版本

This commit is contained in:
myperworld committed 2026-01-20 22:15:03 +08:00
1 parent d14fe6c37b
commit 72455a5e76
1864 files changed
+19294 -218

No files matched your search

@@ -0,0 +1,32 @@
// g++ --std=c++11 test.cpp
#include "test.h"
#include "FastLED.h"
#include "fl/raster.h"
#include "fl/tile2x2.h"
#include "fl/xypath.h"
#include "fl/namespace.h"
using namespace fl;
TEST_CASE("XYRasterU8SparseTest should match bounds of pixels draw area") {
XYPathPtr path = XYPath::NewLinePath(-1, -1, 1, 1);
path->setDrawBounds(4,4);
Tile2x2_u8 sp0 = path->at_subpixel(0);
Tile2x2_u8 sp1 = path->at_subpixel(1);
Tile2x2_u8 subpixels[2] = {sp0, sp1};
MESSAGE("subpixels[0] = " << subpixels[0]);
MESSAGE("subpixels[1] = " << subpixels[1]);
XYRasterU8Sparse raster(4, 4);
raster.rasterize(subpixels);
auto obligatory_bounds = raster.bounds();
REQUIRE_EQ(rect<uint16_t>(0, 0, 4, 4), obligatory_bounds);
auto pixel_bounds = raster.bounds_pixels();
REQUIRE_EQ(rect<uint16_t>(0, 0, 4, 4), pixel_bounds);
}