// qglcolormap.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtOpenGL Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class QGLColormap { %TypeHeaderCode #include %End public: QGLColormap(); QGLColormap(const QGLColormap &); ~QGLColormap(); void detach(); bool isEmpty() const; int size() const; void setEntries(SIP_PYLIST colors, int base = 0); %MethodCode // The Python implementation takes a list of numbers. QRgb *colours = new QRgb[PyList_GET_SIZE(a0)]; for (int i = 0; i < PyList_GET_SIZE(a0); ++i) colours[i] = PyInt_AsLong(PyList_GET_ITEM(a0, i)); sipCpp->setEntries(PyList_GET_SIZE(a0), colours, a1); delete[] colours; %End void setEntry(int idx, QRgb color); void setEntry(int idx, const QColor &color); QRgb entryRgb(int idx) const; QColor entryColor(int idx) const; int find(QRgb color) const; int findNearest(QRgb color) const; protected: Qt::HANDLE handle(); void setHandle(Qt::HANDLE ahandle); };