Changed image_data_gray* to image_gray* Ref #2633.

This commit is contained in:
Blake Thompson 2015-01-21 21:08:04 -06:00
parent 22a384ef33
commit e01ce5b7d6
26 changed files with 103 additions and 103 deletions

View file

@ -53,9 +53,9 @@ struct image_data_null
using image_data_base = util::variant<image_data_null, using image_data_base = util::variant<image_data_null,
image_rgba8, image_rgba8,
image_data_gray8, image_gray8,
image_data_gray16, image_gray16,
image_data_gray32f>; image_gray32f>;
// Forward declaring // Forward declaring
struct image_any; struct image_any;
@ -208,11 +208,11 @@ inline image_any create_image_any(int width,
switch (type) switch (type)
{ {
case image_dtype_gray8: case image_dtype_gray8:
return image_any(std::move(image_data_gray8(width, height, initialize, premultiplied, painted))); return image_any(std::move(image_gray8(width, height, initialize, premultiplied, painted)));
case image_dtype_gray16: case image_dtype_gray16:
return image_any(std::move(image_data_gray16(width, height, initialize, premultiplied, painted))); return image_any(std::move(image_gray16(width, height, initialize, premultiplied, painted)));
case image_dtype_gray32f: case image_dtype_gray32f:
return image_any(std::move(image_data_gray32f(width, height, initialize, premultiplied, painted))); return image_any(std::move(image_gray32f(width, height, initialize, premultiplied, painted)));
case image_dtype_null: case image_dtype_null:
return image_any(std::move(image_data_null())); return image_any(std::move(image_data_null()));
case image_dtype_rgba8: case image_dtype_rgba8:

View file

@ -278,9 +278,9 @@ private:
}; };
using image_rgba8 = image_data<std::uint32_t>; using image_rgba8 = image_data<std::uint32_t>;
using image_data_gray8 = image_data<std::uint8_t> ; using image_gray8 = image_data<std::uint8_t> ;
using image_data_gray16 = image_data<std::int16_t>; using image_gray16 = image_data<std::int16_t>;
using image_data_gray32f = image_data<float>; using image_gray32f = image_data<float>;
enum image_dtype enum image_dtype
{ {

View file

@ -50,7 +50,7 @@ struct agg_scaling_traits<image_rgba8>
}; };
template <> template <>
struct agg_scaling_traits<image_data_gray8> struct agg_scaling_traits<image_gray8>
{ {
using pixfmt_pre = agg::pixfmt_gray8_pre; using pixfmt_pre = agg::pixfmt_gray8_pre;
using color_type = agg::gray8; using color_type = agg::gray8;
@ -61,7 +61,7 @@ struct agg_scaling_traits<image_data_gray8>
}; };
template <> template <>
struct agg_scaling_traits<image_data_gray16> struct agg_scaling_traits<image_gray16>
{ {
using pixfmt_pre = agg::pixfmt_gray16_pre; using pixfmt_pre = agg::pixfmt_gray16_pre;
using color_type = agg::gray16; using color_type = agg::gray16;
@ -72,7 +72,7 @@ struct agg_scaling_traits<image_data_gray16>
}; };
template <> template <>
struct agg_scaling_traits<image_data_gray32f> struct agg_scaling_traits<image_gray32f>
{ {
using pixfmt_pre = agg::pixfmt_gray32_pre; using pixfmt_pre = agg::pixfmt_gray32_pre;
using color_type = agg::gray32; using color_type = agg::gray32;

View file

@ -119,9 +119,9 @@ private:
}; };
using image_view_rgba8 = image_view<image_rgba8>; using image_view_rgba8 = image_view<image_rgba8>;
using image_view_gray8 = image_view<image_data_gray8>; using image_view_gray8 = image_view<image_gray8>;
using image_view_gray16 = image_view<image_data_gray16>; using image_view_gray16 = image_view<image_gray16>;
using image_view_gray32f = image_view<image_data_gray32f>; using image_view_gray32f = image_view<image_gray32f>;
} // end ns } // end ns

View file

@ -83,7 +83,7 @@ private:
static const unsigned char IEND_tpl[]; static const unsigned char IEND_tpl[];
}; };
extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_data_gray8>(image_data_gray8 const& image); extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_gray8>(image_gray8 const& image);
extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_view_gray8>(image_view_gray8 const& image); extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_view_gray8>(image_view_gray8 const& image);
extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_rgba8>(image_rgba8 const& image); extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_rgba8>(image_rgba8 const& image);
extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_view_rgba8>(image_view_rgba8 const& image); extern template MAPNIK_DECL void PNGWriter::writeIDAT<image_view_rgba8>(image_view_rgba8 const& image);

View file

