Removed all the code for the previous type of image and image_32. Ref #2633

This commit is contained in:
Blake Thompson 2015-01-21 17:57:16 -06:00
parent b57b1c12d6
commit 93f835177b
38 changed files with 3 additions and 333 deletions

View file

@ -1,6 +1,5 @@
#include "bench_framework.hpp"
#include <mapnik/image_util.hpp>
#include <mapnik/graphics.hpp>
class test : public benchmark::test_case
{

View file

@ -5,7 +5,6 @@
#include <mapnik/vertex.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/wkt/wkt_factory.hpp>
#include <mapnik/wkt/wkt_grammar_impl.hpp>
#include <mapnik/geometry.hpp>

View file

@ -1,7 +1,6 @@
#include "bench_framework.hpp"
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/datasource_cache.hpp>

View file

@ -2,7 +2,6 @@
#include <mapnik/map.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>

View file

@ -2,7 +2,6 @@
#include <mapnik/map.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>

View file

@ -35,14 +35,12 @@
#pragma GCC diagnostic pop
// mapnik
#include <mapnik/graphics.hpp>
#include <mapnik/color.hpp>
#include <mapnik/palette.hpp>
#include <mapnik/image.hpp>
#include <mapnik/image_view_any.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/image_reader.hpp>
#include <mapnik/image_compositing.hpp>
#include <mapnik/image_view_any.hpp>
// cairo
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
@ -52,7 +50,6 @@
#include <cairo.h>
#endif
using mapnik::image;
using mapnik::image_data_any;
using mapnik::image_reader;
using mapnik::get_image_reader;
@ -250,21 +247,6 @@ std::shared_ptr<image_data_any> from_cairo(PycairoSurface* py_surface)
}
#endif
// ============ image any
std::shared_ptr<image> read_from_file_impl(std::string const& filename)
{
std::shared_ptr<image> img = std::make_shared<image>();
std::unique_ptr<image_reader> reader(get_image_reader(filename));
if (reader)
{
unsigned w = reader->width();
unsigned h = reader->height();
img->set_data(reader->read(0, 0, w, h));
}
return img;
}
// =========================
void export_image()
{
using namespace boost::python;
@ -308,14 +290,6 @@ void export_image()
.value("divide", mapnik::divide)
;
class_<image, std::shared_ptr<image>, boost::noncopyable > ("ImageAny", "This class represents an any Image object", no_init)
.def("width",&image::width)
.def("height",&image::height)
.def("open", &read_from_file_impl)
.staticmethod("open")
.def("save",&image::save_to_file)
;
class_<image_data_any,std::shared_ptr<image_data_any>, boost::noncopyable >("Image","This class represents a 32 bit RGBA image.",init<int,int>())
.def("width",&image_data_any::width)
.def("height",&image_data_any::height)

View file

@ -99,7 +99,6 @@ void export_logger();
#include <mapnik/datasource.hpp>
#include <mapnik/layer.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/image_data_any.hpp>

View file

@ -43,7 +43,6 @@
#include <mapnik/path_expression.hpp>
#include "mapnik_enumeration.hpp"
#include "mapnik_svg.hpp"
#include <mapnik/graphics.hpp>
#include <mapnik/expression_node.hpp>
#include <mapnik/value_error.hpp>
#include <mapnik/marker_cache.hpp> // for known_svg_prefix_

View file

@ -24,7 +24,6 @@
#include <mapnik/layer.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/feature_type_style.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/text/placements/dummy.hpp>
#include <mapnik/text/text_properties.hpp>

View file

@ -22,7 +22,6 @@
#include <boost/bind.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/layer.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/scale_denominator.hpp>

View file

@ -1,106 +0,0 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_GRAPHICS_HPP
#define MAPNIK_GRAPHICS_HPP
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/color.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/box2d.hpp>
#include <mapnik/image_view.hpp>
#include <mapnik/global.hpp>
// stl
#include <algorithm>
#include <string>
#include <memory>
// boost
#include <boost/optional/optional.hpp>
namespace mapnik
{
class MAPNIK_DECL image_32
{
private:
image_data_rgba8 data_;
bool painted_;
public:
using pixel_type = typename image_data_rgba8::pixel_type;
image_32(int width,int height);
image_32(image_32 const& rhs);
image_32(image_data_rgba8 && data);
~image_32();
void painted(bool painted)
{
data_.painted(painted);
}
bool painted() const
{
return data_.painted();
}
inline const image_data_rgba8& data() const
{
return data_;
}
inline image_data_rgba8& data()
{
return data_;
}
inline const unsigned char* raw_data() const
{
return data_.getBytes();
}
inline unsigned char* raw_data()
{
return data_.getBytes();
}
inline image_view_rgba8 get_view(unsigned x,unsigned y, unsigned w,unsigned h)
{
return image_view_rgba8(x,y,w,h,data_);
}
public:
inline unsigned width() const
{
return data_.width();
}
inline unsigned height() const
{
return data_.height();
}
};
}
#endif // MAPNIK_GRAPHICS_HPP

View file

@ -1,49 +0,0 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_IMAGE_HPP
#define MAPNIK_IMAGE_HPP
#include <mapnik/image_data_any.hpp>
#include <mapnik/config.hpp>
namespace mapnik {
class MAPNIK_DECL image
{
public:
image() = default;
inline std::size_t width() const { return data_.width(); }
inline std::size_t height() const { return data_.height(); }
void set_data(image_data_any && data);
inline image_data_any const& data() const { return data_;}
static image read_from_file(std::string const& filename);
void save_to_file(std::string const& filename, std::string const& format);
private:
image(image && other) = default;
image(image_data_any && data) noexcept;
image_data_any data_;
};
}
#endif // MAPNIK_IMAGE_HPP

View file

@ -24,7 +24,6 @@
#include <mapnik/agg_renderer.hpp>
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/agg_helpers.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/layer.hpp>

View file

@ -22,7 +22,6 @@
// mapnik
#include <mapnik/make_unique.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/agg_renderer.hpp>

View file

@ -23,7 +23,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/label_collision_detector.hpp>

View file

@ -26,7 +26,6 @@
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/symbolizer_keys.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/vertex.hpp>
#include <mapnik/renderer_common.hpp>

View file

@ -23,7 +23,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/agg_rasterizer.hpp>

View file

@ -22,7 +22,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#include <mapnik/agg_helpers.hpp>
#include <mapnik/agg_renderer.hpp>

View file

@ -21,7 +21,6 @@
*****************************************************************************/
// mapnik
#include <mapnik/graphics.hpp>
#include <mapnik/agg_helpers.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/agg_rasterizer.hpp>

View file

@ -23,7 +23,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/agg_helpers.hpp>
#include <mapnik/agg_rasterizer.hpp>

View file

@ -26,7 +26,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_helpers.hpp>
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/symbolizer.hpp>

View file

@ -25,7 +25,6 @@
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image_scaling.hpp>
#include <mapnik/image_compositing.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/raster_colorizer.hpp>
#include <mapnik/agg_rasterizer.hpp>

View file

@ -23,7 +23,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/text/symbolizer_helpers.hpp>
#include <mapnik/pixel_position.hpp>

View file

@ -23,7 +23,6 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/text/symbolizer_helpers.hpp>

View file

@ -152,7 +152,6 @@ source = Split(
miniz_png.cpp
color.cpp
conversions.cpp
image.cpp
image_convert.cpp
image_compositing.cpp
image_scaling.cpp
@ -172,7 +171,6 @@ source = Split(
font_set.cpp
function_call.cpp
gradient.cpp
graphics.cpp
parse_path.cpp
image_reader.cpp
cairo_io.cpp

View file

@ -24,7 +24,6 @@
#include <mapnik/feature_style_processor_impl.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data_any.hpp>
#if defined(GRID_RENDERER)

View file

@ -1,56 +0,0 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/global.hpp>
#include <mapnik/color.hpp>
// agg
#include "agg_rendering_buffer.h"
#include "agg_pixfmt_rgba.h"
#include "agg_color_rgba.h"
#ifdef HAVE_CAIRO
#include <mapnik/cairo/cairo_context.hpp>
#endif
namespace mapnik
{
image_32::image_32(int width,int height)
: data_(width,height),
painted_(false) {}
image_32::image_32(image_32 const& rhs)
: data_(rhs.data_),
painted_(rhs.painted_) {}
image_32::image_32(image_data_rgba8 && data)
: data_(std::move(data)),
painted_(false) {}
image_32::~image_32() {}
}

View file

@ -1,61 +0,0 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <mapnik/image.hpp>
#include <mapnik/image_reader.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/tiff_io.hpp>
#include <fstream>
namespace mapnik {
image::image(image_data_any && data) noexcept
: data_(std::move(data)) {}
void image::set_data(image_data_any && data)
{
data_ = std::move(data);
}
image image::read_from_file(std::string const& filename)
{
std::unique_ptr<image_reader> reader(get_image_reader(filename));
if (reader)
{
unsigned w = reader->width();
unsigned h = reader->height();
image_data_any data = reader->read(0, 0, w, h);
return image(std::move(data));
}
else
{
return image();
}
}
void image::save_to_file(std::string const& filename, std::string const& format)
{
mapnik::save_to_file(data_, filename, format);
}
}

View file

@ -22,7 +22,6 @@
// mapnik
#include <mapnik/text/renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/grid/grid.hpp>
#include <mapnik/text/text_properties.hpp>
#include <mapnik/font_engine_freetype.hpp>

View file

@ -4,7 +4,6 @@
#include <mapnik/unicode.hpp>
#include <mapnik/map.hpp>
#include <mapnik/save_map.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/memory_datasource.hpp>
#include <mapnik/feature_type_style.hpp>

View file

@ -13,7 +13,6 @@
#include <mapnik/rule.hpp>
#include <mapnik/feature_type_style.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/color_factory.hpp>
#include <mapnik/save_map.hpp>

View file

@ -1,6 +1,5 @@
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
#include <mapnik/graphics.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/image_reader.hpp>
#include <mapnik/image_util.hpp>

View file

@ -6,7 +6,6 @@
#include <mapnik/layer.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/feature_type_style.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/expression.hpp>

View file

@ -7,7 +7,6 @@
#if defined(HAVE_CAIRO)
#include <mapnik/cairo/cairo_renderer.hpp>
#endif
#include <mapnik/graphics.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>

View file

@ -4,7 +4,6 @@
#include <mapnik/version.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/unicode.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>

View file

@ -30,7 +30,6 @@
#include <mapnik/marker.hpp>
#include <mapnik/marker_cache.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/svg/svg_path_adapter.hpp>
#include <mapnik/svg/svg_renderer_agg.hpp>
#include <mapnik/svg/svg_path_attributes.hpp>