File: _Color.cpp

package info (click to toggle)
pythonmagick 0.9.19-11.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,812 kB
  • sloc: sh: 4,363; cpp: 2,849; perl: 279; python: 175; makefile: 126
file content (64 lines) | stat: -rw-r--r-- 3,911 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

// Boost Includes ==============================================================
#include <boost/python.hpp>
#include <boost/cstdint.hpp>

// Includes ====================================================================
#include <Magick++/Color.h>

// Using =======================================================================
using namespace boost::python;

// Module ======================================================================
void Export_pyste_src_Color()
{
    class_< Magick::Color >("Color", init<  >())
        .def(init< MagickCore::Quantum, MagickCore::Quantum, MagickCore::Quantum >())
        .def(init< MagickCore::Quantum, MagickCore::Quantum, MagickCore::Quantum, MagickCore::Quantum >())
        .def(init< const std::string& >())
        .def(init< const char* >())
        .def(init< const Magick::Color& >())
#if MagickLibVersion < 0x700
        .def(init< const MagickCore::PixelPacket& >())
        .def("redQuantum", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::redQuantum)
        .def("redQuantum", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::redQuantum)
        .def("greenQuantum", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::greenQuantum)
        .def("greenQuantum", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::greenQuantum)
        .def("blueQuantum", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::blueQuantum)
        .def("blueQuantum", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::blueQuantum)
        .def("alphaQuantum", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::alphaQuantum)
        .def("alphaQuantum", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::alphaQuantum)
        .def("alpha", (void (Magick::Color::*)(double) )&Magick::Color::alpha)
        .def("alpha", (double (Magick::Color::*)() const)&Magick::Color::alpha)
        .def("intensity", &Magick::Color::intensity)
        .def("scaleDoubleToQuantum", &Magick::Color::scaleDoubleToQuantum)
        .def("scaleQuantumToDouble", (double (*)(const MagickCore::Quantum))&Magick::Color::scaleQuantumToDouble)
        .def("scaleQuantumToDouble", (double (*)(const double))&Magick::Color::scaleQuantumToDouble)
        .staticmethod("scaleDoubleToQuantum")
        .staticmethod("scaleQuantumToDouble")
        .def("to_MagickCore_PixelPacket", &Magick::Color::operator MagickCore::PixelPacket)
#else
        .def(init< const MagickCore::PixelInfo& >())
        .def("quantumRed", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::quantumRed)
        .def("quantumRed", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::quantumRed)
        .def("quantumGreen", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::quantumGreen)
        .def("quantumGreen", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::quantumGreen)
        .def("quantumBlue", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::quantumBlue)
        .def("quantumBlue", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::quantumBlue)
        .def("quantumAlpha", (void (Magick::Color::*)(MagickCore::Quantum) )&Magick::Color::quantumAlpha)
        .def("quantumAlpha", (MagickCore::Quantum (Magick::Color::*)() const)&Magick::Color::quantumAlpha)
        .def("to_MagickCore_PixelInfo", &Magick::Color::operator MagickCore::PixelInfo)
#endif
        .def("isValid", (void (Magick::Color::*)(bool) )&Magick::Color::isValid)
        .def("isValid", (bool (Magick::Color::*)() const)&Magick::Color::isValid)
        .def( self > self )
        .def( self < self )
        .def( self == self )
        .def( self != self )
        .def( self <= self )
        .def( self >= self )
        .def("to_std_string", &Magick::Color::operator std::string)
    ;

implicitly_convertible<std::string,Magick::Color>();}