Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtOpenGL.QGLColormap Class Reference

The QGLColormap class is used for installing custom colormaps into a QGLWidget. More...

Inheritance diagram for QtOpenGL.QGLColormap:
Collaboration diagram for QtOpenGL.QGLColormap:

Public Member Functions

 QGLColormap ()
 
 
 QGLColormap (QGLColormap arg1)
 
 
virtual void CreateProxy ()
 
new void Detach ()
 
new QColor EntryColor (int idx)
 
 
new uint EntryRgb (int idx)
 
 
new int Find (uint color)
 
 
new int FindNearest (uint color)
 
 
new bool IsEmpty ()
 
 
new void SetEntries (int count, ref uint colors, int @base=0)
 
 
new void SetEntry (int idx, QColor color)
 
 
new void SetEntry (int idx, uint color)
 
 
new int Size ()
 
 
new void Dispose ()
 

Protected Member Functions

 QGLColormap (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QGLColormap class is used for installing custom colormaps into a QGLWidget.

QGLColormap provides a platform independent way of specifying and installing indexed colormaps for a QGLWidget. 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.

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 implicit sharing as a memory and speed optimization.

Example of use:

#include <QApplication>

#include <QGLColormap>

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

MySuperGLWidget widget; // a QGLWidget in color-index mode

QGLColormap colormap;

// This will fill the colormap with colors ranging from

// black to white.

const int size = 256;

for (int i = 0; i < size; ++i)

colormap.setEntry(i, qRgb(i, i, i));

widget.setColormap(colormap);

widget.show();

return app.exec();

}

See also QGLWidget::setColormap() and QGLWidget::colormap().

Constructor & Destructor Documentation

QtOpenGL.QGLColormap.QGLColormap ( System.Type  dummy)
protected
QtOpenGL.QGLColormap.QGLColormap ( )

Construct a QGLColormap.

QtOpenGL.QGLColormap.QGLColormap ( QGLColormap  arg1)

Construct a shallow copy of map.

Member Function Documentation

virtual void QtOpenGL.QGLColormap.CreateProxy ( )
virtual
new void QtOpenGL.QGLColormap.Detach ( )
new void QtOpenGL.QGLColormap.Dispose ( )
new QColor QtOpenGL.QGLColormap.EntryColor ( int  idx)

Returns the QRgb value in the colorcell with index idx.

new uint QtOpenGL.QGLColormap.EntryRgb ( int  idx)

Returns the QRgb value in the colorcell with index idx.

new int QtOpenGL.QGLColormap.Find ( uint  color)

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

new int QtOpenGL.QGLColormap.FindNearest ( uint  color)

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

new bool QtOpenGL.QGLColormap.IsEmpty ( )

Returns true if the colormap is empty or it is not in use by a QGLWidget; otherwise returns false.

A colormap with no color values set is considered to be empty. For historical reasons, a colormap that has color values set but which is not in use by a QGLWidget is also considered empty.

Compare size() with zero to determine if the colormap is empty regardless of whether it is in use by a QGLWidget or not.

See also size().

new void QtOpenGL.QGLColormap.SetEntries ( int  count,
ref uint  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. The first element in colors is set at base in the colormap.

new void QtOpenGL.QGLColormap.SetEntry ( int  idx,
QColor  color 
)

This is an overloaded function.

Set the cell with index idx in the colormap to color color.

new void QtOpenGL.QGLColormap.SetEntry ( int  idx,
uint  color 
)

Set cell at index idx in the colormap to color color.

new int QtOpenGL.QGLColormap.Size ( )

Returns the number of colorcells in the colormap.

Member Data Documentation

SmokeInvocation QtOpenGL.QGLColormap.interceptor
protected

Property Documentation

virtual System.IntPtr QtOpenGL.QGLColormap.SmokeObject
getset