/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 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) -> Tuple[int, int, int]");

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);
        }
    }

    sipNoMethod(sipParseErr, sipName_ImageHistogram, sipName_FindFirstUnusedColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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);
        }
    }

    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 *array_wxImageHistogram(Py_ssize_t);}
static void *array_wxImageHistogram(Py_ssize_t sipNrElem)
{
    return new ::wxImageHistogram[sipNrElem];
}


extern "C" {static void array_delete_wxImageHistogram(void *);}
static void array_delete_wxImageHistogram(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxImageHistogram *>(sipCpp);
}


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


extern "C" {static void *copy_wxImageHistogram(const void *, Py_ssize_t);}
static void *copy_wxImageHistogram(const void *sipSrc, Py_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[] = {
    {sipName_FindFirstUnusedColour, SIP_MLMETH_CAST(meth_wxImageHistogram_FindFirstUnusedColour), METH_VARARGS|METH_KEYWORDS, doc_wxImageHistogram_FindFirstUnusedColour},
    {sipName_MakeKey, SIP_MLMETH_CAST(meth_wxImageHistogram_MakeKey), METH_VARARGS|METH_KEYWORDS, doc_wxImageHistogram_MakeKey}
};

PyDoc_STRVAR(doc_wxImageHistogram, "ImageHistogram() -> None");


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,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxImageHistogram,
    assign_wxImageHistogram,
    array_wxImageHistogram,
    copy_wxImageHistogram,
    release_wxImageHistogram,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxImageHistogram,
    sizeof (::wxImageHistogram),
};
