Files
Aethera/render_2D/tests/Frame_Pixel_Format_Test.cpp
T
2026-09-03 11:52:15 +08:00

19 lines
778 B
C++

#include <render_2D/module/scene/frame/Frame_2D.hpp>
#include <gtest/gtest.h>
namespace {
using namespace aethera::render_2d;
TEST(Frame_Pixel_Format, Converts_The_Authoritative_Native_Frame_On_Output) {
Frame_2D frame{{1, 0}, Pixel_Format::rgba8};
auto& cache = aethera::render_2d::detail::Frame_2D_Access::render_target(&frame);
cache.ensure_size({2, 1});
aethera::render_2d::detail::Painter painter(cache, {2, 1});
painter.rect({0.0, 0.0, 2.0, 1.0}, Pen{.style = Line_Style::none}, Brush{Color{10, 20, 30, 255}, Brush_Style::solid});
const auto output = frame.output_pixels();
EXPECT_EQ(output.format, Pixel_Format::rgba8);
EXPECT_EQ(output.width, 2);
EXPECT_EQ(output.height, 1);
EXPECT_EQ(output.bytes.size(), 8U);
}
} // namespace