|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.opengl.QGLColormap
public class QGLColormap
The QGLColormap class is used for installing custom colormaps into QGLWidgets. 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 implicit sharing as a memory and speed optimization.
Example of use:
public static void main(String args[]) { QApplication.initialize(args); MyGLWidget widget = new MyGLWidget(); // a QGLWidget in color-index mode QGLColormap colormap = new QGLColormap(); // This will fill the colormap with colors ranging from black to white. for (int i = 0; i < colormap.size(); i++) colormap.setEntry(i, new QColor(i, i, i).rgb()); widget.setColormap(colormap); widget.show(); QApplication.exec(); }
QGLWidget::setColormap()
, and QGLWidget::colormap()
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QGLColormap()
Construct a QGLColormap. |
|
QGLColormap(QGLColormap arg__1)
Construct a shallow copy of map. |
Method Summary | |
---|---|
QGLColormap |
clone()
This method is reimplemented for internal reasons |
QColor |
entryColor(int idx)
Returns the QRgb value in the colorcell with index idx. |
int |
entryRgb(int idx)
Returns the QRgb value in the colorcell with index idx. |
int |
find(int color)
Returns the index of the color color. |
int |
findNearest(int color)
Returns the index of the color that is the closest match to color color. |
boolean |
isEmpty()
Returns true if the colormap is empty; otherwise returns false. |
void |
setEntries(int[] colors)
Set an array of cells in this colormap. |
void |
setEntries(int[] colors,
int base)
Set an array of cells in this colormap. |
void |
setEntry(int idx,
int color)
Set cell at index idx in the colormap to color color. |
void |
setEntry(int idx,
QColor color)
Set the cell with index idx in the colormap to color color. |
int |
size()
Returns the number of colorcells in the colormap. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QGLColormap()
public QGLColormap(QGLColormap arg__1)
Method Detail |
---|
public final QColor entryColor(int idx)
public final int entryRgb(int idx)
public final int find(int color)
public final int findNearest(int color)
public final boolean isEmpty()
public final void setEntry(int idx, QColor color)
public final void setEntry(int idx, int color)
public final int size()
public final void setEntries(int[] colors, int base)
public final void setEntries(int[] colors)
public QGLColormap clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |