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; }
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); } } }
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; }