@ -149,7 +149,7 @@ void save_as_png(T1 & file,
template <typename T> template <typename T>
void reduce_8(T const& in, void reduce_8(T const& in,
image_data_gray8 & out, image_gray8 & out,
octree<rgb> trees[], octree<rgb> trees[],
unsigned limits[], unsigned limits[],
unsigned levels, unsigned levels,
@ -167,7 +167,7 @@ void reduce_8(T const& in,
for (unsigned y = 0; y < height; ++y) for (unsigned y = 0; y < height; ++y)
{ {
mapnik::image_rgba8::pixel_type const * row = in.getRow(y); mapnik::image_rgba8::pixel_type const * row = in.getRow(y);
mapnik::image_data_gray8::pixel_type * row_out = out.getRow(y); mapnik::image_gray8::pixel_type * row_out = out.getRow(y);
for (unsigned x = 0; x < width; ++x) for (unsigned x = 0; x < width; ++x)
{ {
unsigned val = row[x]; unsigned val = row[x];
@ -200,7 +200,7 @@ void reduce_8(T const& in,
template <typename T> template <typename T>
void reduce_4(T const& in, void reduce_4(T const& in,
image_data_gray8 & out, image_gray8 & out,
octree<rgb> trees[], octree<rgb> trees[],
unsigned limits[], unsigned limits[],
unsigned levels, unsigned levels,
@ -218,7 +218,7 @@ void reduce_4(T const& in,
for (unsigned y = 0; y < height; ++y) for (unsigned y = 0; y < height; ++y)
{ {
mapnik::image_rgba8::pixel_type const * row = in.getRow(y); mapnik::image_rgba8::pixel_type const * row = in.getRow(y);
mapnik::image_data_gray8::pixel_type * row_out = out.getRow(y); mapnik::image_gray8::pixel_type * row_out = out.getRow(y);
for (unsigned x = 0; x < width; ++x) for (unsigned x = 0; x < width; ++x)
{ {
unsigned val = row[x]; unsigned val = row[x];
@ -256,7 +256,7 @@ void reduce_4(T const& in,
// 1-bit but only one color. // 1-bit but only one color.
template <typename T> template <typename T>
void reduce_1(T const&, void reduce_1(T const&,
image_data_gray8 & out, image_gray8 & out,
octree<rgb> /*trees*/[], octree<rgb> /*trees*/[],
unsigned /*limits*/[], unsigned /*limits*/[],
std::vector<unsigned> & /*alpha*/) std::vector<unsigned> & /*alpha*/)
@ -266,7 +266,7 @@ void reduce_1(T const&,
template <typename T> template <typename T>
void save_as_png(T & file, std::vector<mapnik::rgb> const& palette, void save_as_png(T & file, std::vector<mapnik::rgb> const& palette,
mapnik::image_data_gray8 const& image, mapnik::image_gray8 const& image,
unsigned width, unsigned width,
unsigned height, unsigned height,
unsigned color_depth, unsigned color_depth,
@ -556,7 +556,7 @@ void save_as_png8_oct(T1 & file,
if (palette.size() > 16 ) if (palette.size() > 16 )
{ {
// >16 && <=256 colors -> write 8-bit color depth // >16 && <=256 colors -> write 8-bit color depth
image_data_gray8 reduced_image(width,height); image_gray8 reduced_image(width,height);
reduce_8(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable); reduce_8(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable);
save_as_png(file,palette,reduced_image,width,height,8,alphaTable,opts); save_as_png(file,palette,reduced_image,width,height,8,alphaTable,opts);
} }
@ -565,7 +565,7 @@ void save_as_png8_oct(T1 & file,
// 1 color image -> write 1-bit color depth PNG // 1 color image -> write 1-bit color depth PNG
unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary
unsigned image_height = height; unsigned image_height = height;
image_data_gray8 reduced_image(image_width,image_height); image_gray8 reduced_image(image_width,image_height);
reduce_1(image,reduced_image,trees, limits, alphaTable); reduce_1(image,reduced_image,trees, limits, alphaTable);
if (meanAlpha<255 && cols[0]==0) if (meanAlpha<255 && cols[0]==0)
{ {
@ -579,7 +579,7 @@ void save_as_png8_oct(T1 & file,
// <=16 colors -> write 4-bit color depth PNG // <=16 colors -> write 4-bit color depth PNG
unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary
unsigned image_height = height; unsigned image_height = height;
image_data_gray8 reduced_image(image_width,image_height); image_gray8 reduced_image(image_width,image_height);
reduce_4(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable); reduce_4(image, reduced_image, trees, limits, TRANSPARENCY_LEVELS, alphaTable);
save_as_png(file,palette,reduced_image,width,height,4,alphaTable,opts); save_as_png(file,palette,reduced_image,width,height,4,alphaTable,opts);
} }
@ -600,11 +600,11 @@ void save_as_png8(T1 & file,
if (palette.size() > 16 ) if (palette.size() > 16 )
{ {
// >16 && <=256 colors -> write 8-bit color depth // >16 && <=256 colors -> write 8-bit color depth
image_data_gray8 reduced_image(width, height); image_gray8 reduced_image(width, height);
for (unsigned y = 0; y < height; ++y) for (unsigned y = 0; y < height; ++y)
{ {
mapnik::image_rgba8::pixel_type const * row = image.getRow(y); mapnik::image_rgba8::pixel_type const * row = image.getRow(y);
mapnik::image_data_gray8::pixel_type * row_out = reduced_image.getRow(y); mapnik::image_gray8::pixel_type * row_out = reduced_image.getRow(y);
for (unsigned x = 0; x < width; ++x) for (unsigned x = 0; x < width; ++x)
{ {
row_out[x] = tree.quantize(row[x]); row_out[x] = tree.quantize(row[x]);
@ -617,7 +617,7 @@ void save_as_png8(T1 & file,
// 1 color image -> write 1-bit color depth PNG // 1 color image -> write 1-bit color depth PNG
unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary unsigned image_width = ((width + 15) >> 3) & ~1U; // 1-bit image, round up to 16-bit boundary
unsigned image_height = height; unsigned image_height = height;
image_data_gray8 reduced_image(image_width, image_height); image_gray8 reduced_image(image_width, image_height);
reduced_image.set(0); reduced_image.set(0);
save_as_png(file, palette, reduced_image, width, height, 1, alphaTable, opts); save_as_png(file, palette, reduced_image, width, height, 1, alphaTable, opts);
} }
@ -626,11 +626,11 @@ void save_as_png8(T1 & file,
// <=16 colors -> write 4-bit color depth PNG // <=16 colors -> write 4-bit color depth PNG
unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary unsigned image_width = ((width + 7) >> 1) & ~3U; // 4-bit image, round up to 32-bit boundary
unsigned image_height = height; unsigned image_height = height;
image_data_gray8 reduced_image(image_width, image_height); image_gray8 reduced_image(image_width, image_height);
for (unsigned y = 0; y < height; ++y) for (unsigned y = 0; y < height; ++y)
{ {
mapnik::image_rgba8::pixel_type const * row = image.getRow(y); mapnik::image_rgba8::pixel_type const * row = image.getRow(y);
mapnik::image_data_gray8::pixel_type * row_out = reduced_image.getRow(y); mapnik::image_gray8::pixel_type * row_out = reduced_image.getRow(y);
byte index = 0; byte index = 0;
for (unsigned x = 0; x < width; ++x) for (unsigned x = 0; x < width; ++x)
{ {

View file

@ -151,9 +151,9 @@ struct raster_marker_render_thunk : util::noncopyable
}; };
template struct raster_marker_render_thunk<image_rgba8>; template struct raster_marker_render_thunk<image_rgba8>;
template struct raster_marker_render_thunk<image_data_gray8>; template struct raster_marker_render_thunk<image_gray8>;
template struct raster_marker_render_thunk<image_data_gray16>; template struct raster_marker_render_thunk<image_gray16>;
template struct raster_marker_render_thunk<image_data_gray32f>; template struct raster_marker_render_thunk<image_gray32f>;
using helper_ptr = std::unique_ptr<text_symbolizer_helper>; using helper_ptr = std::unique_ptr<text_symbolizer_helper>;
@ -185,9 +185,9 @@ struct text_render_thunk : util::noncopyable
using render_thunk = util::variant<vector_marker_render_thunk, using render_thunk = util::variant<vector_marker_render_thunk,
raster_marker_render_thunk<image_rgba8>, raster_marker_render_thunk<image_rgba8>,
raster_marker_render_thunk<image_data_gray8>, raster_marker_render_thunk<image_gray8>,
raster_marker_render_thunk<image_data_gray16>, raster_marker_render_thunk<image_gray16>,
raster_marker_render_thunk<image_data_gray32f>, raster_marker_render_thunk<image_gray32f>,
text_render_thunk>; text_render_thunk>;
using render_thunk_ptr = std::unique_ptr<render_thunk>; using render_thunk_ptr = std::unique_ptr<render_thunk>;
using render_thunk_list = std::list<render_thunk_ptr>; using render_thunk_list = std::list<render_thunk_ptr>;

View file

@ -216,7 +216,7 @@ struct tag_setter
} }
} }
inline void operator() (image_data_gray32f const&) const inline void operator() (image_gray32f const&) const
{ {
TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
@ -229,7 +229,7 @@ struct tag_setter
TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_FLOATINGPOINT); TIFFSetField(output_, TIFFTAG_PREDICTOR, PREDICTOR_FLOATINGPOINT);
} }
} }
inline void operator() (image_data_gray16 const&) const inline void operator() (image_gray16 const&) const
{ {
TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
@ -243,7 +243,7 @@ struct tag_setter
} }
} }
inline void operator() (image_data_gray8 const&) const inline void operator() (image_gray8 const&) const
{ {
TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(output_, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(output_, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);

View file

@ -203,7 +203,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Reading band=" << band_; MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Reading band=" << band_;
if (band_ > 0) // we are querying a single band if (band_ > 0) // we are querying a single band
{ {
mapnik::image_data_gray16 image(im_width, im_height); mapnik::image_gray16 image(im_width, im_height);
image.set(std::numeric_limits<std::int16_t>::max()); image.set(std::numeric_limits<std::int16_t>::max());
if (band_ > nbands_) if (band_ > nbands_)
{ {

View file

@ -183,7 +183,7 @@ mapnik::raster_ptr read_data_band(mapnik::box2d<double> const& bbox,
uint16_t width, uint16_t height, uint16_t width, uint16_t height,
bool hasnodata, T reader) bool hasnodata, T reader)
{ {
mapnik::image_data_gray32f image(width, height); mapnik::image_gray32f image(width, height);
//image.set(std::numeric_limits<float>::max()); //image.set(std::numeric_limits<float>::max());
// Start with plain white (ABGR or RGBA depending on endiannes) // Start with plain white (ABGR or RGBA depending on endiannes)
// TODO: set to transparent instead? // TODO: set to transparent instead?

View file

@ -112,19 +112,19 @@ struct thunk_renderer<image_rgba8>
render_raster_marker(renb, *ras_ptr_, thunk.src_, offset_tr, thunk.opacity_, common_.scale_factor_, thunk.snap_to_pixels_); render_raster_marker(renb, *ras_ptr_, thunk.src_, offset_tr, thunk.opacity_, common_.scale_factor_, thunk.snap_to_pixels_);
} }
void operator()(raster_marker_render_thunk<image_data_gray8> const &thunk) const void operator()(raster_marker_render_thunk<image_gray8> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray8 type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray8 type is not supported currently by the image_rgba8 renderer");
} }
void operator()(raster_marker_render_thunk<image_data_gray16> const &thunk) const void operator()(raster_marker_render_thunk<image_gray16> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray16 type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray16 type is not supported currently by the image_rgba8 renderer");
} }
void operator()(raster_marker_render_thunk<image_data_gray32f> const &thunk) const void operator()(raster_marker_render_thunk<image_gray32f> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray32f type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray32f type is not supported currently by the image_rgba8 renderer");
} }
void operator()(text_render_thunk const &thunk) const void operator()(text_render_thunk const &thunk) const

View file

@ -119,19 +119,19 @@ struct thunk_renderer
pixmap_.add_feature(feature_); pixmap_.add_feature(feature_);
} }
void operator()(raster_marker_render_thunk<image_data_gray8> const &thunk) const void operator()(raster_marker_render_thunk<image_gray8> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray8 type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray8 type is not supported currently by the image_rgba8 renderer");
} }
void operator()(raster_marker_render_thunk<image_data_gray16> const &thunk) const void operator()(raster_marker_render_thunk<image_gray16> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray16 type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray16 type is not supported currently by the image_rgba8 renderer");
} }
void operator()(raster_marker_render_thunk<image_data_gray32f> const &thunk) const void operator()(raster_marker_render_thunk<image_gray32f> const &thunk) const
{ {
throw std::runtime_error("Rendering of this image_data_gray32f type is not supported currently by the image_rgba8 renderer"); throw std::runtime_error("Rendering of this image_gray32f type is not supported currently by the image_rgba8 renderer");
} }
void operator()(text_render_thunk const &thunk) const void operator()(text_render_thunk const &thunk) const

View file

@ -182,12 +182,12 @@ MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_
} }
template <> template <>
MAPNIK_DECL void composite(image_data_gray32f & dst, image_data_gray32f const& src, composite_mode_e mode, MAPNIK_DECL void composite(image_gray32f & dst, image_gray32f const& src, composite_mode_e mode,
float opacity, float opacity,
int dx, int dx,
int dy) int dy)
{ {
using const_rendering_buffer = detail::rendering_buffer<image_data_gray32f>; using const_rendering_buffer = detail::rendering_buffer<image_gray32f>;
using src_pixfmt_type = agg::pixfmt_alpha_blend_gray<agg::blender_gray<agg::gray32>, const_rendering_buffer, 1, 0>; using src_pixfmt_type = agg::pixfmt_alpha_blend_gray<agg::blender_gray<agg::gray32>, const_rendering_buffer, 1, 0>;
using dst_pixfmt_type = agg::pixfmt_alpha_blend_gray<agg::blender_gray<agg::gray32>, agg::rendering_buffer, 1, 0>; using dst_pixfmt_type = agg::pixfmt_alpha_blend_gray<agg::blender_gray<agg::gray32>, agg::rendering_buffer, 1, 0>;
using renderer_type = agg::renderer_base<dst_pixfmt_type>; using renderer_type = agg::renderer_base<dst_pixfmt_type>;
@ -239,9 +239,9 @@ void composite_visitor::operator()<image_rgba8> (image_rgba8 & dst)
} }
template <> template <>
void composite_visitor::operator()<image_data_gray32f> (image_data_gray32f & dst) void composite_visitor::operator()<image_gray32f> (image_gray32f & dst)
{ {
composite(dst, util::get<image_data_gray32f>(src_), mode_, opacity_, dx_, dy_); composite(dst, util::get<image_gray32f>(src_), mode_, opacity_, dx_, dy_);
} }
} // end ns } // end ns

View file

@ -168,13 +168,13 @@ void scale_image_agg(T & target, T const& source, scaling_method_e scaling_metho
template MAPNIK_DECL void scale_image_agg(image_rgba8 &, image_rgba8 const&, scaling_method_e, template MAPNIK_DECL void scale_image_agg(image_rgba8 &, image_rgba8 const&, scaling_method_e,
double, double , double, double , double); double, double , double, double , double);
template MAPNIK_DECL void scale_image_agg(image_data_gray8 &, image_data_gray8 const&, scaling_method_e, template MAPNIK_DECL void scale_image_agg(image_gray8 &, image_gray8 const&, scaling_method_e,
double, double , double, double , double); double, double , double, double , double);
template MAPNIK_DECL void scale_image_agg(image_data_gray16 &, image_data_gray16 const&, scaling_method_e, template MAPNIK_DECL void scale_image_agg(image_gray16 &, image_gray16 const&, scaling_method_e,
double, double , double, double , double); double, double , double, double , double);
template MAPNIK_DECL void scale_image_agg(image_data_gray32f &, image_data_gray32f const&, scaling_method_e, template MAPNIK_DECL void scale_image_agg(image_gray32f &, image_gray32f const&, scaling_method_e,
double, double , double, double , double); double, double , double, double , double);
} }

View file

@ -422,9 +422,9 @@ struct is_solid_visitor
}; };
template bool is_solid_visitor::operator()<image_rgba8> (image_rgba8 const& data); template bool is_solid_visitor::operator()<image_rgba8> (image_rgba8 const& data);
template bool is_solid_visitor::operator()<image_data_gray8> (image_data_gray8 const& data); template bool is_solid_visitor::operator()<image_gray8> (image_gray8 const& data);
template bool is_solid_visitor::operator()<image_data_gray16> (image_data_gray16 const& data); template bool is_solid_visitor::operator()<image_gray16> (image_gray16 const& data);
template bool is_solid_visitor::operator()<image_data_gray32f> (image_data_gray32f const& data); template bool is_solid_visitor::operator()<image_gray32f> (image_gray32f const& data);
template bool is_solid_visitor::operator()<image_view_rgba8> (image_view_rgba8 const& data); template bool is_solid_visitor::operator()<image_view_rgba8> (image_view_rgba8 const& data);
template bool is_solid_visitor::operator()<image_view_gray8> (image_view_gray8 const& data); template bool is_solid_visitor::operator()<image_view_gray8> (image_view_gray8 const& data);
template bool is_solid_visitor::operator()<image_view_gray16> (image_view_gray16 const& data); template bool is_solid_visitor::operator()<image_view_gray16> (image_view_gray16 const& data);

View file

@ -88,9 +88,9 @@ void jpeg_saver::operator() (T const& image) const
throw ImageWriterException("Mapnik does not support jpeg grayscale images"); throw ImageWriterException("Mapnik does not support jpeg grayscale images");
} }
template void jpeg_saver::operator() (image_data_gray8 const& image) const; template void jpeg_saver::operator() (image_gray8 const& image) const;
template void jpeg_saver::operator() (image_data_gray16 const& image) const; template void jpeg_saver::operator() (image_gray16 const& image) const;
template void jpeg_saver::operator() (image_data_gray32f const& image) const; template void jpeg_saver::operator() (image_gray32f const& image) const;
template void jpeg_saver::operator() (image_view_gray8 const& image) const; template void jpeg_saver::operator() (image_view_gray8 const& image) const;
template void jpeg_saver::operator() (image_view_gray16 const& image) const; template void jpeg_saver::operator() (image_view_gray16 const& image) const;
template void jpeg_saver::operator() (image_view_gray32f const& image) const; template void jpeg_saver::operator() (image_view_gray32f const& image) const;

View file

@ -308,15 +308,15 @@ void png_saver_pal::operator() (T const& image) const
#endif #endif
} }
template void png_saver::operator() (image_data_gray8 const& image) const; template void png_saver::operator() (image_gray8 const& image) const;
template void png_saver::operator() (image_data_gray16 const& image) const; template void png_saver::operator() (image_gray16 const& image) const;
template void png_saver::operator() (image_data_gray32f const& image) const; template void png_saver::operator() (image_gray32f const& image) const;
template void png_saver::operator() (image_view_gray8 const& image) const; template void png_saver::operator() (image_view_gray8 const& image) const;
template void png_saver::operator() (image_view_gray16 const& image) const; template void png_saver::operator() (image_view_gray16 const& image) const;
template void png_saver::operator() (image_view_gray32f const& image) const; template void png_saver::operator() (image_view_gray32f const& image) const;
template void png_saver_pal::operator() (image_data_gray8 const& image) const; template void png_saver_pal::operator() (image_gray8 const& image) const;
template void png_saver_pal::operator() (image_data_gray16 const& image) const; template void png_saver_pal::operator() (image_gray16 const& image) const;
template void png_saver_pal::operator() (image_data_gray32f const& image) const; template void png_saver_pal::operator() (image_gray32f const& image) const;
template void png_saver_pal::operator() (image_view_gray8 const& image) const; template void png_saver_pal::operator() (image_view_gray8 const& image) const;
template void png_saver_pal::operator() (image_view_gray16 const& image) const; template void png_saver_pal::operator() (image_view_gray16 const& image) const;
template void png_saver_pal::operator() (image_view_gray32f const& image) const; template void png_saver_pal::operator() (image_view_gray32f const& image) const;

View file

@ -182,9 +182,9 @@ void tiff_saver::operator() (T const& image) const
} }
template void tiff_saver::operator() (image_rgba8 const& image) const; template void tiff_saver::operator() (image_rgba8 const& image) const;
template void tiff_saver::operator() (image_data_gray8 const& image) const; template void tiff_saver::operator() (image_gray8 const& image) const;
template void tiff_saver::operator() (image_data_gray16 const& image) const; template void tiff_saver::operator() (image_gray16 const& image) const;
template void tiff_saver::operator() (image_data_gray32f const& image) const; template void tiff_saver::operator() (image_gray32f const& image) const;
template void tiff_saver::operator() (image_view_rgba8 const& image) const; template void tiff_saver::operator() (image_view_rgba8 const& image) const;
template void tiff_saver::operator() (image_view_gray8 const& image) const; template void tiff_saver::operator() (image_view_gray8 const& image) const;
template void tiff_saver::operator() (image_view_gray16 const& image) const; template void tiff_saver::operator() (image_view_gray16 const& image) const;

View file

@ -378,9 +378,9 @@ void webp_saver::operator() (T const& image) const
} }
template void webp_saver::operator()<image_rgba8> (image_rgba8 const& image) const; template void webp_saver::operator()<image_rgba8> (image_rgba8 const& image) const;
template void webp_saver::operator()<image_data_gray8> (image_data_gray8 const& image) const; template void webp_saver::operator()<image_gray8> (image_gray8 const& image) const;
template void webp_saver::operator()<image_data_gray16> (image_data_gray16 const& image) const; template void webp_saver::operator()<image_gray16> (image_gray16 const& image) const;
template void webp_saver::operator()<image_data_gray32f> (image_data_gray32f const& image) const; template void webp_saver::operator()<image_gray32f> (image_gray32f const& image) const;
template void webp_saver::operator()<image_view_rgba8> (image_view_rgba8 const& image) const; template void webp_saver::operator()<image_view_rgba8> (image_view_rgba8 const& image) const;
template void webp_saver::operator()<image_view_gray8> (image_view_gray8 const& image) const; template void webp_saver::operator()<image_view_gray8> (image_view_gray8 const& image) const;
template void webp_saver::operator()<image_view_gray16> (image_view_gray16 const& image) const; template void webp_saver::operator()<image_view_gray16> (image_view_gray16 const& image) const;

View file

@ -361,7 +361,7 @@ const mz_uint8 PNGWriter::IEND_tpl[] = {
'I', 'E', 'N', 'D' // "IEND" 'I', 'E', 'N', 'D' // "IEND"
}; };
template void PNGWriter::writeIDAT<image_data_gray8>(image_data_gray8 const& image); template void PNGWriter::writeIDAT<image_gray8>(image_gray8 const& image);
template void PNGWriter::writeIDAT<image_view_gray8>(image_view_gray8 const& image); template void PNGWriter::writeIDAT<image_view_gray8>(image_view_gray8 const& image);
template void PNGWriter::writeIDAT<image_rgba8>(image_rgba8 const& image); template void PNGWriter::writeIDAT<image_rgba8>(image_rgba8 const& image);
template void PNGWriter::writeIDAT<image_view_rgba8>(image_view_rgba8 const& image); template void PNGWriter::writeIDAT<image_view_rgba8>(image_view_rgba8 const& image);

View file

@ -286,13 +286,13 @@ unsigned raster_colorizer::get_color(float value) const
} }
template void raster_colorizer::colorize(image_rgba8 & out, image_data_gray8 const& in, template void raster_colorizer::colorize(image_rgba8 & out, image_gray8 const& in,
boost::optional<double>const& nodata, boost::optional<double>const& nodata,
feature_impl const& f) const; feature_impl const& f) const;
template void raster_colorizer::colorize(image_rgba8 & out, image_data_gray16 const& in, template void raster_colorizer::colorize(image_rgba8 & out, image_gray16 const& in,
boost::optional<double>const& nodata, boost::optional<double>const& nodata,
feature_impl const& f) const; feature_impl const& f) const;
template void raster_colorizer::colorize(image_rgba8 & out, image_data_gray32f const& in, template void raster_colorizer::colorize(image_rgba8 & out, image_gray32f const& in,
boost::optional<double>const& nodata, boost::optional<double>const& nodata,
feature_impl const& f) const; feature_impl const& f) const;

View file

@ -50,7 +50,7 @@ raster_marker_render_thunk<image_rgba8>::raster_marker_render_thunk(image_rgba8
{} {}
template <> template <>
raster_marker_render_thunk<image_data_gray8>::raster_marker_render_thunk(image_data_gray8 & src, raster_marker_render_thunk<image_gray8>::raster_marker_render_thunk(image_gray8 & src,
agg::trans_affine const& marker_trans, agg::trans_affine const& marker_trans,
double opacity, double opacity,
composite_mode_e comp_op, composite_mode_e comp_op,
@ -60,7 +60,7 @@ raster_marker_render_thunk<image_data_gray8>::raster_marker_render_thunk(image_d
{} {}
template <> template <>
raster_marker_render_thunk<image_data_gray16>::raster_marker_render_thunk(image_data_gray16 & src, raster_marker_render_thunk<image_gray16>::raster_marker_render_thunk(image_gray16 & src,
agg::trans_affine const& marker_trans, agg::trans_affine const& marker_trans,
double opacity, double opacity,
composite_mode_e comp_op, composite_mode_e comp_op,
@ -70,7 +70,7 @@ raster_marker_render_thunk<image_data_gray16>::raster_marker_render_thunk(image_
{} {}
template <> template <>
raster_marker_render_thunk<image_data_gray32f>::raster_marker_render_thunk(image_data_gray32f & src, raster_marker_render_thunk<image_gray32f>::raster_marker_render_thunk(image_gray32f & src,
agg::trans_affine const& marker_trans, agg::trans_affine const& marker_trans,
double opacity, double opacity,
composite_mode_e comp_op, composite_mode_e comp_op,

View file

@ -81,7 +81,7 @@ std::shared_ptr<image_data_null> render_pattern<image_data_null>(rasterizer & ra
} }
/* /*
template <> template <>
std::shared_ptr<image_data_gray8> render_pattern<image_data_gray8>(rasterizer & ras, std::shared_ptr<image_gray8> render_pattern<image_gray8>(rasterizer & ras,
marker const& marker, marker const& marker,
agg::trans_affine const& tr, agg::trans_affine const& tr,
double opacity) double opacity)
@ -97,7 +97,7 @@ std::shared_ptr<image_data_gray8> render_pattern<image_data_gray8>(rasterizer &
mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height()); mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height());
mtx = tr * mtx; mtx = tr * mtx;
std::shared_ptr<mapnik::image_data_gray8> image = std::make_shared<mapnik::image_data_gray8>(bbox.width(), bbox.height()); std::shared_ptr<mapnik::image_gray8> image = std::make_shared<mapnik::image_gray8>(bbox.width(), bbox.height());
agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width()); agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width());
pixfmt pixf(buf); pixfmt pixf(buf);
renderer_base renb(pixf); renderer_base renb(pixf);
@ -115,7 +115,7 @@ std::shared_ptr<image_data_gray8> render_pattern<image_data_gray8>(rasterizer &
} }
template <> template <>
std::shared_ptr<image_data_gray16> render_pattern<image_data_gray16>(rasterizer & ras, std::shared_ptr<image_gray16> render_pattern<image_gray16>(rasterizer & ras,
marker const& marker, marker const& marker,
agg::trans_affine const& tr, agg::trans_affine const& tr,
double opacity) double opacity)
@ -131,7 +131,7 @@ std::shared_ptr<image_data_gray16> render_pattern<image_data_gray16>(rasterizer
mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height()); mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height());
mtx = tr * mtx; mtx = tr * mtx;
std::shared_ptr<mapnik::image_data_gray16> image = std::make_shared<mapnik::image_data_gray16>(bbox.width(), bbox.height()); std::shared_ptr<mapnik::image_gray16> image = std::make_shared<mapnik::image_gray16>(bbox.width(), bbox.height());
agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width() * 2); agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width() * 2);
pixfmt pixf(buf); pixfmt pixf(buf);
renderer_base renb(pixf); renderer_base renb(pixf);
@ -149,7 +149,7 @@ std::shared_ptr<image_data_gray16> render_pattern<image_data_gray16>(rasterizer
} }
template <> template <>
std::shared_ptr<image_data_gray32f> render_pattern<image_data_gray32f>(rasterizer & ras, std::shared_ptr<image_gray32f> render_pattern<image_gray32f>(rasterizer & ras,
marker const& marker, marker const& marker,
agg::trans_affine const& tr, agg::trans_affine const& tr,
double opacity) double opacity)
@ -165,7 +165,7 @@ std::shared_ptr<image_data_gray32f> render_pattern<image_data_gray32f>(rasterize
mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height()); mtx.translate(0.5 * bbox.width(), 0.5 * bbox.height());
mtx = tr * mtx; mtx = tr * mtx;
std::shared_ptr<mapnik::image_data_gray32f> image = std::make_shared<mapnik::image_data_gray32f>(bbox.width(), bbox.height()); std::shared_ptr<mapnik::image_gray32f> image = std::make_shared<mapnik::image_gray32f>(bbox.width(), bbox.height());
agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width() * 4); agg::rendering_buffer buf(image->getBytes(), image->width(), image->height(), image->width() * 4);
pixfmt pixf(buf); pixfmt pixf(buf);
renderer_base renb(pixf); renderer_base renb(pixf);

View file

@ -495,15 +495,15 @@ image_any tiff_reader<T>::read(unsigned x0, unsigned y0, unsigned width, unsigne
{ {
case 8: case 8:
{ {
return read_any_gray<image_data_gray8>(x0, y0, width, height); return read_any_gray<image_gray8>(x0, y0, width, height);
} }
case 16: case 16:
{ {
return read_any_gray<image_data_gray16>(x0, y0, width, height); return read_any_gray<image_gray16>(x0, y0, width, height);
} }
case 32: case 32:
{ {
return read_any_gray<image_data_gray32f>(x0, y0, width, height); return read_any_gray<image_gray32f>(x0, y0, width, height);
} }
} }
} }

View file

@ -213,13 +213,13 @@ void reproject_and_scale_raster(raster & target, raster const& source,
template MAPNIK_DECL void warp_image (image_rgba8&, image_rgba8 const&, proj_transform const&, template MAPNIK_DECL void warp_image (image_rgba8&, image_rgba8 const&, proj_transform const&,
box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double); box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double);
template MAPNIK_DECL void warp_image (image_data_gray8&, image_data_gray8 const&, proj_transform const&, template MAPNIK_DECL void warp_image (image_gray8&, image_gray8 const&, proj_transform const&,
box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double); box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double);
template MAPNIK_DECL void warp_image (image_data_gray16&, image_data_gray16 const&, proj_transform const&, template MAPNIK_DECL void warp_image (image_gray16&, image_gray16 const&, proj_transform const&,
box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double); box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double);
template MAPNIK_DECL void warp_image (image_data_gray32f&, image_data_gray32f const&, proj_transform const&, template MAPNIK_DECL void warp_image (image_gray32f&, image_gray32f const&, proj_transform const&,
box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double); box2d<double> const&, box2d<double> const&, double, double, unsigned, scaling_method_e, double);

View file

@ -185,7 +185,7 @@ SECTION("gray8 striped") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray8>() == true ); REQUIRE( data.is<mapnik::image_gray8>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL
@ -201,7 +201,7 @@ SECTION("gray8 tiled") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray8>() == true ); REQUIRE( data.is<mapnik::image_gray8>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL
@ -217,7 +217,7 @@ SECTION("gray16 striped") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray16>() == true ); REQUIRE( data.is<mapnik::image_gray16>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL
@ -233,7 +233,7 @@ SECTION("gray16 tiled") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray16>() == true ); REQUIRE( data.is<mapnik::image_gray16>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL
@ -249,7 +249,7 @@ SECTION("gray32f striped") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_NONE ); REQUIRE( tiff_reader.compression() == COMPRESSION_NONE );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray32f>() == true ); REQUIRE( data.is<mapnik::image_gray32f>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL
@ -265,7 +265,7 @@ SECTION("gray32f tiled") {
REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK );
REQUIRE( tiff_reader.compression() == COMPRESSION_LZW ); REQUIRE( tiff_reader.compression() == COMPRESSION_LZW );
mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height()); mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
REQUIRE( data.is<mapnik::image_data_gray32f>() == true ); REQUIRE( data.is<mapnik::image_gray32f>() == true );
TIFF_ASSERT_SIZE( data,reader ); TIFF_ASSERT_SIZE( data,reader );
TIFF_ASSERT_NO_ALPHA( data ); TIFF_ASSERT_NO_ALPHA( data );
TIFF_READ_ONE_PIXEL TIFF_READ_ONE_PIXEL