stub in new alpha manipulation functions for mapnik image - #609

This commit is contained in:
Dane Springmeyer 2010-09-24 15:37:19 +00:00
parent 05ab656b57
commit b3810a5f6a
3 changed files with 30 additions and 4 deletions

View file

@ -185,6 +185,9 @@ void export_image()
.add_property("background",make_function
(&image_32::get_background,return_value_policy<copy_const_reference>()),
&image_32::set_background, "The background color of the image.")
.def("set_grayscale_to_alpha",&image_32::set_grayscale_to_alpha, "Set the grayscale values to the alpha channel of the Image")
.def("set_color_to_alpha",&image_32::set_color_to_alpha, "Set a given color to the alpha channel of the Image")
.def("set_alpha",&image_32::set_alpha, "Set the overall alpha channel of the Image")
.def("blend",&blend)
.def("composite",&composite)
.def("tostring",&tostring1)

View file

@ -149,10 +149,22 @@ public:
image_32(Cairo::RefPtr<Cairo::ImageSurface> rhs);
#endif
~image_32();
void set_background(color const& background);
const color& get_background() const;
const image_data_32& data() const;
const color& get_background() const;
void set_grayscale_to_alpha();
void set_color_to_alpha(color const& c);
void set_alpha(float opacity);
inline const image_data_32& data() const
{
return data_;
}
inline image_data_32& data()
{
return data_;

View file

@ -24,6 +24,7 @@
// mapnik
#include <mapnik/graphics.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/global.hpp>
// cairo
#ifdef HAVE_CAIRO
@ -90,9 +91,19 @@ image_32::image_32(Cairo::RefPtr<Cairo::ImageSurface> rhs)
image_32::~image_32() {}
const image_data_32& image_32::data() const
void image_32::set_grayscale_to_alpha()
{
return data_;
}
void image_32::set_color_to_alpha(const color& c)
{
}
void image_32::set_alpha(float opacity)
{
}
void image_32::set_background(const color& background)