|
KiCad PCB EDA Suite
|
Tests for GAL XOR/difference mode (issue #18983). More...
Go to the source code of this file.
Functions | |
| static COLOR4D | getPixelColor (cairo_surface_t *surface, int x, int y) |
| Helper to get a pixel color from a Cairo ARGB32 surface. | |
| static bool | colorsApproxEqual (const COLOR4D &a, const COLOR4D &b, double tolerance=0.02) |
| Helper to check if two colors are approximately equal. | |
| BOOST_AUTO_TEST_CASE (CairoDifferenceIdenticalColors) | |
| Test that CAIRO_OPERATOR_DIFFERENCE correctly computes |src - dst| for identical overlapping colors (should result in black). | |
| BOOST_AUTO_TEST_CASE (CairoDifferenceDifferentColors) | |
| Test that CAIRO_OPERATOR_DIFFERENCE shows the difference for different colors. | |
| BOOST_AUTO_TEST_CASE (CairoDifferenceNonOverlapping) | |
| Test that non-overlapping content (source on empty destination) shows the source. | |
| BOOST_AUTO_TEST_CASE (CairoDifferencePartialOverlap) | |
| Test partial overlap scenario - simulating gerbview XOR mode with two layers. | |
Tests for GAL XOR/difference mode (issue #18983).
These tests verify that CAIRO_OPERATOR_DIFFERENCE correctly computes |src - dst| for XOR-style layer comparison in gerbview.
Definition in file test_gal_xor_mode.cpp.
| BOOST_AUTO_TEST_CASE | ( | CairoDifferenceDifferentColors | ) |
Test that CAIRO_OPERATOR_DIFFERENCE shows the difference for different colors.
Definition at line 126 of file test_gal_xor_mode.cpp.
References colorsApproxEqual(), expected, getPixelColor(), and result.
| BOOST_AUTO_TEST_CASE | ( | CairoDifferenceIdenticalColors | ) |
Test that CAIRO_OPERATOR_DIFFERENCE correctly computes |src - dst| for identical overlapping colors (should result in black).
Definition at line 81 of file test_gal_xor_mode.cpp.
References colorsApproxEqual(), expected, getPixelColor(), and result.
| BOOST_AUTO_TEST_CASE | ( | CairoDifferenceNonOverlapping | ) |
Test that non-overlapping content (source on empty destination) shows the source.
Definition at line 169 of file test_gal_xor_mode.cpp.
References colorsApproxEqual(), expected, getPixelColor(), and result.
| BOOST_AUTO_TEST_CASE | ( | CairoDifferencePartialOverlap | ) |
Test partial overlap scenario - simulating gerbview XOR mode with two layers.
Definition at line 213 of file test_gal_xor_mode.cpp.
References KIGFX::COLOR4D::b, colorsApproxEqual(), KIGFX::COLOR4D::g, getPixelColor(), and KIGFX::COLOR4D::r.
|
static |
Helper to check if two colors are approximately equal.
Definition at line 69 of file test_gal_xor_mode.cpp.
References std::abs(), KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, and KIGFX::COLOR4D::r.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Helper to get a pixel color from a Cairo ARGB32 surface.
Definition at line 47 of file test_gal_xor_mode.cpp.
References getPixelColor().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and getPixelColor().