From d2fb59ca4e7896aa2269abb4101dccba1bf1bd62 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 4 May 2014 21:39:38 +0200 Subject: [PATCH] a few more missing python function bindings --- src/libpython/core.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/libpython/core.cpp b/src/libpython/core.cpp index 40a92dbb..3dbf4bfa 100644 --- a/src/libpython/core.cpp +++ b/src/libpython/core.cpp @@ -647,22 +647,34 @@ static void bitmap_write2(Bitmap *bitmap, Bitmap::EFileFormat fmt, Stream *strea bitmap->write(fmt, stream, compression); } -static ref bitmap_convert_1(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, +static void bitmap_convert_0(Bitmap *bitmap, Bitmap *target) { + bitmap->convert(target); +} + +static void bitmap_convert_1(Bitmap *bitmap, Bitmap *target, Float multiplier) { + bitmap->convert(target, multiplier); +} + +static void bitmap_convert_2(Bitmap *bitmap, Bitmap *target, Float multiplier, Spectrum::EConversionIntent intent) { + bitmap->convert(target, multiplier, intent); +} + +static ref bitmap_convert_3(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, Float gamma, Float multiplier, Spectrum::EConversionIntent intent) { return bitmap->convert(pixelFormat, componentFormat, gamma, multiplier, intent); } -static ref bitmap_convert_2(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, +static ref bitmap_convert_4(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, Float gamma, Float multiplier) { return bitmap->convert(pixelFormat, componentFormat, gamma, multiplier); } -static ref bitmap_convert_3(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, +static ref bitmap_convert_5(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, Float gamma) { return bitmap->convert(pixelFormat, componentFormat, gamma); } -static ref bitmap_convert_4(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat) { +static ref bitmap_convert_6(Bitmap *bitmap, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat) { return bitmap->convert(pixelFormat, componentFormat); } @@ -1351,10 +1363,13 @@ void export_core() { .def("drawRect", &Bitmap::drawRect) .def("fillRect", &Bitmap::fillRect) .def("drawWorkUnit", &Bitmap::drawWorkUnit) - .def("convert", &bitmap_convert_1, BP_RETURN_VALUE) - .def("convert", &bitmap_convert_2, BP_RETURN_VALUE) + .def("convert", &bitmap_convert_0) + .def("convert", &bitmap_convert_1) + .def("convert", &bitmap_convert_2) .def("convert", &bitmap_convert_3, BP_RETURN_VALUE) .def("convert", &bitmap_convert_4, BP_RETURN_VALUE) + .def("convert", &bitmap_convert_5, BP_RETURN_VALUE) + .def("convert", &bitmap_convert_6, BP_RETURN_VALUE) .def("fromByteArray", &bitmap_fromByteArray) .def("toByteArray", &bitmap_toByteArray_1) .def("toByteArray", &bitmap_toByteArray_2) @@ -1724,6 +1739,7 @@ void export_core() { bp::class_ properties("Properties"); properties .def(bp::init()) + .def(bp::init()) .def("getPluginName", &Properties::getPluginName, BP_RETURN_CONSTREF) .def("setPluginName", &Properties::setPluginName) .def("getID", &Properties::getID, BP_RETURN_CONSTREF)