diff --git a/Exec/main.cpp b/Exec/main.cpp index 52dd952..017755d 100644 --- a/Exec/main.cpp +++ b/Exec/main.cpp @@ -1,12 +1,15 @@ #include #include #include +#include using namespace Leonetienne::BmpPP; +using namespace Eule; int main() { /* + BMP bmp({800, 600}, Colormode::RGB); for (int x = 0; x < 800; x++) @@ -21,14 +24,13 @@ int main() { } bmp.Write("write.bmp"); + */ + BMP bmp("basea_hachi.bmp"); - BMP bmp("basea_gradient.bmp"); + BMP cropped = bmp.Crop(Vector2i(95, 83), Vector2i(95 + 149, 83 + 239)); - BMP newBmp = bmp.MirrorHorizontally(); - //BMP newBmp = bmp.MirrorVertically(); - - if(!newBmp.Write("basea_gradient_flipped_hor.bmp")) + if(!cropped.Write("basea_hachi_cropped.bmp")) std::cerr << "What the hell" << std::endl; /* diff --git a/Test/Uninitialized.cpp b/Test/Uninitialized.cpp index 864d57c..444d8d1 100644 --- a/Test/Uninitialized.cpp +++ b/Test/Uninitialized.cpp @@ -81,6 +81,30 @@ TEST_CASE(__FILE__"/RuntimeErrorOnUninitialized", "[Uninitialized]") , std::runtime_error ); + REQUIRE_THROWS_AS( + bmp.Rotate180deg() + , std::runtime_error + ); + + REQUIRE_THROWS_AS( + bmp.Rotate90degClockwise() + , std::runtime_error + ); + + REQUIRE_THROWS_AS( + bmp.Rotate90degCounterclockwise() + , std::runtime_error + ); + + REQUIRE_THROWS_AS( + bmp.Crop({0,0}, {5,5}) + , std::runtime_error + ); + + REQUIRE_THROWS_AS( + bmp.ConvertColormode(Colormode::RGB) + , std::runtime_error + ); return; }