QGLColormap(3qt)
π QGLColormap β aka qglcolormap.3qt π
okay bestie, sit down, grab a strawberry π, because today we're talking about QGLColormap β the Qt 3 class that's literally used for installing custom colormaps into QGLWidgets. yes that's the whole name section, we're already slaying π
πΈ NAME πΈ
QGLColormap β used for installing custom colormaps into QGLWidgets. periodt.
β¨ SYNOPSIS β¨
#include <qglcolormap.h>
π Public Members π
QGLColormap ()QGLColormap ( const QGLColormap & map )~QGLColormap ()QGLColormap & operator= ( const QGLColormap & map )bool isEmpty () constint size () constvoid detach ()void setEntries ( int count, const QRgb * colors, int base = 0 )void setEntry ( int idx, QRgb color )void setEntry ( int idx, const QColor & color )QRgb entryRgb ( int idx ) constQColor entryColor ( int idx ) constint find ( QRgb color ) constint findNearest ( QRgb color ) const
π¦ DESCRIPTION π¦
The QGLColormap class is used for installing custom colormaps into QGLWidgets. that's it, that's the vibe.
QGLColormap gives you a platform independent way of specifying and installing indexed colormaps into QGLWidgets. and it's especially useful when you're using the OpenGL color-index mode. lowkey iconic behavior honestly π
under X11 you must use an X server that supports either a PseudoColor or DirectColor visual class. if your X server is currently only giving you a GrayScale, TrueColor, StaticColor or StaticGray visual, bestie, you will not be able to allocate colorcells for writing. not the moment. if that's your situation, try setting your X server to 8 bit mode β it should then hand you at least a PseudoColor visual. also, heads up: you may experience colormap flashing if your X server is running in 8 bit mode. not cute, but forewarned is forearmed π
under Windows, the size of the colormap is always set to 256 colors. and a fun little bonus: under Windows you can also install colormaps in child widgets. we love options π«Ά
this class uses explicit sharing (see Shared Classes). ykyk.
π Example of use π
#include <qapplication.h>
#include <qglcolormap.h>
int main()
{
QApplication a( argc, argv );
MySuperGLWidget widget( 0 ); // A QGLWidget in color-index mode
QGLColormap colormap;
// This will fill the colormap with colors ranging from
// black to white.
for ( int i = 0; i < colormap.size(); i++ )
colormap.setEntry( i, qRgb( i, i, i ) );
widget.setColormap( colormap );
widget.show();
return a.exec();
}
See also: QGLWidget::setColormap(), QGLWidget::colormap(), Graphics Classes, and Image Processing Classes. π«
π MEMBER FUNCTION DOCUMENTATION π
QGLColormap::QGLColormap ()
Construct a QGLColormap. fresh out the box, no notes β¨
QGLColormap::QGLColormap ( const QGLColormap & map )
Construct a shallow copy of map. sharing is caring, but only on the surface level fr fr.
QGLColormap::~QGLColormap ()
Dereferences the QGLColormap and deletes it if this was the last reference to it. last one out turns off the lights π
void QGLColormap::detach ()
Detaches this QGLColormap from the shared block. going independent, main character energy π¦
QColor QGLColormap::entryColor ( int idx ) const
Returns the QRgb value in the colorcell with index idx.
QRgb QGLColormap::entryRgb ( int idx ) const
Returns the QRgb value in the colorcell with index idx.
int QGLColormap::find ( QRgb color ) const
Returns the index of the color color. if color is not in the map, -1 is returned. it's giving "she's not here" π
int QGLColormap::findNearest ( QRgb color ) const
Returns the index of the color that is the closest match to color color. when you can't find the exact one so you take the nearest vibe check β¨
bool QGLColormap::isEmpty () const
Returns TRUE if the colormap is empty; otherwise returns FALSE. a colormap with no color values set is considered to be empty. no colors, no party π
QGLColormap & QGLColormap::operator= ( const QGLColormap & map )
Assign a shallow copy of map to this QGLColormap.
void QGLColormap::setEntries ( int count, const QRgb * colors, int base = 0 )
Set an array of cells in this colormap. count is the number of colors that should be set, colors is the array of colors, and base is the starting index. bulk editing but make it colormap π
void QGLColormap::setEntry ( int idx, QRgb color )
Set cell at index idx in the colormap to color color.
void QGLColormap::setEntry ( int idx, const QColor & color )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Set the cell with index idx in the colormap to color color.
int QGLColormap::size () const
Returns the number of colorcells in the colormap. how many cells? she counted π₯
π SEE ALSO π
Β©οΈ COPYRIGHT Β©οΈ
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
βοΈ AUTHOR βοΈ
Generated automatically from the source code. (yes, the author is the machine. we stan an autogenerated queen π€π)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (ngl, a little renegade of them, but okay π
)
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qglcolormap.3qt) and the Qt version (3.3.8). don't forget those two, bestie, or they can't help you π
and that's the whole page!! this little legend came from Trolltech AS, dated 2 February 2007, and it's living in the Qt 3.3.8 era π that's the man page, the whole man page, and nothing but the man page. mwah π stay hydrated, keep your colormaps indexed, and go slay β¨π¦π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms