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

Function Test_PixelOperations

deps/LLGL/tests/Test_Image.cpp:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Test_PixelOperations()
50{
51 auto img1 = LoadImage("Media/Textures/Grid.png", LLGL::ImageFormat::RGBA);
52
53 LLGL::Image img1Sub { LLGL::Extent3D { 109, 110, 1 }, LLGL::ImageFormat::BGR, img1.GetDataType() };
54
55 img1.ReadPixels(LLGL::Offset3D { 0, 0, 0 }, img1Sub.GetExtent(), img1Sub.GetDstDesc());
56 SaveImagePNG(img1Sub, "Output/img1Sub-a.png");
57
58 img1.ReadPixels(LLGL::Offset3D { 109, 0, 0 }, img1Sub.GetExtent(), img1Sub.GetDstDesc());
59 SaveImagePNG(img1Sub, "Output/img1Sub-b.png");
60
61 img1.ReadPixels(LLGL::Offset3D { 328, 164, 0 }, img1Sub.GetExtent(), img1Sub.GetDstDesc());
62 SaveImagePNG(img1Sub, "Output/img1Sub-c.png");
63
64 #if 0
65 img1.WritePixels(LLGL::Offset3D { 0, 110, 0 }, img1Sub.GetExtent(), img1Sub.GetSrcDesc());
66 SaveImagePNG(img1, "Output/img1.png");
67 #elif 1
68 img1.WritePixels(LLGL::Offset3D { 0, 220, 0 }, LLGL::Extent3D { img1.GetExtent().width, 110, 1 }, img1.GetSrcDesc());
69 SaveImagePNG(img1, "Output/img1-write.png");
70 #endif
71}
72
73void Test_Blit()
74{

Callers

nothing calls this directly

Calls 6

LoadImageFunction · 0.85
SaveImagePNGFunction · 0.85
ReadPixelsMethod · 0.80
GetDstDescMethod · 0.80
WritePixelsMethod · 0.80
GetSrcDescMethod · 0.80

Tested by

no test coverage detected