| 80 | } |
| 81 | |
| 82 | void 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 | |
| 111 | int main(int argc, char* argv[]) |
| 112 | { |
no test coverage detected