示例#1
0
bool PNG::operator==(PNG const & other) const { 
if (_width != other._width || _height != other._height) 
return false; 
for (size_t y = 0; y < _height; y++) { 
for (size_t x = 0; x < _width; x++) 
{

if( !_pixels_same( _pixel( x, y ), other._pixel( x, y ) ) ) 
return false;
}
} 
return true; } 
示例#2
0
void PNG::_copy(PNG const & other) 
{

_width = other._width; 
_height = other._height;

_pixels = new RGBAPixel[_height * _width]; 
for (size_t y = 0; y < _height; y++)

{ 
for (size_t x = 0; x < _width; x++) 
{
_pixel(x,y) = other._pixel(x,y); 
} 
} 
} 
示例#3
0
bool PNG::operator==(PNG const & other) const
{
	if (_width != other._width || _height != other._height)
		return false;
	for (int y = 0; y < _height; y++)
	{
		for (int x = 0; x < _width; x++)
		{
			if (_pixel(x,y) != other._pixel(x,y))
				return false;
		}
	}
	return true;
}