mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
Updated image_view any with < and == operators, removed default constructor from image_view and image_view_any
This commit is contained in:
parent
702b91e369
commit
f8010f0ba1
@ -35,12 +35,14 @@ public:
|
||||
using pixel_type = typename T::pixel_type;
|
||||
static const image_dtype dtype = T::dtype;
|
||||
static constexpr std::size_t pixel_size = sizeof(pixel_type);
|
||||
|
||||
image_view() = delete;
|
||||
image_view(unsigned x, unsigned y, unsigned width, unsigned height, T const& data);
|
||||
~image_view();
|
||||
|
||||
|
||||
image_view(image_view<T> const& rhs);
|
||||
image_view<T> & operator=(image_view<T> const& rhs);
|
||||
bool operator==(image_view<T> const& rhs) const;
|
||||
bool operator<(image_view<T> const& rhs) const;
|
||||
|
||||
unsigned x() const;
|
||||
unsigned y() const;
|
||||
|
||||
@ -42,7 +42,7 @@ using image_view_base = util::variant<image_view_rgba8,
|
||||
|
||||
struct MAPNIK_DECL image_view_any : image_view_base
|
||||
{
|
||||
image_view_any() = default;
|
||||
image_view_any() = delete;
|
||||
|
||||
template <typename T>
|
||||
image_view_any(T && data) noexcept
|
||||
|
||||
@ -62,6 +62,18 @@ image_view<T> & image_view<T>::operator=(image_view<T> const& rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool image_view<T>::operator==(image_view<T> const& rhs) const
|
||||
{
|
||||
return rhs.data_.getBytes() == data_.getBytes();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool image_view<T>::operator<(image_view<T> const& rhs) const
|
||||
{
|
||||
return data_.getSize() < rhs.data_.getSize();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline unsigned image_view<T>::x() const
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user