ImageData -> image_data (remove camel-case)

This commit is contained in:
artemp 2014-10-21 16:06:27 +01:00
parent fdd646aa5b
commit 295f15bd51
5 changed files with 15 additions and 15 deletions

View file

@ -50,7 +50,7 @@ class MAPNIK_DECL hit_grid
{
public:
using value_type = T;
using data_type = mapnik::ImageData<value_type>;
using data_type = mapnik::image_data<value_type>;
using lookup_type = std::string;
// mapping between pixel id and key
using feature_key_type = std::map<value_type, lookup_type>;

View file

@ -196,7 +196,7 @@ private:
feature_type const& features_;
};
using grid_view = hit_grid_view<mapnik::ImageData<mapnik::value_integer> >;
using grid_view = hit_grid_view<mapnik::image_data<mapnik::value_integer> >;
}

View file

@ -34,12 +34,12 @@
namespace mapnik
{
template <typename T>
class ImageData
class image_data
{
public:
using pixel_type = T;
ImageData(int width, int height)
image_data(int width, int height)
: width_(static_cast<unsigned>(width)),
height_(static_cast<unsigned>(height)),
owns_data_(true)
@ -56,7 +56,7 @@ public:
if (pData_) std::fill(pData_, pData_ + width_ * height_, 0);
}
ImageData(int width, int height, T * data)
image_data(int width, int height, T * data)
: width_(static_cast<unsigned>(width)),
height_(static_cast<unsigned>(height)),
owns_data_(false),
@ -72,7 +72,7 @@ public:
}
}
ImageData(ImageData<T> const& rhs)
image_data(image_data<T> const& rhs)
:width_(rhs.width_),
height_(rhs.height_),
owns_data_(true),
@ -82,7 +82,7 @@ public:
if (pData_) std::copy(rhs.pData_, rhs.pData_ + rhs.width_* rhs.height_, pData_);
}
ImageData(ImageData<T> && rhs) noexcept
image_data(image_data<T> && rhs) noexcept
: width_(rhs.width_),
height_(rhs.height_),
pData_(rhs.pData_)
@ -92,13 +92,13 @@ public:
rhs.pData_ = nullptr;
}
ImageData<T>& operator=(ImageData<T> rhs)
image_data<T>& operator=(image_data<T> rhs)
{
swap(rhs);
return *this;
}
void swap(ImageData<T> & rhs)
void swap(image_data<T> & rhs)
{
std::swap(width_, rhs.width_);
std::swap(height_, rhs.height_);
@ -169,7 +169,7 @@ public:
std::copy(buf, buf + (x1 - x0), pData_ + row * width_);
}
inline ~ImageData()
inline ~image_data()
{
if (owns_data_)
{
@ -184,8 +184,8 @@ private:
T *pData_;
};
using image_data_32 = ImageData<unsigned>;
using image_data_8 = ImageData<byte> ;
using image_data_32 = image_data<unsigned>;
using image_data_8 = image_data<byte> ;
}
#endif // MAPNIK_IMAGE_DATA_HPP

View file

@ -77,7 +77,7 @@ inline int import_image_data(T2 const& image,
WebPPicture & pic,
bool alpha)
{
ImageData<typename T2::pixel_type> const& data = image.data();
image_data<typename T2::pixel_type> const& data = image.data();
int stride = sizeof(typename T2::pixel_type) * image.width();
if (data.width() == image.width() &&
data.height() == image.height())

View file

@ -61,8 +61,8 @@ void reproject_and_scale_raster(raster & target, raster const& source,
unsigned mesh_nx = std::ceil(source.data_.width()/double(mesh_size) + 1);
unsigned mesh_ny = std::ceil(source.data_.height()/double(mesh_size) + 1);
ImageData<double> xs(mesh_nx, mesh_ny);
ImageData<double> ys(mesh_nx, mesh_ny);
image_data<double> xs(mesh_nx, mesh_ny);
image_data<double> ys(mesh_nx, mesh_ny);
// Precalculate reprojected mesh
for(unsigned j=0; j<mesh_ny; ++j)