initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
BIN
libs/wxWidgets-3.3.1/tests/image/32bpp_rgb.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/32bpp_rgb.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/32bpp_rgb_a0.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/8bpp-colorsused-large.bmp
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/8bpp-colorsused-negative.bmp
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/bad_truncated.gif
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/badrle4.bmp
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/bitfields-alpha.bmp
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/bitfields.bmp
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/cross_bicubic_256x256.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/cross_bilinear_256x256.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/cross_box_average_256x256.png
Normal file
|
After Width: | Height: | Size: 411 B |
|
After Width: | Height: | Size: 496 B |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bicubic_100x100.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bicubic_150x150.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bicubic_300x300.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bicubic_50x50.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bilinear_100x100.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bilinear_150x150.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bilinear_300x300.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_bilinear_50x50.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_box_average_100x100.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_box_average_150x150.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_box_average_300x300.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_box_average_50x50.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_grey.bmp
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_grey_flipped.bmp
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_rle4.bmp
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_rle4_flipped.bmp
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_rle8.bmp
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/horse_rle8_flipped.bmp
Normal file
|
After Width: | Height: | Size: 41 KiB |
2679
libs/wxWidgets-3.3.1/tests/image/image.cpp
Normal file
74
libs/wxWidgets-3.3.1/tests/image/imagwebp.cpp
Normal 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
|
||||
BIN
libs/wxWidgets-3.3.1/tests/image/paste_input_background.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
libs/wxWidgets-3.3.1/tests/image/paste_input_black.png
Normal file
|
After Width: | Height: | Size: 150 B |
|
After Width: | Height: | Size: 263 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 1.6 KiB |
86
libs/wxWidgets-3.3.1/tests/image/rawbmp.cpp
Normal 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
|
||||
BIN
libs/wxWidgets-3.3.1/tests/image/rgb16-3103.bmp
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rgb32-7187.bmp
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rgb32bf.bmp
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rgba32.bmp
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rle4-delta-320x240.bmp
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rle8-delta-320x240-expected.bmp
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/rle8-delta-320x240.bmp
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_bright_-0.259.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_dis_240.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_grey.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_hue_0.538.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_light_46.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_mono_255_255_255.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/toucan_sat_-0.41.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
libs/wxWidgets-3.3.1/tests/image/width-times-height-overflow.bmp
Normal file
|
After Width: | Height: | Size: 150 KiB |
2395
libs/wxWidgets-3.3.1/tests/image/width_height_32_bit_overflow.pgm
Normal file
BIN
libs/wxWidgets-3.3.1/tests/image/wx.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |