|
int | allocate (QRgb color, uint flags=0, quint8 context=0) |
|
int | allocate (QRgb color, uint flags=0, quint8 context=0) |
|
const QRgb * | colors () const |
|
const QRgb * | colors () const |
|
int | find (QRgb color) const |
|
int | find (QRgb color) const |
|
int | findNearest (QRgb color) const |
|
int | findNearest (QRgb color) const |
|
int | maxSize () const |
|
int | maxSize () const |
|
QGLCmap & | operator= (const QGLCmap &map) |
|
QGLCmap & | operator= (const QGLCmap &map) |
|
| QGLCmap (int maxSize=256) |
|
| QGLCmap (const QGLCmap &map) |
|
| QGLCmap (int maxSize=256) |
|
| QGLCmap (const QGLCmap &map) |
|
void | resize (int newSize) |
|
void | resize (int newSize) |
|
void | setEntry (int idx, QRgb color, uint flags=0, quint8 context=0) |
|
void | setEntry (int idx, QRgb color, uint flags=0, quint8 context=0) |
|
int | size () const |
|
int | size () const |
|
| ~QGLCmap () |
|
| ~QGLCmap () |
|
Definition at line 180 of file qgl_win.cpp.
◆ Flags [1/2]
Enumerator |
---|
Reserved | |
Reserved | |
Definition at line 183 of file qgl_win.cpp.
◆ Flags [2/2]
◆ QGLCmap() [1/4]
QGLCmap::QGLCmap |
( |
int |
maxSize = 256 | ) |
|
◆ QGLCmap() [2/4]
QGLCmap::QGLCmap |
( |
const QGLCmap & |
map | ) |
|
◆ ~QGLCmap() [1/2]
◆ QGLCmap() [3/4]
QGLCmap::QGLCmap |
( |
int |
maxSize = 256 | ) |
|
◆ QGLCmap() [4/4]
QGLCmap::QGLCmap |
( |
const QGLCmap & |
map | ) |
|
◆ ~QGLCmap() [2/2]
◆ allocate() [1/2]
int QGLCmap::allocate |
( |
QRgb |
color, |
|
|
uint |
flags = 0 , |
|
|
quint8 |
context = 0 |
|
) |
| |
Definition at line 333 of file qgl_win.cpp.
335 int idx =
find(color);
int find(QRgb color) const
QVector< quint8 > contextArray
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the vector, searching forward from ind...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
QVector< quint8 > allocArray
int size() const
Returns the number of items in the vector.
QMap< uint, int > colorMap
QVector< uint > colorArray
◆ allocate() [2/2]
int QGLCmap::allocate |
( |
QRgb |
color, |
|
|
uint |
flags = 0 , |
|
|
quint8 |
context = 0 |
|
) |
| |
◆ colors() [1/2]
const QRgb * QGLCmap::colors |
( |
| ) |
const |
Definition at line 392 of file qgl_win.cpp.
T * data()
Returns a pointer to the data stored in the vector.
QVector< uint > colorArray
◆ colors() [2/2]
const QRgb* QGLCmap::colors |
( |
| ) |
const |
◆ detach() [1/2]
Definition at line 255 of file qgl_win.cpp.
QVector< quint8 > contextArray
QVector< quint8 > allocArray
QMap< uint, int > colorMap
QVector< uint > colorArray
◆ detach() [2/2]
◆ find() [1/2]
int QGLCmap::find |
( |
QRgb |
color | ) |
const |
Definition at line 292 of file qgl_win.cpp.
#define it(className, varName)
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
QMap< uint, int > colorMap
The QMap class is a template class that provides a skip-list-based dictionary.
◆ find() [2/2]
int QGLCmap::find |
( |
QRgb |
color | ) |
const |
◆ findNearest() [1/2]
int QGLCmap::findNearest |
( |
QRgb |
color | ) |
const |
Definition at line 301 of file qgl_win.cpp.
303 int idx =
find(color);
306 int mapSize =
size();
307 int mindist = 200000;
310 int b =
qBlue(color);
311 int rx, gx, bx, dist;
312 for (
int i=0; i < mapSize; i++) {
319 dist = rx*rx + gx*gx + bx*bx;
320 if (dist < mindist) {
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
int find(QRgb color) const
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
QVector< quint8 > allocArray
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
QVector< uint > colorArray
◆ findNearest() [2/2]
int QGLCmap::findNearest |
( |
QRgb |
color | ) |
const |
◆ maxSize() [1/2]
int QGLCmap::maxSize |
( |
| ) |
const |
◆ maxSize() [2/2]
int QGLCmap::maxSize |
( |
| ) |
const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ resize() [1/2]
void QGLCmap::resize |
( |
int |
newSize | ) |
|
Definition at line 273 of file qgl_win.cpp.
275 if (newSize < 0 || newSize >
d->
maxSize) {
276 qWarning(
"QGLCmap::resize(): size out of range");
279 int oldSize =
size();
285 if (newSize > oldSize) {
void resize(int size)
Sets the size of the vector to size.
QVector< quint8 > contextArray
Q_CORE_EXPORT void qWarning(const char *,...)
QVector< quint8 > allocArray
T * data()
Returns a pointer to the data stored in the vector.
QVector< uint > colorArray
◆ resize() [2/2]
void QGLCmap::resize |
( |
int |
newSize | ) |
|
◆ setEntry() [1/2]
void QGLCmap::setEntry |
( |
int |
idx, |
|
|
QRgb |
color, |
|
|
uint |
flags = 0 , |
|
|
quint8 |
context = 0 |
|
) |
| |
Definition at line 368 of file qgl_win.cpp.
371 qWarning(
"QGLCmap::set(): Index out of range");
375 int mapSize =
size();
376 if (idx >= mapSize) {
QVector< quint8 > contextArray
Q_CORE_EXPORT void qWarning(const char *,...)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
QVector< quint8 > allocArray
QMap< uint, int > colorMap
QVector< uint > colorArray
◆ setEntry() [2/2]
void QGLCmap::setEntry |
( |
int |
idx, |
|
|
QRgb |
color, |
|
|
uint |
flags = 0 , |
|
|
quint8 |
context = 0 |
|
) |
| |
◆ size() [1/2]
int QGLCmap::size |
( |
| ) |
const |
Definition at line 243 of file qgl_win.cpp.
int size() const
Returns the number of items in the vector.
QVector< uint > colorArray
◆ size() [2/2]
int QGLCmap::size |
( |
| ) |
const |
The documentation for this class was generated from the following files: