|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <bitmap_base.h>#include <bitmap_tracing.h>#include <eda_item.h>#include <geometry/eda_angle.h>#include <import_gfx/bitmap_import_plugin.h>#include <import_gfx/graphics_importer_buffer.h>#include <reporter.h>#include <wx/imagjpeg.h>#include <wx/mstream.h>Go to the source code of this file.
Classes | |
| struct | PNG_FIXTURE |
Functions | |
| static wxImage | makeImage (int aWidth, int aHeight, unsigned char aFill) |
| static void | fillRect (wxImage &aImage, const wxRect &aRect, unsigned char aValue) |
| BOOST_AUTO_TEST_CASE (ThresholdSplitsLightFromDark) | |
| BOOST_AUTO_TEST_CASE (InvertSwapsBlackAndWhite) | |
| BOOST_AUTO_TEST_CASE (TransparentPixelsDoNotBecomeBlack) | |
| BOOST_AUTO_TEST_CASE (RingTracesToOneOutlineWithItsHoleRemoved) | |
| BOOST_FIXTURE_TEST_CASE (PluginReportsSizeInMillimetres, PNG_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PluginReportsFilledPolygons, PNG_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PluginKeepsDetailFinerThanAMillimetre, PNG_FIXTURE) | |
| static void | loadAsJpeg (BITMAP_BASE &aBitmap, const wxImage &aImage) |
| Load an image the way a board does, through encoded file data. | |
| static std::string | storedImageData (const BITMAP_BASE &aBitmap) |
| The bytes the image would be written to a board file with. | |
| BOOST_AUTO_TEST_CASE (APreviewPutsTheRealImageBack) | |
| BOOST_AUTO_TEST_CASE (APreviewedTurnIsNotAppliedTwice) | |
| BOOST_AUTO_TEST_CASE (AFailedRegionDoesNotSwallowTheRest) | |
| BOOST_AUTO_TEST_CASE | ( | AFailedRegionDoesNotSwallowTheRest | ) |
Definition at line 294 of file test_bitmap_tracing.cpp.
References SHAPE_LINE_CHAIN::BBox(), ConvertImageToBilevel(), SHAPE_POLY_SET::COutline(), fillRect(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), image, makeImage(), SHAPE_POLY_SET::OutlineCount(), reporter, and TraceBilevelImage().
| BOOST_AUTO_TEST_CASE | ( | APreviewedTurnIsNotAppliedTwice | ) |
Definition at line 269 of file test_bitmap_tracing.cpp.
References ANGLE_0, BITMAP_BASE::BeginPreviewImage(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BITMAP_BASE::EndPreviewImage(), BITMAP_BASE::GetImageData(), BITMAP_BASE::GetOriginalImageData(), BITMAP_BASE::GetSizePixels(), makeImage(), BITMAP_BASE::Rotate(), BITMAP_BASE::Rotation(), BITMAP_BASE::SetImage(), and VECTOR2< T >::x.
| BOOST_AUTO_TEST_CASE | ( | APreviewPutsTheRealImageBack | ) |
Definition at line 237 of file test_bitmap_tracing.cpp.
References BITMAP_BASE::BeginPreviewImage(), BOOST_CHECK_EQUAL(), ConvertImageToBilevel(), BITMAP_BASE::EndPreviewImage(), fillRect(), BITMAP_BASE::GetImageData(), BITMAP_BASE::GetImageID(), loadAsJpeg(), makeImage(), source, and storedImageData().
| BOOST_AUTO_TEST_CASE | ( | InvertSwapsBlackAndWhite | ) |
Definition at line 62 of file test_bitmap_tracing.cpp.
References BOOST_CHECK_EQUAL(), ConvertImageToBilevel(), fillRect(), image, and makeImage().
| BOOST_AUTO_TEST_CASE | ( | RingTracesToOneOutlineWithItsHoleRemoved | ) |
Definition at line 92 of file test_bitmap_tracing.cpp.
References std::abs(), SHAPE_POLY_SET::Area(), SHAPE_POLY_SET::BBox(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), ConvertImageToBilevel(), fillRect(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), image, SHAPE_POLY_SET::IsEmpty(), makeImage(), SHAPE_POLY_SET::OutlineCount(), reporter, and TraceBilevelImage().
| BOOST_AUTO_TEST_CASE | ( | ThresholdSplitsLightFromDark | ) |
Definition at line 50 of file test_bitmap_tracing.cpp.
References BOOST_CHECK_EQUAL(), ConvertImageToBilevel(), fillRect(), image, and makeImage().
| BOOST_AUTO_TEST_CASE | ( | TransparentPixelsDoNotBecomeBlack | ) |
Definition at line 74 of file test_bitmap_tracing.cpp.
References ConvertImageToBilevel(), image, and makeImage().
| BOOST_FIXTURE_TEST_CASE | ( | PluginKeepsDetailFinerThanAMillimetre | , |
| PNG_FIXTURE | ) |
Definition at line 183 of file test_bitmap_tracing.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), fillRect(), BOX2< Vec >::GetHeight(), GRAPHICS_IMPORTER_BUFFER::GetShapes(), BOX2< Vec >::GetWidth(), image, BITMAP_IMPORT_PLUGIN::Import(), BITMAP_IMPORT_PLUGIN::LoadFromMemory(), makeImage(), and GRAPHICS_IMPORT_PLUGIN::SetImporter().
| BOOST_FIXTURE_TEST_CASE | ( | PluginReportsFilledPolygons | , |
| PNG_FIXTURE | ) |
Definition at line 154 of file test_bitmap_tracing.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), fillRect(), GRAPHICS_IMPORTER_BUFFER::GetShapes(), IMPORTED_POLYGON::GetStroke(), IMPORTED_STROKE::GetWidth(), image, BITMAP_IMPORT_PLUGIN::Import(), IMPORTED_POLYGON::IsFilled(), BITMAP_IMPORT_PLUGIN::LoadFromMemory(), makeImage(), and GRAPHICS_IMPORT_PLUGIN::SetImporter().
| BOOST_FIXTURE_TEST_CASE | ( | PluginReportsSizeInMillimetres | , |
| PNG_FIXTURE | ) |
Definition at line 142 of file test_bitmap_tracing.cpp.
References BOOST_REQUIRE(), BITMAP_IMPORT_PLUGIN::GetImageHeight(), BITMAP_IMPORT_PLUGIN::GetImageWidth(), BITMAP_IMPORT_PLUGIN::LoadFromMemory(), and makeImage().
|
static |
Definition at line 44 of file test_bitmap_tracing.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
static |
Load an image the way a board does, through encoded file data.
Definition at line 211 of file test_bitmap_tracing.cpp.
References BOOST_REQUIRE(), and BITMAP_BASE::ReadImageFile().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 36 of file test_bitmap_tracing.cpp.
References image, and makeImage().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and makeImage().
|
static |
The bytes the image would be written to a board file with.
Definition at line 225 of file test_bitmap_tracing.cpp.
References BOOST_REQUIRE(), and BITMAP_BASE::SaveImageData().
Referenced by BOOST_AUTO_TEST_CASE().