/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.16
 *
 *     Copyright: (c) 2018 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_core.h"

        #include <wx/image.h>



PyDoc_STRVAR(doc_wxImageHistogram_FindFirstUnusedColour, "FindFirstUnusedColour(startR=1, startG=0, startB=0) -> (r, g, b)");

extern "C" {static PyObject *meth_wxImageHistogram_FindFirstUnusedColour(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxImageHistogram_FindFirstUnusedColour(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        unsigned char r;
        unsigned char g;
        unsigned char b;
        unsigned char startR = 1;
        unsigned char startG = 0;
        unsigned char startB = 0;
        const  ::wxImageHistogram *sipCpp;

        static const char *sipKwdList[] = {
            sipName_startR,
            sipName_startG,
            sipName_startB,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|MMM", &sipSelf, sipType_wxImageHistogram, &sipCpp, &startR, &startG, &startB))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->FindFirstUnusedColour(&r,&g,&b,startR,startG,startB);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipBuildResult(0,"(MMM)",r,g,b);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_ImageHistogram, sipName_FindFirstUnusedColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxImageHistogram_MakeKey, "MakeKey(r, g, b) -> unsignedlong");

extern "C" {static PyObject *meth_wxImageHistogram_MakeKey(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxImageHistogram_MakeKey(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        unsigned char r;
        unsigned char g;
        unsigned char b;

        static const char *sipKwdList[] = {
            sipName_r,
            sipName_g,
            sipName_b,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "MMM", &r, &g, &b))
        {
            unsigned long sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes =  ::wxImageHistogram::MakeKey(r,g,b);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_ImageHistogram, sipName_MakeKey, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxImageHistogram(void *, int);}
static void release_wxImageHistogram(void *sipCppV, int)
{
    Py_BEGIN_ALLOW_THREADS

    delete reinterpret_cast< ::wxImageHistogram *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void assign_wxImageHistogram(void *, SIP_SSIZE_T, void *);}
static void assign_wxImageHistogram(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxImageHistogram *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxImageHistogram *>(sipSrc);
}


extern "C" {static void *array_wxImageHistogram(SIP_SSIZE_T);}
static void *array_wxImageHistogram(SIP_SSIZE_T sipNrElem)
{
    return new  ::wxImageHistogram[sipNrElem];
}


extern "C" {static void *copy_wxImageHistogram(const void *, SIP_SSIZE_T);}
static void *copy_wxImageHistogram(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxImageHistogram(reinterpret_cast<const  ::wxImageHistogram *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_wxImageHistogram(sipSimpleWrapper *);}
static void dealloc_wxImageHistogram(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxImageHistogram(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_wxImageHistogram(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxImageHistogram(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::wxImageHistogram *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxImageHistogram();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    {
        const  ::wxImageHistogram* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxImageHistogram, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxImageHistogram(*a0);
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxImageHistogram[] = {
    {SIP_MLNAME_CAST(sipName_FindFirstUnusedColour), SIP_MLMETH_CAST(meth_wxImageHistogram_FindFirstUnusedColour), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxImageHistogram_FindFirstUnusedColour)},
    {SIP_MLNAME_CAST(sipName_MakeKey), SIP_MLMETH_CAST(meth_wxImageHistogram_MakeKey), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxImageHistogram_MakeKey)}
};

PyDoc_STRVAR(doc_wxImageHistogram, "ImageHistogram()");


sipClassTypeDef sipTypeDef__core_wxImageHistogram = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxImageHistogram,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_ImageHistogram,
        {0, 0, 1},
        2, methods_wxImageHistogram,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxImageHistogram,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxImageHistogram,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxImageHistogram,
    assign_wxImageHistogram,
    array_wxImageHistogram,
    copy_wxImageHistogram,
    release_wxImageHistogram,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
