36 #include <wx/mstream.h> 45 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
46 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x06, 0x00, 0x00, 0x00, 0xC4, 0x0F, 0xBE,
47 0x8B, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7C, 0x08, 0x64,
48 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0E, 0xC4, 0x00, 0x00, 0x0E,
49 0xC4, 0x01, 0x95, 0x2B, 0x0E, 0x1B, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F,
50 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
51 0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C, 0x1A, 0x00, 0x00, 0x00, 0x40, 0x49,
52 0x44, 0x41, 0x54, 0x18, 0x95, 0xA5, 0xCD, 0x4B, 0x0A, 0xC0, 0x20, 0x14, 0x43, 0xD1, 0x63, 0x77,
53 0xA7, 0xDD, 0xFF, 0x06, 0xD4, 0x7D, 0x3C, 0x07, 0x95, 0x42, 0x3F, 0xE0, 0xC0, 0x84, 0x0C, 0x02,
54 0xE1, 0x86, 0x78, 0x99, 0x13, 0x1D, 0x0D, 0xC5, 0xCF, 0xA0, 0x21, 0x66, 0xEA, 0x61, 0xA9, 0x2F,
55 0xA1, 0x4C, 0x4A, 0x45, 0x4E, 0x71, 0xA1, 0x6E, 0xA5, 0x67, 0xB5, 0xBC, 0xD8, 0x1F, 0x0C, 0xA7,
56 0xFD, 0x23, 0x67, 0x70, 0xDA, 0x89, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
110 BOOST_CHECK_EQUAL( cempty.
GetPPI(), 300 );
111 BOOST_CHECK_EQUAL( cempty.
GetScale(), 1.0 );
115 empty.Rotate(
true );
116 empty.Mirror(
true );
153 BOOST_CHECK_EQUAL( img.
GetPPI(), 300 );
154 BOOST_CHECK_EQUAL( img.
GetScale(), 5.0 );
163 BOOST_CHECK( bb.GetPosition() == wxPoint( -40, -40 ) );
173 const wxImage* img_data = m_4tile.GetImageData();
174 BOOST_REQUIRE_NE( img_data,
nullptr );
178 const std::vector<TEST_PIXEL_CASE> exp_pixels = {
185 for(
const auto& c : exp_pixels )
187 BOOST_CHECK_PREDICATE(
198 m_4tile.Rotate(
false );
200 const wxImage* img_data = m_4tile.GetImageData();
201 BOOST_REQUIRE_NE( img_data,
nullptr );
205 const std::vector<TEST_PIXEL_CASE> exp_pixels = {
212 for(
const auto& c : exp_pixels )
214 BOOST_CHECK_PREDICATE(
224 m_4tile.Mirror(
true );
226 const wxImage* img_data = m_4tile.GetImageData();
227 BOOST_REQUIRE_NE( img_data,
nullptr );
231 const std::vector<TEST_PIXEL_CASE> exp_pixels = {
238 for(
const auto& c : exp_pixels )
240 BOOST_CHECK_PREDICATE(
245 BOOST_AUTO_TEST_SUITE_END()
void SetScale(double aScale)
static const wxSize size_4tile
static const KIGFX::COLOR4D col_red
const EDA_RECT GetBoundingBox() const
Return the orthogonal, bounding box of this object for display purposes.
BOOST_CHECK(v2.Cross(v1)==1)
This class handle bitmap images in KiCad.
TEST_BITMAP_BASE_FIXTURE()
static const std::vector< unsigned char > png_data_4tile
4tile is an 8x8 image
BOOST_AUTO_TEST_CASE(Empty)
Declare the test suite.
void SetPixelSizeIu(double aPixSize)
static const KIGFX::COLOR4D col_green
double GetPixelSizeIu() const
bool IsImagePixelOfColor(const wxImage &aImage, int aX, int aY, const KIGFX::COLOR4D &aColor)
Predicate to check an image pixel matches color and alpha.
static const KIGFX::COLOR4D col_blue
Handle the component boundary box.
wxSize GetSizePixels() const
static bool empty(const wxTextEntryBase *aCtrl)
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores in memory an image file.
static const KIGFX::COLOR4D col_black
A color representation with 4 components: red, green, blue, alpha.