Package
ci / checks (push) Successful in 48m34s

This commit is contained in:
khodowany
2026-09-30 19:46:37 -05:00
parent 2a1aa2c67a
commit 09656a9d60
6621 changed files with 698 additions and 774 deletions
+9 -8
View File
@@ -99,7 +99,7 @@ public:
auto size = MeasureTextEx(font(style.size), std::string{text}.c_str(), style.size, 1.0F);
return {size.x, size.y};
}
Image image{GenImageColor(1024, 600, WHITE)};
Image image{GenImageColor(1024, 600, {vamp_style::background.r, vamp_style::background.g, vamp_style::background.b, 255})};
private:
auto font(std::float32_t size) const -> Font {
auto key = static_cast<std::int32_t>(std::ceil(size));
@@ -133,7 +133,7 @@ auto preview(vamp_zero::app_state const &state, std::string const &name, vamp_pi
auto context = image_context{};
vamp_zero::draw_header(context, {0.0F, 0.0F, 1024.0F, 600.0F}, state);
vamp_zero::draw_menu(context, {0.0F, 80.0F, 1024.0F, 520.0F}, state);
BOOST_REQUIRE(ExportImage(context.image, (directory / ("zero-" + name + ".png")).c_str()));
BOOST_REQUIRE(ExportImage(context.image, (directory / ("zero_" + name + ".png")).c_str()));
auto remote = vamp_pico::remote_display_state{};
BOOST_REQUIRE(vamp_pico::parse_remote_display_body(vamp_zero::remote_display_text(state), remote));
auto title = vamp_pico::title_cache{};
@@ -144,18 +144,19 @@ auto preview(vamp_zero::app_state const &state, std::string const &name, vamp_pi
auto atlas = read_bytes(directory / "static.p4");
auto image = GenImageColor(320, 240, WHITE);
auto row = std::array<std::uint16_t, vamp_pico::display_width>{};
auto dark = std::size_t{};
auto ink = std::size_t{};
for (auto y = 0U; y < 240U; ++y) {
vamp_pico::render_scanline(row, y, remote, link, busy, title, atlas);
for (auto x = 0U; x < 320U; ++x) {
auto pixel = row[x];
auto value = Color{static_cast<std::uint8_t>((pixel >> 11U) * 255U / 31U), static_cast<std::uint8_t>(((pixel >> 5U) & 63U) * 255U / 63U), static_cast<std::uint8_t>((pixel & 31U) * 255U / 31U), 255};
ImageDrawPixel(&image, x, y, value);
dark += value.r < 128U && value.g < 128U && value.b < 128U ? 1U : 0U;
ink += value.r > 128U && value.g > 128U && value.b > 128U ? 1U : 0U;
}
}
BOOST_TEST(dark > 200U);
BOOST_REQUIRE(ExportImage(image, (directory / ("pico-" + name + ".png")).c_str()));
BOOST_TEST(ink > 200U);
BOOST_TEST(ink < 320U * 240U / 2U);
BOOST_REQUIRE(ExportImage(image, (directory / ("pico_" + name + ".png")).c_str()));
UnloadImage(image);
}
@@ -178,7 +179,7 @@ BOOST_AUTO_TEST_CASE(device_menu_rendering_uses_petaluma_and_fits_both_displays)
state.mode = vamp_zero::app_mode::PERFORMANCE_SONG_MENU;
preview(state, "empty");
auto catalog = std::make_shared<vamp_zero::catalog>();
auto score = boost::json::parse(read_bytes(std::filesystem::path{VAMP_TEST_ASSETS_DIR} / "songs/autumn-leaves-electric.json"));
auto score = boost::json::parse(read_bytes(std::filesystem::path{VAMP_TEST_ASSETS_DIR} / "songs/autumn_leaves_electric.json"));
auto title = std::string{score.at("presentation").at("title_image").as_string()};
catalog->parts.push_back({.id = "electric", .title = "Autumn Leaves", .composer = "Joseph Kosma", .part = "Electric", .total_pages = 32U, .title_image = title});
catalog->groups.push_back({"Autumn Leaves", "Joseph Kosma", {0U}});
@@ -190,5 +191,5 @@ BOOST_AUTO_TEST_CASE(device_menu_rendering_uses_petaluma_and_fits_both_displays)
preview(state, "parts");
catalog->groups[0].title = std::string(200U, 'M');
catalog->groups[0].composer = std::string(200U, 'W');
preview(state, "long-title");
preview(state, "long_title");
}