Modified the name of image_data_null to image_null.
This commit is contained in:
parent
e01ce5b7d6
commit
e353225772
13 changed files with 20 additions and 20 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
struct image_data_null
|
struct image_null
|
||||||
{
|
{
|
||||||
using pixel_type = uint8_t;
|
using pixel_type = uint8_t;
|
||||||
unsigned char const* getBytes() const { return nullptr; }
|
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_rgba8,
|
||||||
image_gray8,
|
image_gray8,
|
||||||
image_gray16,
|
image_gray16,
|
||||||
|
@ -214,7 +214,7 @@ inline image_any create_image_any(int width,
|
||||||
case image_dtype_gray32f:
|
case image_dtype_gray32f:
|
||||||
return image_any(std::move(image_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_null()));
|
||||||
case image_dtype_rgba8:
|
case image_dtype_rgba8:
|
||||||
default:
|
default:
|
||||||
return image_any(std::move(image_rgba8(width, height, initialize, premultiplied, painted)));
|
return image_any(std::move(image_rgba8(width, height, initialize, premultiplied, painted)));
|
||||||
|
|
|
@ -282,7 +282,7 @@ using image_gray8 = image_data<std::uint8_t> ;
|
||||||
using image_gray16 = image_data<std::int16_t>;
|
using image_gray16 = image_data<std::int16_t>;
|
||||||
using image_gray32f = image_data<float>;
|
using image_gray32f = image_data<float>;
|
||||||
|
|
||||||
enum image_dtype
|
enum image_dtype : std::uint8_t
|
||||||
{
|
{
|
||||||
image_dtype_rgba8 = 0,
|
image_dtype_rgba8 = 0,
|
||||||
image_dtype_gray8,
|
image_dtype_gray8,
|
||||||
|
|
|
@ -69,7 +69,7 @@ struct image_data_dispatcher
|
||||||
composite_(composite),
|
composite_(composite),
|
||||||
nodata_(nodata) {}
|
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
|
void operator() (image_rgba8 const& data_in) const
|
||||||
{
|
{
|
||||||
image_rgba8 data_out(width_, height_, true, true);
|
image_rgba8 data_out(width_, height_, true, true);
|
||||||
|
@ -135,7 +135,7 @@ struct image_data_warp_dispatcher
|
||||||
composite_(composite),
|
composite_(composite),
|
||||||
nodata_(nodata) {}
|
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
|
void operator() (image_rgba8 const& data_in) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
// Assume this would be null type
|
||||||
throw ImageWriterException("Could not write TIFF - Null image provided");
|
throw ImageWriterException("Could not write TIFF - Null image provided");
|
||||||
|
|
|
@ -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_view_gray32f> (image_view_gray32f const& data);
|
||||||
|
|
||||||
template<>
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -921,7 +921,7 @@ void visitor_set_rectangle::operator()<image_rgba8> (image_rgba8 & dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
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");
|
throw std::runtime_error("Set rectangle not support for null images");
|
||||||
}
|
}
|
||||||
|
@ -1250,7 +1250,7 @@ struct visitor_create_view
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
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");
|
throw std::runtime_error("Can not make a view from a null image");
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ void jpeg_saver::operator()<image_view_rgba8> (image_view_rgba8 const& image) co
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
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");
|
throw ImageWriterException("Can not save a null image to jpeg");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {}
|
stream_(stream), t_(t), pal_(pal) {}
|
||||||
|
|
||||||
template<>
|
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");
|
throw ImageWriterException("null images not supported for png");
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
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");
|
throw ImageWriterException("null images not supported for png");
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ void handle_tiff_options(std::string const& type,
|
||||||
tiff_saver::tiff_saver(std::ostream & stream, std::string const& t):
|
tiff_saver::tiff_saver(std::ostream & stream, std::string const& t):
|
||||||
stream_(stream), t_(t) {}
|
stream_(stream), t_(t) {}
|
||||||
template<>
|
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");
|
throw ImageWriterException("null images not supported");
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,7 +335,7 @@ webp_saver::webp_saver(std::ostream & stream, std::string const& t):
|
||||||
stream_(stream), t_(t) {}
|
stream_(stream), t_(t) {}
|
||||||
|
|
||||||
template<>
|
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");
|
throw ImageWriterException("null images not supported");
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ marker_ptr visitor_create_marker::operator()<image_rgba8> (image_rgba8 & data)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
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");
|
throw std::runtime_error("Can not make marker from null image data type");
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ struct visitor_push_thunk
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
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");
|
throw std::runtime_error("Push thunk does not support null images");
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,12 +72,12 @@ std::shared_ptr<image_rgba8> render_pattern<image_rgba8>(rasterizer & ras,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
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,
|
marker const& marker,
|
||||||
agg::trans_affine const& tr,
|
agg::trans_affine const& tr,
|
||||||
double opacity)
|
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 <>
|
template <>
|
||||||
|
|
|
@ -172,7 +172,7 @@ struct warp_image_visitor
|
||||||
scaling_method_(scaling_method),
|
scaling_method_(scaling_method),
|
||||||
filter_factor_(filter_factor) {}
|
filter_factor_(filter_factor) {}
|
||||||
|
|
||||||
void operator() (image_data_null const&) {}
|
void operator() (image_null const&) {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void operator() (T const& source)
|
void operator() (T const& source)
|
||||||
|
|
Loading…
Reference in a new issue