KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_bitmap_tracing.cpp File Reference
#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)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/7]

◆ BOOST_AUTO_TEST_CASE() [2/7]

◆ BOOST_AUTO_TEST_CASE() [3/7]

◆ BOOST_AUTO_TEST_CASE() [4/7]

BOOST_AUTO_TEST_CASE ( InvertSwapsBlackAndWhite )

◆ BOOST_AUTO_TEST_CASE() [5/7]

◆ BOOST_AUTO_TEST_CASE() [6/7]

BOOST_AUTO_TEST_CASE ( ThresholdSplitsLightFromDark )

◆ BOOST_AUTO_TEST_CASE() [7/7]

BOOST_AUTO_TEST_CASE ( TransparentPixelsDoNotBecomeBlack )

Definition at line 74 of file test_bitmap_tracing.cpp.

References ConvertImageToBilevel(), image, and makeImage().

◆ BOOST_FIXTURE_TEST_CASE() [1/3]

◆ BOOST_FIXTURE_TEST_CASE() [2/3]

◆ BOOST_FIXTURE_TEST_CASE() [3/3]

BOOST_FIXTURE_TEST_CASE ( PluginReportsSizeInMillimetres ,
PNG_FIXTURE  )

◆ fillRect()

static void fillRect ( wxImage & aImage,
const wxRect & aRect,
unsigned char aValue )
static

◆ loadAsJpeg()

static void loadAsJpeg ( BITMAP_BASE & aBitmap,
const wxImage & aImage )
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().

◆ makeImage()

◆ storedImageData()

static std::string storedImageData ( const BITMAP_BASE & aBitmap)
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().