42 const wxSize imageSize = aImage.GetSize();
44 if( imageSize.x < aX || imageSize.y < aY )
46 BOOST_TEST_INFO(
"Pixel (" << aX <<
", " << aY <<
"is not in image of size (" << imageSize.x
47 <<
", " << imageSize.y <<
")" );
51 const int r = aImage.GetRed( aX, aY );
52 const int g = aImage.GetGreen( aX, aY );
53 const int b = aImage.GetBlue( aX, aY );
55 const int a = aImage.HasAlpha() ? aImage.GetAlpha( aX, aY ) : 255;
59 BOOST_TEST_INFO(
"Colour doesn't match: got rgba(" << r <<
", " << g <<
", " << b <<
", "
60 << a <<
"), expected " << aColor );
72 const wxSize size = aImage.GetSize();
73 os <<
"wxImage[" << size.x <<
"x" << size.y <<
"]";
A color representation with 4 components: red, green, blue, alpha.
Test utilities for COLOUR4D objects.
bool IsColorNearHex(const KIGFX::COLOR4D &aCol, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Checks if a COLOR4D is close enough to a given RGB char value.
bool IsImagePixelOfColor(const wxImage &aImage, int aX, int aY, const KIGFX::COLOR4D &aColor)
Predicate to check an image pixel matches color and alpha.
std::ostream & boost_test_print_type(std::ostream &os, wxImage const &aImage)