Modified the name of image_data_null to image_null.

This commit is contained in:
Blake Thompson 2015-01-22 10:58:01 -06:00
parent e01ce5b7d6
commit e353225772
13 changed files with 20 additions and 20 deletions

View file

@ -28,7 +28,7 @@
namespace mapnik {
struct image_data_null
struct image_null
{
using pixel_type = uint8_t;
unsigned char const* getBytes() const { return nullptr; }
@ -51,7 +51,7 @@ struct image_data_null
}
};
using image_data_base = util::variant<image_data_null,
using image_data_base = util::variant<image_null,
image_rgba8,
image_gray8,
image_gray16,
@ -214,7 +214,7 @@ inline image_any create_image_any(int width,
case image_dtype_gray32f:
return image_any(std::move(image_gray32f(width, height, initialize, premultiplied, painted)));
case image_dtype_null:
return image_any(std::move(image_data_null()));
return image_any(std::move(image_null()));
case image_dtype_rgba8:
default:
return image_any(std::move(image_rgba8(width, height, initialize, premultiplied, painted)));

View file

@ -282,7 +282,7 @@ using image_gray8 = image_data<std::uint8_t> ;
using image_gray16 = image_data<std::int16_t>;
using image_gray32f = image_data<float>;
enum image_dtype
enum image_dtype : std::uint8_t
{
image_dtype_rgba8 = 0,
image_dtype_gray8,

View file

@ -69,7 +69,7 @@ struct image_data_dispatcher
composite_(composite),
nodata_(nodata) {}
void operator() (image_data_null const& data_in) const {} //no-op
void operator() (image_null const& data_in) const {} //no-op
void operator() (image_rgba8 const& data_in) const
{
image_rgba8 data_out(width_, height_, true, true);
@ -135,7 +135,7 @@ struct image_data_warp_dispatcher
composite_(composite),
nodata_(nodata) {}
void operator() (image_data_null const& data_in) const {} //no-op
void operator() (image_null const& data_in) const {} //no-op
void operator() (image_rgba8 const& data_in) const
{

View file

@ -257,7 +257,7 @@ struct tag_setter
}
}
inline void operator() (image_data_null const&) const
inline void operator() (image_null const&) const
{
// Assume this would be null type
throw ImageWriterException("Could not write TIFF - Null image provided");

View file

@ -431,7 +431,7 @@ template bool is_solid_visitor::operator()<image_view_gray16> (image_view_gray16
template bool is_solid_visitor::operator()<image_view_gray32f> (image_view_gray32f const& data);
template<>
bool is_solid_visitor::operator()<image_data_null> (image_data_null const&)
bool is_solid_visitor::operator()<image_null> (image_null const&)
{
return true;
}
@ -921,7 +921,7 @@ void visitor_set_rectangle::operator()<image_rgba8> (image_rgba8 & dst)
}
template<>
void visitor_set_rectangle::operator()<image_data_null> (image_data_null &)
void visitor_set_rectangle::operator()<image_null> (image_null &)
{
throw std::runtime_error("Set rectangle not support for null images");
}
@ -1250,7 +1250,7 @@ struct visitor_create_view
};
template <>
image_view_any visitor_create_view::operator()<image_data_null> (image_data_null const&)
image_view_any visitor_create_view::operator()<image_null> (image_null const&)
{
throw std::runtime_error("Can not make a view from a null image");
}

View file

@ -77,7 +77,7 @@ void jpeg_saver::operator()<image_view_rgba8> (image_view_rgba8 const& image) co
}
template<>
void jpeg_saver::operator()<image_data_null> (image_data_null const& image) const
void jpeg_saver::operator()<image_null> (image_null const& image) const
{
throw ImageWriterException("Can not save a null image to jpeg");
}

View file

@ -184,13 +184,13 @@ png_saver_pal::png_saver_pal(std::ostream & stream, std::string const& t, rgba_p
stream_(stream), t_(t), pal_(pal) {}
template<>
void png_saver::operator()<image_data_null> (image_data_null const& image) const
void png_saver::operator()<image_null> (image_null const& image) const
{
throw ImageWriterException("null images not supported for png");
}
template<>
void png_saver_pal::operator()<image_data_null> (image_data_null const& image) const
void png_saver_pal::operator()<image_null> (image_null const& image) const
{
throw ImageWriterException("null images not supported for png");
}

View file

@ -164,7 +164,7 @@ void handle_tiff_options(std::string const& type,
tiff_saver::tiff_saver(std::ostream & stream, std::string const& t):
stream_(stream), t_(t) {}
template<>
void tiff_saver::operator()<image_data_null> (image_data_null const& image) const
void tiff_saver::operator()<image_null> (image_null const& image) const
{
throw ImageWriterException("null images not supported");
}

View file

@ -335,7 +335,7 @@ webp_saver::webp_saver(std::ostream & stream, std::string const& t):
stream_(stream), t_(t) {}
template<>
void webp_saver::operator()<image_data_null> (image_data_null const& image) const
void webp_saver::operator()<image_null> (image_null const& image) const
{
throw ImageWriterException("null images not supported");
}

View file

@ -143,7 +143,7 @@ marker_ptr visitor_create_marker::operator()<image_rgba8> (image_rgba8 & data)
}
template<>
marker_ptr visitor_create_marker::operator()<image_data_null> (image_data_null & data)
marker_ptr visitor_create_marker::operator()<image_null> (image_null & data)
{
throw std::runtime_error("Can not make marker from null image data type");
}

View file

@ -154,7 +154,7 @@ struct visitor_push_thunk
};
template <>
void visitor_push_thunk::operator()<image_data_null> (image_data_null &)
void visitor_push_thunk::operator()<image_null> (image_null &)
{
throw std::runtime_error("Push thunk does not support null images");
}

View file

@ -72,12 +72,12 @@ std::shared_ptr<image_rgba8> render_pattern<image_rgba8>(rasterizer & ras,
}
template <>
std::shared_ptr<image_data_null> render_pattern<image_data_null>(rasterizer & ras,
std::shared_ptr<image_null> render_pattern<image_null>(rasterizer & ras,
marker const& marker,
agg::trans_affine const& tr,
double opacity)
{
throw std::runtime_error("Can not return image_data_null type from render pattern");
throw std::runtime_error("Can not return image_null type from render pattern");
}
/*
template <>

View file

@ -172,7 +172,7 @@ struct warp_image_visitor
scaling_method_(scaling_method),
filter_factor_(filter_factor) {}
void operator() (image_data_null const&) {}
void operator() (image_null const&) {}
template <typename T>
void operator() (T const& source)