Permalink
Browse files

expose more compositing options in python (the non-agg custom ones) t…

…o set up for testing as per #1493 and #1369
  • Loading branch information...
1 parent 798b101 commit 7866cc3dec0873e5fa508a6bcef8a4cc1eed3887 Dane Springmeyer committed Oct 2, 2012
@@ -176,6 +176,7 @@ boost::shared_ptr<image_32> from_cairo(PycairoSurface* surface)
void export_image()
{
using namespace boost::python;
+ // NOTE: must match list in include/mapnik/image_compositing.hpp
enum_<mapnik::composite_mode_e>("CompositeOp")
.value("clear", mapnik::clear)
.value("src", mapnik::src)
@@ -204,7 +205,12 @@ void export_image()
.value("exclusion", mapnik::exclusion)
.value("contrast", mapnik::contrast)
.value("invert", mapnik::invert)
- .value("invert_rgb", mapnik::invert_rgb)
+ .value("grain_merge", mapnik::grain_merge)
+ .value("grain_extract", mapnik::grain_extract)
+ .value("hue", mapnik::hue)
+ .value("saturation", mapnik::saturation)
+ .value("color", mapnik::_color)
+ .value("value", mapnik::_value)
;
class_<image_32,boost::shared_ptr<image_32> >("Image","This class represents a 32 bit RGBA image.",init<int,int>())
@@ -98,6 +98,9 @@ def test_compare_images():
if not validate_pixels_are_not_premultiplied(a):
print '%s not validly demultiplied' % (name)
a.save(actual)
+ if not os.path.exists(expected):
+ print 'generating expected test image: %s' % expected
+ a.save(expected)
expected_im = mapnik.Image.open(expected)
# compare them
eq_(a.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7866cc3

Please sign in to comment.