stuff-from-scratch/src/geometry/DiscretePoint.h
2022-11-11 14:22:31 +00:00

35 lines
629 B
C++

#pragma once
#include <memory>
class DiscretePoint
{
unsigned mX;
unsigned mY;
public:
DiscretePoint(unsigned x, unsigned y);
~DiscretePoint();
std::shared_ptr<DiscretePoint> Create(unsigned x, unsigned y);
unsigned GetX() const;
unsigned GetY() const;
bool operator==(const DiscretePoint& rhs) const
{
return (mX == rhs.mX)
&& (mY == rhs.mY);
}
bool operator!=(const DiscretePoint& rhs) const
{
return !operator==(rhs);
}
};
using Pixel = DiscretePoint;
using DiscretePointPtr = std::shared_ptr<DiscretePoint>;
using PixelPtr = DiscretePointPtr;