MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / Test_Resize

Function Test_Resize

deps/LLGL/tests/Test_Image.cpp:82–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void Test_Resize()
83{
84 auto img1 = LoadImage("Media/Textures/Grid.png", LLGL::ImageFormat::RGB);
85
86 const auto& extent = img1.GetExtent();
87
88 #if 1
89 img1.Resize(
90 LLGL::Extent3D { 512, 512, 1 },
91 LLGL::ColorRGBAd { 0.0, 1.0, 0.0 },
92 LLGL::Offset3D { (512 - static_cast<int>(extent.width))/2, (512 - static_cast<int>(extent.height)) / 2, 0 }
93 );
94 #else
95 img1.Resize(
96 img1.GetExtent() + LLGL::Extent3D{ 6, 6, 0 },
97 LLGL::ColorRGBAd { 1.0, 0.0, 1.0 },
98 LLGL::Offset3D { 3, 3, 0 }
99 );
100 #endif
101 SaveImagePNG(img1, "Output/img1-resize-larger.png");
102
103 img1.Resize(
104 LLGL::Extent3D { 128, 128, 1 },
105 LLGL::ColorRGBAd { 0.0, 1.0, 0.0 },
106 LLGL::Offset3D { (128 - static_cast<int>(extent.width)) / 2, (128 - static_cast<int>(extent.height)) / 2, 0u }
107 );
108 SaveImagePNG(img1, "Output/img1-resize-smaller.png");
109}
110
111int main(int argc, char* argv[])
112{

Callers 1

mainFunction · 0.85

Calls 3

LoadImageFunction · 0.85
SaveImagePNGFunction · 0.85
ResizeMethod · 0.45

Tested by

no test coverage detected