23 lines
399 B
C++
23 lines
399 B
C++
|
|
#ifndef Pixel_h
|
|
#define Pixel_h
|
|
|
|
#include <iostream>
|
|
|
|
class Pixel {
|
|
public:
|
|
Pixel(int x = 0, int y = 0) : x(x), y(y) {}
|
|
|
|
void print() const { std::cout << '(' << x << "," << y << ") "; }
|
|
|
|
bool operator<(const Pixel &rhs) const { return x < rhs.x; }
|
|
|
|
bool operator==(const Pixel &rhs) const { return x == rhs.x; }
|
|
|
|
private:
|
|
int x;
|
|
int y;
|
|
};
|
|
|
|
#endif
|