Eneboo - Documentación para desarrolladores
Clases | Métodos públicos | Amigas
Referencia de la Clase QGLColormap

The QGLColormap class is used for installing custom colormaps into QGLWidgets.OpenGLQGLColormap provides a platform independent way of specifying and installing indexed colormaps into QGLWidgets. QGLColormap is especially useful when using the OpenGL color-index mode. Más...

#include <qglcolormap.h>

Lista de todos los miembros.

Clases

class  Private

Métodos públicos

 QGLColormap ()
 QGLColormap (const QGLColormap &)
 ~QGLColormap ()
QGLColormapoperator= (const QGLColormap &)
bool isEmpty () const
int size () const
void 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) const
QColor entryColor (int idx) const
int find (QRgb color) const
int findNearest (QRgb color) const
 QGLColormap ()
 QGLColormap (const QGLColormap &)
 ~QGLColormap ()
QGLColormapoperator= (const QGLColormap &)
bool isEmpty () const
int size () const
void 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) const
QColor entryColor (int idx) const
int find (QRgb color) const
int findNearest (QRgb color) const

Amigas

class QGLWidget

Descripción detallada

The QGLColormap class is used for installing custom colormaps into QGLWidgets.

OpenGL

QGLColormap provides a platform independent way of specifying and installing indexed colormaps into QGLWidgets. QGLColormap is especially useful when using the OpenGL color-index mode.

Under X11 you must use an X server that supports either a PseudoColor or DirectColor visual class. If your X server currently only provides a GrayScale, TrueColor, StaticColor or StaticGray visual, you will not be able to allocate colorcells for writing. If this is the case, try setting your X server to 8 bit mode. It should then provide you with at least a PseudoColor visual. Note that you may experience colormap flashing if your X server is running in 8 bit mode.

Under Windows the size of the colormap is always set to 256 colors. Note that under Windows you can also install colormaps in child widgets.

This class uses explicit sharing (see Shared Classes).

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();
    }
Ver también:
QGLWidget::setColormap(), QGLWidget::colormap()

Documentación del constructor y destructor

QGLColormap::QGLColormap ( )

Construct a QGLColormap.

QGLColormap::QGLColormap ( const QGLColormap map)

Construct a shallow copy of map.

QGLColormap::~QGLColormap ( )

Dereferences the QGLColormap and deletes it if this was the last reference to it.

QGLColormap::QGLColormap ( )
QGLColormap::QGLColormap ( const QGLColormap )
QGLColormap::~QGLColormap ( )

Documentación de las funciones miembro

void QGLColormap::detach ( )

Detaches this QGLColormap from the shared block.

void QGLColormap::detach ( )
QColor QGLColormap::entryColor ( int  idx) const

Returns the QRgb value in the colorcell with index idx.

QColor QGLColormap::entryColor ( int  idx) const
QRgb QGLColormap::entryRgb ( int  idx) const

Returns the QRgb value in the colorcell with index idx.

QRgb QGLColormap::entryRgb ( int  idx) const
int QGLColormap::find ( QRgb  color) const
int QGLColormap::find ( QRgb  color) const

Returns the index of the color color. If color is not in the map, -1 is returned.

int QGLColormap::findNearest ( QRgb  color) const

Returns the index of the color that is the closest match to color color.

int QGLColormap::findNearest ( QRgb  color) const
bool QGLColormap::isEmpty ( void  ) const

Returns TRUE if the colormap is empty; otherwise returns FALSE. A colormap with no color values set is considered to be empty.

bool QGLColormap::isEmpty ( ) const
QGLColormap & QGLColormap::operator= ( const QGLColormap map)

Assign a shallow copy of map to this QGLColormap.

QGLColormap& QGLColormap::operator= ( const 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.

void QGLColormap::setEntries ( int  count,
const QRgb colors,
int  base = 0 
)
void QGLColormap::setEntry ( int  idx,
const QColor color 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Set the cell with index idx in the colormap to color color.

void QGLColormap::setEntry ( int  idx,
QRgb  color 
)
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 
)
int QGLColormap::size ( ) const
int QGLColormap::size ( ) const

Returns the number of colorcells in the colormap.


Documentación de las funciones relacionadas y clases amigas

QGLWidget [friend]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'