[cairo] py2cairo, about bindings to "typedef enum _cairo_operator"

d74n5pohf9 at ipharzle.e4ward.com d74n5pohf9 at ipharzle.e4ward.com
Thu Oct 6 07:14:05 PDT 2011


On Sun, 2011-09-25 at 12:00 -0700, cairo-request at cairographics.org
wrote:
> Hi,
> 
> 
> I am not very used to community mailing lists, nor to ask questions to
> everybody.
> 
> I am using py2cairo, the cairo bindings for Python 2, under Windows. I
> use
> it with pygame, everything works fine, now that I found the correct
> dlls
> (maybe I could write a tuto about that)...
> 
> 
> I am now trying to use the CAIRO_OPERATOR_MULTIPLY (
> http://cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t,
> and
> http://cairographics.org/operators/ in "Blend Modes") which appears in
> cairo
> 1.10, according to the documentation. But, in pycairo 1.10.0, I can't
> find
> it as cairo.OPERATOR_MULTIPLY (
> http://cairographics.org/documentation/pycairo/3/reference/constants.html#constants-operator
> ).
> 
> So, I "git cloned" the rep and found in src/cairomodule.c :
> "CONSTANT(OPERATOR_CLEAR); CONSTANT(OPERATOR_SOURCE); ..."
> Would it be as easy as adding "CONSTANT(OPERATOR_MULTIPLY);" to enable
> it under pycairo ???
Yes.

>  Hopelessly, I can't build py2cairo right now under Windows
> because I don't have any building system installed yet, and it does
> not look easy at all.
> 
pycairo 1.10.0 does not have support for CAIRO_OPERATOR_MULTIPLY. It
should be fixed in the next version.

In the meantime you may be able to use
  cairo.OPERATOR_SATURATE + 1
to get the desired result.

Steve
> 
> Thank you all for this great work around cairo. 




More information about the cairo mailing list