initial commit

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2025-10-31 23:37:30 +01:00
commit 7228269764
9653 changed files with 4034514 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tests/image/imagwebp.cpp
// Purpose: Test wxWEBPHandler
// Author: Hermann Höhne
// Created: 2024-03-08
// Copyright: (c) Hermann Höhne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "testprec.h"
#if wxUSE_IMAGE && wxUSE_LIBWEBP
#include "wx/mstream.h"
#include "wx/sstream.h"
#include "testimage.h" // for RGBSimilarTo
TEST_CASE("wxWEBPHandler::LoadCorruptWebP", "[image][webp]")
{
wxString data("RIFF____WEBP____ThisIsGarbageData");
wxStringInputStream inputStream(data);
wxImage loadingImage;
wxWEBPHandler webpHandler;
// LoadFile must return false, and will do so reliably.
// The test exists to check for nullptr dereferences or similar defects.
CHECK(!webpHandler.LoadFile(&loadingImage, inputStream, false));
}
static bool WebPRoundtrip(wxImage& savingImage, wxImage& loadingImage)
{
// set quality to maximum so the images hopefully won't differ too much
wxMemoryOutputStream outputStream;
wxWEBPHandler webpHandler;
webpHandler.SaveFile(&savingImage, outputStream, true);
wxMemoryInputStream inputStream(outputStream);
webpHandler.LoadFile(&loadingImage, inputStream, true);
REQUIRE(loadingImage.IsOk());
return true;
}
TEST_CASE("wxWEBPHandler::LossysRoundtrip", "[image][webp]")
{
wxImage reference;
reference.LoadFile("horse.webp");
REQUIRE(reference.IsOk());
reference.SetOption(wxIMAGE_OPTION_WEBP_FORMAT, wxWebPImageFormat::Lossy);
reference.SetOption(wxIMAGE_OPTION_WEBP_QUALITY, 100);
wxImage loaded;
REQUIRE(WebPRoundtrip(reference, loaded));
int tolerance = 32;
CHECK_THAT(loaded, RGBSimilarTo(reference, tolerance));
}
TEST_CASE("wxWEBPHandler::LosslessRoundtrip", "[image][webp]")
{
wxImage reference;
reference.LoadFile("horse.webp");
REQUIRE(reference.IsOk());
reference.SetOption(wxIMAGE_OPTION_WEBP_FORMAT, wxWebPImageFormat::Lossless);
wxImage loaded;
REQUIRE(WebPRoundtrip(reference, loaded));
CHECK_THAT(loaded, RGBASameAs(reference));
}
#endif //wxUSE_IMAGE && wxUSE_LIBWEBP

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,86 @@
///////////////////////////////////////////////////////////////////////////////
// Name: tests/image/rawbmp.cpp
// Purpose: Test for using raw bitmap access classes with wxImage
// Author: Vadim Zeitlin
// Created: 2008-05-30
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "testprec.h"
#ifdef wxHAS_RAW_BITMAP
#ifndef WX_PRECOMP
#endif // WX_PRECOMP
#include "wx/image.h"
#include "wx/rawbmp.h"
namespace
{
const int WIDTH = 10;
const int HEIGHT = 10;
}
#define ASSERT_COL_EQUAL(x, y) \
CPPUNIT_ASSERT_EQUAL( (unsigned char)(x), (y) )
// ----------------------------------------------------------------------------
// test class
// ----------------------------------------------------------------------------
class ImageRawTestCase : public CppUnit::TestCase
{
public:
ImageRawTestCase() { }
private:
CPPUNIT_TEST_SUITE( ImageRawTestCase );
CPPUNIT_TEST( RGBImage );
CPPUNIT_TEST_SUITE_END();
void RGBImage();
wxDECLARE_NO_COPY_CLASS(ImageRawTestCase);
};
CPPUNIT_TEST_SUITE_REGISTRATION( ImageRawTestCase );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ImageRawTestCase, "ImageRawTestCase" );
void ImageRawTestCase::RGBImage()
{
// create a check board image
wxImage image(WIDTH, HEIGHT);
wxImagePixelData data(image);
wxImagePixelData::Iterator p(data);
for ( int y = 0; y < HEIGHT; y++ )
{
const wxImagePixelData::Iterator rowStart = p;
for ( int x = 0; x < WIDTH; x++ )
{
p.Red() =
p.Green() =
p.Blue() = (x + y) % 2 ? 0 : -1;
++p;
}
p = rowStart;
p.OffsetY(data, 1);
}
// test a few pixels
ASSERT_COL_EQUAL( 0xff, image.GetRed(0, 0) );
ASSERT_COL_EQUAL( 0xff, image.GetBlue(1, 1) );
ASSERT_COL_EQUAL( 0, image.GetGreen(0, 1) );
ASSERT_COL_EQUAL( 0, image.GetGreen(1, 0) );
}
#endif // wxHAS_RAW_BITMAP

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB